Trigger Event Task (EVENT)

This information applies to the
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370,
GuardLogix
5570,
Compact GuardLogix
5380,
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580, and
GuardLogix
5580 controllers.
The EVENT instruction triggers one execution of an event task.
Available Languages
Ladder Diagram
EVENT_LD_avail_v31
Function Block
This instruction is not available in function block.
Structured Text
EVENT(task_name);
Operands
Ladder Diagram
Operand
Type
Format
Description
Task
TASK
name
Event task to execute. If a task is specified that is not the Event task, the specified task will not be executed.
Structured Text
Operand
Type
Format
Description
Task
TASK
name
Event task to execute. If a task is specified that is not the Event task, the specified task will not be executed.
See Structured Text Syntax for more information on the syntax of expressions within structured text.
Description
Use the EVENT instruction to programmatically execute an event task.
Each time the instruction executes, it trigger the specified event task.
Make sure that you give the event task enough time to complete its execution before you trigger it again. If not, an overlap occurs.
If you execute an EVENT instruction while the event task is already executing, the controller increments the overlap counter, but it does not trigger the event task.
EVENT instruction can be used to trigger Event Task with all the trigger types.
Programmatically Determine if an EVENT Instruction Triggered a Task
To determine if an EVENT instruction triggered an event task, use a Get System Value (GSV) instruction to monitor the Status attribute of the task.
Attribute
Data Type
Instruction
Description
Status
DINT
GSV
SSV
Provides status information about the task. Once the controller sets a bit, you must manually clear the bit to determine if another fault of that type occurred.
To determine if
Examine this bit
An EVENT instruction triggered the task (event task only)
0
A timeout triggered the task (event task only)
1
An overlap occurred for this task
2
The controller does not clear the bits of the Status attribute once they are set. To use a bit for new status information, you must manually clear the bit. Use a Set System Value (SSV) instruction to set the attribute to a different value.
Affects Math Status Flags
No
Fault Conditions
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Ladder Diagram
Condition
Action Taken
Prescan
N/A
Rung-condition-in is false
N/A
Rung-condition-in is true
The instruction executes.
Postscan
N/A
Structured Text
Condition
Action Taken
Prescan
N/A
Normal execution
The instruction executes.
Postscan
N/A
Examples
Example 1
A controller uses multiple programs, but a common shut down procedure. Each program uses a program-scoped tag named Shut_Down_Line that turns on if the program detects a condition that requires a shut down. The logic in each program executes as follows.
If Shut_Down_Line = on (conditions require a shut down) then
Execute the Shut_Down task one time
Ladder Diagram
Program A
EVENT_LD_ex1_v31
Program B
EVENT_LD_ex1_v31
Structured Text
Program A
IF Shut_Down_Line AND NOT Shut_Down_Line_One_Shot THEN
EVENT (Shut_Down);
END_IF;
Shut_Down_Line_One_Shot:=Shut_Down_Line;
Program B
IF Shut_Down_Line AND NOT Shut_Down_Line_One_Shot THEN
EVENT (Shut_Down);
END_IF;
Shut_Down_Line_One_Shot:=Shut_Down_Line;
Example 2
The following example uses an EVENT instruction to initialize an event task. Another type of event normally triggers the event task.
Continuous Task
IF Initialize_Task_1 = 1 THEN
The ONS instruction limits the execution of the EVENT instruction to 1 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 Name attribute, THIS means the TASK object for the task that the instruction is in (e.g., Task_1).
EVENT_LD_ex3_v31
If Task_Status.0=1 then an EVENT instruction triggered the event task (i.e., when the continuous task executes its EVENT instruction to initialize the event task).
The RES instruction resets a counter the event task uses.
EVENT_LD_ex4_v31
The controller does not clear the bits of the Status attribute once they are set. To use a bit for new status information, 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.
EVENT_LD_ex5_v31
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.