Chapter 2. Program Organization8 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C2.1.5 Types of BlocksPACSystems supports four types of blocks.Block Type Local Data ProgrammingLanguages Size Limit ParametersBlock Has its own localdataLDFBDST128 KB 0 inputs1 outputParameterizedBlockInherits local datafrom callerLDFBDST128 KB 63 inputs64 outputsUser DefinedFunction Block(UDFB)Has its own localdataLDFBDST128 KB63 inputs64 outputsUnlimited internal membervariablesExternal Block Inherits local datafrom caller Cuser memorysize limit (10MB)63 inputs64 outputsAll PACSystems block types automatically provide an OK output parameter. The name used toreference the OK parameter within a block is Y0. Logic within the block can read and write the Y0parameter. When a block is called, its Y0 parameter is automatically initialized to TRUE. This willresult in a positive power flow out of the block call instruction when the block completes execution,unless Y0 is set to FALSE within the logic of the block.For all block types, the maximum number of input parameters is one less than the maximum numberof output parameters. This is because the EN input to the block call is not considered to be an inputparameter to the block. It is used in LD language to determine whether or not to call the block, but isnot passed into the block if the block is called.Program BlocksAny block can be a program block. The _MAIN block is automatically declared when you create ablock-structured program. When you declare any other block, you must assign it a unique blockname. A block is automatically configured with no input parameters and one output parameter (OK).When a block-structured program is executed, the _MAIN block is automatically executed. Otherblocks execute when called from the program logic in the _MAIN block, another block, or itself. In thefollowing example, if %M00001 is ON, the block named ProcessEGD will be executed:Figure 1: Conditional Block CallProgram Blocks and Local DataProgram blocks support the use of %P global data. In addition, each block, except _MAIN, has its own%L local data. Blocks do not inherit %L local data from their callers.