Chapter 2. Program OrganizationGFK-2950C February 2018 15UDFB LogicAn instance of a BOOL parameter or internal variable can be forced ON or OFF, or used withtransition-detecting instructions. The exception to this is that BOOL input parameters passed byreference cannot be forced or used with the Series 90-70 legacy transition-detecting instructions(POSCOIL, NEGCOIL, POSCON and NEGCON) because their values are not stored in instance data.All input parameters to a UDFB, and their corresponding instance data elements, can be read by thelogic of that particular UDFB.Input parameters that are passed by reference or passed by value result to a UDFB can be written toby their UDFB’s logic. Input parameters passed by value cannot be written to by their UDFB logic.Note that the restriction on writing to input parameters passed by value does not apply to othertypes of blocks.All UDFB output parameters can be both read and written to by their logic.UDFB Operation with Other BlocksA UDFB instance that is of global scope can be invoked by another UDFB’s logic or any other block’slogic.A UDFB instance that is passed (by reference) as an argument to a UDFB can be invoked by theUDFB’s logic.A UDFB instance that is passed (by reference) as an argument to a parameterized block can beinvoked by the parameterized block’s logic.The output parameters, and their corresponding instance data elements, of a UDFB instance that ispassed as an argument can be read but not modified by the receiving block’s logic. The inputparameters of a UDFB instance that is passed as an argument cannot be read or modified by thereceiving block’s logic. The internal variables of a UDFB instance that is passed as an argumentcannot be modified by the receiving block’s logic. They can be read if their scope is global, but not iftheir scope is local.External BlocksExternal blocks are developed using external development tools as well as the C Programmer’sToolkit for PACSystems. Refer to the C Programmer’s Toolkit for PACSystems, GFK-2259 for detailedinformation regarding external blocks.Any block except _MAIN can be an external block. When you declare an external block, you mustassign it a unique block name. It can be configured with up to 63 input parameters and 64 outputparameters.An external block executes when called from the program logic in the _MAIN block or from the logicin another block, parameterized block, or UDFB. External blocks themselves cannot call any otherblock. In the following example, if %I00001 is set, the external block named EXT_11 is executed.Figure 7: Calling an External Block in Ladder LogicNote: Unlike other block types, external blocks cannot call other blocks.