generate_common_fun_ldr
Generates FATEK .ldr ladder-logic files from native FUN specs and I/O contracts, with optional acceptance checks and target-profile validation.
Instructions
Generate .ldr from native FUN entries with series EN.
Prefer native FUN (scaling: lcnv). get_instruction_capabilities gives setup/evidence;
LCNV needs an initialized table and has no offline model.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"output_name": "<output_name>",
"spec": "<spec>",
"io_contract": "<io_contract>"
},
"name": "generate_common_fun_ldr"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | Ordered parameterized move, integer/float math, analog, bit access, logic, comparison, conversion, timer, counter, peripheral, pulse or PID specification; one network per function. | |
| acceptance | No | Optional executable scan cases checked before and after encoding. | |
| io_contract | Yes | Complete user-authorized physical X inputs and Y outputs. | |
| output_name | Yes | New plain .ldr filename in the artifact directory; never overwrites. | |
| strict_writers | No | When true, reject conflicting or unsafe multiple device writers. | |
| target_profile | No | Sampled CPU/header profile; required for physical peripheral, pulse, IMDIO and TPCTL entries, otherwise optional with FBs-20MC default. | |
| require_acceptance | No | When true, reject generation unless acceptance cases are supplied. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Validation error code, message and written=false. | |
| artifact | No | Artifact metadata on success; absent when validation fails before writing. | |
| warnings | No | Generation or verification warnings; empty when none were reported. | |
| diagnosis | No | LDR failure diagnosis, when available. | |
| response_mode | Yes | Compact or full response. |