# Example for Triggering External Events

The following image shows an example PLC logic for triggering external events by the PLC, in this case specifically a Rockwell ControlLogix PLC:

The signals used are the following:

Signal Name | Vision System Defined Signal or Tag | PLC User Defined Tag | Notes
--- | --- | --- | ---
ExtEvent0Req | - | Yes | Internal memory bit to initiate logic to set the ExternalEvent0 on.
ExternalEvent0 | Yes | - | When set to 1 runs functions in the vision system Spreadsheet that are defined to use this event.
ExternalEventAck0 | Yes | - | This bit is set to 1 when the vision system receives the ExternalEvent0 bit set to 1 and clears to 0 when ExternalEvent0 bit set to 0.

The example logic shown above for ExternalEvent0 can also be used for events 1 -7 also by making the appropriate changes.

In rung 0, when the ExtEvent0Req bit is set to 1 the ExternalEventAck0 is already cleared to 0 which allows the ExternalEvent0 bit to be set causing the external event to run in the vision system and setting the ExternalEventAck0 to 1. When the PLC sees the ExternalEventAck0 set to 1 that causes the rung clear the ExternalEvent0 bit and the ExtEvent0Req bit outputs. Then the vision system sees that the ExternalEvent0 bit is cleared to 0 and clears the ExternalEventAck0 to 0. This state gets us back to the original rung state to trigger the event again.