along with its Monitor Tags window. The operation of the rung can be summarized as follows: • When the SUB_Sw or Calculate tag is true the SUB instruction is executed. • Source B (Shipped_Parts) is subtracted from Source A (Parts_Stock) and the result is stored in the Dest tag named Current_Inventory. • In this example, the 200 was subtracted from 900 and the result (700) was stored in Current_Inventory. • Source A and Source B can be constants (numbers) or tags. The MUL instruction is used to multiply two numbers. Figure 15-80 shows an example of a MUL instruction rung along with its Monitor Tags window. When multiple bottles are packed in cases, the number of bottles per case, the number of cases, and the multiply instruction will give you the total number of bottles. The operation of the rung can be summarized as follows: • When the Sw_1 and Sw_2 are both true the MUL instruction is executed. • Source A (the value in tag Cases_Produced) is multiplied by Source B (the value in tag Bottles_ Per_Case) and the result is stored in the Dest tag Bottles_Produced. • Source A and Source B can be constants (numbers) or tags. Input Ladder logic program L1 SUB Subtract Source A Source B Dest Parts_Stock Shipped_Parts Current_Inventory Sub_Sw <Local:1:I.Data.4> Calculate Sub_Sw Tag Name Value Style Data Type Parts_Stock Shipped_Parts Current_Inventory Sub_Sw 900 200 700 1 Decimal Decimal Decimal Decimal DINT DINT DINT BOOL Calculate 0Decimal BOOL Figure 15-79 SUB instruction rung and its Monitor Tags window. 900 200 700 Input Ladder logic program L1 MUL Multiply Source A Source B Dest Sw_2 <Local:1:I.Data.2> Sw_1 <Local:1:I.Data.1> Sw_1 Sw_2 Tag Name Value Style Data Type Sw_1 Sw_2 Cases_Produced Bottles_Per_Case 1 1 Decimal Decimal 60 12 Decimal Decimal BOOL BOOL DINT DINT Bottles_Produced 720 Decimal DINT Figure 15-80 MUL instruction rung and its Monitor Tags window. Cases_Produced 60 Bottles_Per_Case 12 Bottles_Produced 720 Math, Comparison, and Move Instructions Part 5 375
Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above