12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Program Control <strong>Instructions</strong> (JMP, LBL, JSR, RET, SBR, JXR, TND, MCR, UID, UIE, AFI, NOP, EOT, SFP, SFR, EVENT) 469Example 2:The following example uses an EVENT instruction to initialize anevent task. (Another type of event normally triggers the event task.)Continuous taskIf Initialize_Task_1 = 1 thenThe ONS instruction limits the execution of the EVENT instruction to one scan.The EVENT instruction triggers an execution of Task_1 (event task).Task_1 (event task)The GSV instruction sets Task_Status (DINT tag) = Status attribute for the event task. In the Instance Nameattribute, THIS means the TASK object for the task that the instruction is in (that is, Task_1).If Task_Status.0 = 1 then an EVENT instruction triggered the event task (that is, when the continuous task executesits EVENT instruction to initialize the event task).The RES instruction resets a counter that the event task uses.The controller does not clear the bits of the Status attribute once they are set. To use a bit for new statusinformation, you must manually clear the bit.If Task_Status.0 = 1 then clear that bit.The OTU instruction sets Task_Status.0 = 0.The SSV instruction sets the Status attribute of THIS task (Task_1) = Task_Status. This includes the cleared bit.Publication 1756-RM003I-EN-P - January 2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!