place_fb_in_ladder
Create a function block in a Ladder section for any project DFB, automatically generating the block geometry and wiring a boolean input to the rung.
Instructions
Place a function block in LADDER from scratch — NO template needed — for any project DFB. Then build_project to confirm.
An FFB in Ladder can't normally be hand-authored (CE owns the pin layout), but this generates the correct geometry automatically: it reads the DFB's pin interface, places the block (height = max(in,out)+1), wires ONE boolean input on its pin-row to the rail (EN left enabled), and binds the rest.
fb_type: a project DFB type (e.g. 'FC_Valve', 'FC_VSD', 'Motor'). instance_name: the FB instance variable. bindings: {pin: variable_or_literal} for the data / in-out / output pins (e.g. {"Valve":"AV2","ExtReset":"0"}); auto-declared with the right types. rung_input: which BOOL input the rung drives (default: first boolean input). rung_contact: the BOOL variable feeding that input (default '_EN'). For elementary EFBs (TON/CTU/…) author in FBD instead. Multiple blocks = call once per block (each makes its own section).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | MAST | |
| pos_x | No | ||
| fb_type | Yes | ||
| section | Yes | ||
| bindings | Yes | ||
| rung_input | No | ||
| rung_contact | No | ||
| instance_name | Yes |