Page 98

Petruzella_ProgrammableLogicControllers__5e

... Start_PB IREF Figure 15-101  IREF is latched for the scan of the function block routine. • The inputs of a block require data to be available before the controller can execute that block. • If function blocks are not wired together, it does not matter which block executes first as there is no data flow between the blocks. • The interconnected line between the blocks indicates what type of signal is present. Data latching refers to how the controller verifies that the data present at the input to a function block are valid. If you use an IREF to specify input data for a function block instruction, as illustrated in Figure 15-101, the data in that IREF are latched (won’t change) for the scan of the function block routine. The IREF latches data from program-scoped and controller-scoped tags. The controller updates all IREF data at the beginning of each scan. A function block routine executes in the following order: • The controller latches all data values in IREFs. • The controller executes the other function blocks in order. • The controller writes outputs in OREFs. When you add a Function Block instruction, the block appears with a set of pins for the default parameters, as illustrated in Figure 15-102. The rest of the pins are hidden. You can hide or show a pin by: • Clicking on the Parameters tab in the Properties dialog box. • In the Properties dialog box, on the Parameters tab, clear the Vis check box to hide the pin. Click this buttom to view block properties Parameters* Tag Vis Name Value Type 1 BOOL 0.0 REAL REAL Enableln SourceA SourceB I I I Figure 15-102  Using the Parameters tab to show or hide a pin. Source: Image Courtesy of Rockwell Automation, Inc. • Select the Vis check box to show the pin. • Click OK. To create a feedback loop around a block, wire an output pin of the block to an input pin of the same block. The input pin will receive the value of the output that was produced on the last scan of the function block. The loop contains only a single block, so execution order does not matter. Figure 15-103 shows an example of a feedback loop used to reset an on-delay timer. When the timer finishes timing its DN bit is used to reset the timer. When a group of function blocks are in a feedback loop, the controller cannot determine which block to execute first. This problem is resolved by placing an Assume Data Available indicator mark at the input pin of the function block that should be executed first. In the example shown in Figure 15-104, the input for block 1 uses the data from block 3 that were produced in the previous scan. To place the indicator, click on the interconnecting wire and select the Assume Data Available choice. TONR_01 TONR Timer On Delay with Reset TimerEnable PRE ACC DN Reset Feedback loop Timer_Enable_Bit Preset_Value Accumulated_Time Figure 15-103  Feedback loop used to reset an on-delay timer. Function Block Programming  Part 6 387


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above