Triggering of Event Tasks with CAN-IDs

Overview

This feature is only available for CAN598-CAN and can be used to trigger a PLC application task on receiving certain CAN2A or CAN2B frames. In the receive buffer configuration of the protocols CAN2A or CAN2B it can be specified which CAN-ID should cause the triggering of a PLC application task. The PLC application task which is linked to a CAN2A or CAN2B protocol has to be specified in the task configuration. The connection between protocol and PLC application task is specified by selection of the corresponding external event.

The picture below gives an overview about the processing of the received CAN frames. When a CAN frame was received by the CM598-CAN it will be read by the CAN Protocol task running in the PLC firmware. The CAN protocol task evaluates the received CAN frame and copies the data to the corresponding receive buffer. Only those CAN-IDs which was configured in the protocol configuration will be processed. If a CAN-ID was received which is marked to trigger a PLC application task an event is sent to that task. This triggers the PLC application task to run for one single cycle.

../_images/8c2c64b3166ed5bc0a317f3462783aaf

Triggering of event tasks, Overview

The following picture shows the sequence CAN frames processing when the triggering of event task is used.

../_images/de3d4c2124d504090a317f345def99c4

Triggering of event tasks, Process

Features

  • This feature requires at least PLC firmware version 2.5.3 and Automation Builder version 1.2.2.
  • One event task can be assigned to each of the protocols CAN2A and CAN2B.
  • One common event for all of the selected CAN-IDs of one protocol.
  • It is possible that CAN frames are lost when necessary system resources are in use or when the CAN frames could not be processed in time due high system load. So the PLC application must monitor the task which consumes the events of the CAN protocol with a watchdog mechanism or something similar.
  • During the execution of the PLC application task no further events are sent when new CAN frames are received before the task is finished. It is even possible to read newly received CAN frames in the current cycle of the PLC application task.
  • The order of CAN frame reception could not be determined in the PLC application task.
  • The task which should be triggered by the protocols CAN2A and CAN2B is a normal PLC application task and will be scheduled according its priority. So it is possible that events could not be processed on time due to the task is blocked by other tasks in the system.
  • The setting of the parameter “behavior on receive buffer overflow” has an influence on the processing of CAN frames and the corresponding events. The documentation of the respective value has to be considered.

Note

CAN frames and events may be lost, if the receive buffer is full. Take care that the receive buffers are emtied in time and the PLC load and CAN Bus load are not too high.

Configuration

To use the functionality “triggering of event tasks with CAN-IDs” in an application of an AC500 PLC the following settings in the PLC configuration are necessary

Note

Consider the documentation of the parameter “Behavior on receive buffer overflow”. Depending on the settings CAN frames may be lost

  • The CAN-IDs which should be used to trigger the linked PLC application task can be selected with the parameter Enable triggering of IEC task in the receive buffer configuration.
Parameter default value Value Meaning
Enable triggering of IEC task No No Triggering of PLC application task is disabled.
Yes When a CAN frame with this CAN-ID was received, the associated PLC application task will be triggered.
  • The configuration of the PLC application task is done in the “Task configuration” dialog. In order to receive events from the CAN2A or CAN2B protocol a task of the type “trigger by external event” has to be added and the event CAN2A_Event or CAN2B_Event for the desired coupler slot has to be selected.
../_images/8251126325c528710a317f34512528a4

Triggering of event tasks, task configuration

Event Coupler Slot Description
Int_Coupler0_CAN2A_Event 0 PLC event task will be triggered when a CAN frame with a specified CAN ID was received by the CAN2A protocol running at Coupler Slot 0.
Int_Coupler0_CAN2B_Event 0 PLC event task will be triggered when a CAN frame with a specified CAN ID was received by the CAN2B protocol running at Coupler Slot 0.
Ext_Coupler<slot>_CAN2A_Event 1 … 6 PLC event task will be triggered when a CAN frame with a specified CAN ID was received by the CAN2A protocol running at Coupler Slot 1 - 6.
Ext_Coupler<slot>_CAN2B_Event 1 … 6 PLC event task will be triggered when a CAN frame with a specified CAN ID was received by the CAN2B protocol running at Coupler Slot 1 - 6.