Chapter 2. Program OrganizationGFK-2950C February 2018 9Using Parameters with a Program BlockEvery block is automatically defined to have one formal ‘power flow’ (or OK) output parameter,named Y0. Y0 is a BOOL parameter of LENGTH 1, passed by initial-value result. It indicates successfulexecution of the block. It can be read and written to by the logic within the block.Parameterized BlocksAny block except _MAIN can be a parameterized block. When you declare a parameterized block, youmust assign it a unique block name. A parameterized block can be configured with up to 63 input and64 output parameters.A parameterized block executes when called from the program logic in the _MAIN block, anotherblock, or itself. In the following example, if %I00001 is set, the parameterized block named LOAD_41will be executed.Figure 2: Block Call with ParametersParameterized Blocks and Local DataParameterized blocks support the use of %P global data. Parameterized blocks do not have theirown %L data, but instead inherit the %L data of their calling blocks. Parameterized blocks also inheritthe FST_EXE system reference and time-stamp data that is used to update timer functions from theircalling blocks. If %L references are used within a parameterized block and the block is called by_MAIN, %L references will be inherited from the %P references wherever encountered in theparameterized block (for example, %L0005 = %P0005).Note: It is possible, by using Online Editing in the programming software to cause a parameterizedblock to use %L higher than allowed because of the way it inherits data. Using a word-for-word change to restore this reference to a valid address does not correct the block becausethe variable still exists in the variable list. Deleting the variable from the variable list does notcause an update to the CPU, so the parameterized block still sees the reference out of rangefault. To correct this condition, you must remove the unused variables from the variable listafter deleting them from the logic.Using Parameters with a Parameterized BlockA parameterized block may be defined to have between 0 and 63 formal input parameters, andbetween 1 and 64 formal output parameters. A ‘power-flow out’ (or OK) parameter, named Y0, isautomatically defined for every parameterized block. It is a BOOL parameter of LENGTH 1, andindicates the successful execution of the parameterized block. It can be read and written to by theparameterized block’s logic.The following table lists the TYPEs, LENGTHs, and parameter-passing mechanisms allowed forparameterized block parameters. (For definitions of the parameter passing types, refer to ParameterPassing Mechanisms.)