Commissioning of a MTI channel
1. Synchronous or asynchronous operation?
-
Synchronous (default): Synchronous operation should be selected if events are to be transferred from the channel to the controller as quickly as possible.
- In each EtherCAT cycle as many events as possible are loaded into the buffer. The number of events per channel can be read via EventsInInputBuffer. The maximum number of events that can be stored is 32.
- The MTSF is used to specify how many events per cycle are transferred from the buffer into the process data. The factor is currently limited to a maximum of 10.
- If the number of new events consistently exceeds the MTSF value, the buffer may overflow. Via the CoE 0x80n0:13 the behavior on buffer overflow can be configured for each channel. -
Asynchronous: If high data integrity is required, asynchronous handshake operation should be selected.
Application from the PLC:
- The channel signals the presence of data with NoOfInputEvents > 0
- The PLC can accept the data (input event states and timestamps).
- The InputOrderCounter has to be incremented (+ 1)
- In the next cycle the InputOrderFeedback should have assumed the value of the InputOrderCounter
- If further events are present in the buffer, they are shown in the process image.
- Starting from the beginning...
2. Setting the multi-timestamping factor (MTSF)
To facilitate choosing an appropriate MTSF one should estimate the frequency at which level changes, i.e. events, are expected at the input. The multi-timestamping factor (MTSF) can then be selected. The factor indicates how many events per cycle are transferred from the buffer to the controller. With asynchronous transfer one should note that, due to the handshake, only half the number of events are retrieved per time period.
In order to avoid the transfer of excessive quantities of process data, the following configuration recommendations apply:
Synchronous transfer: MTSF ≥ (expected maximum number of input events per EtherCAT cycle) + 1
Asynchronous transfer MTSF ≥ 2x (expected maximum number of input-events per EtherCAT cycle) + 1
Example: At a cycle time of 1 ms, a maximum of 4 events/ms per channel are expected. All 8 channels of the EL1258 are to be used.
- Synchronous transfer: MTSF ≥ 5
Select "Multi-Timestamping 8 Ch. 5x" via the predefined PDO. If a somewhat larger number of events then occur in a cycle, these are buffered in the channel buffer; the buffer can then be emptied by the controller in the subsequent cycles.
- Asynchronous transfer: MTSF ≥ 9
Select "Multi-Timestamping 8 Ch. 10x" via the predefined PDO.
For example, the process data of an input channel are represented as follows for MTSF = 1x, 5x and 10x:
For each event there is a bit in the input array (right-justified) and a timestamp.
These process data are placeholders that accept events if there are any to be transmitted.
If fewer channels are required, predefined PDOs are also available for 4, 2 or 1 channel(s), with an MTSF of 1x, 2x, 5x and 10x respectively.
If fewer events arrive at the input than defined by the MTSF, the remaining PDOs are set to 0, in order to highlight this.
Example: NoOfInputEvents = 3 for MTSF=5 means that the first three PDO events (input value + timestamp) are supplied, the remaining two PDOs are set to 0.
3. When should the filter in CoE be activated? (default: deactivated)
The filter can be used to hide short signal jumps (spikes). They are regarded as invalid.
Procedure:
- The filter can be activated via the CoE 0x80n0:01 EnableDigitalFilter.
- If the filter activated is, the object 0x80n0:14 DigitalFilterCounter is used to set the timeframe over which the signal is regarded as valid. The timeframe should be specified as number of microcycles. “1” is synonymous with a deactivated filter.
- Finally you must check whether the macrocycle time achieved in the terminal with the selected settings is shorter than the EtherCAT cycle time.
- In online mode the current microcycle time can be viewed in the CoE.
Finally you must check whether the macrocycle time achieved in the terminal with the selected settings is shorter than the EtherCAT cycle time. This should generally be 20% longer than the macrocycle. The current macrocycle time can be read in the CoE directory 0xF900:08 CycleTime.
4. How can I test the input channel?
If an input channel is to be tested, the events are hardly visible in the System Manager, since in synchronous mode (default) they are immediately retrieved, and the process data always look "zeroed".
Remedy:
- Set the channel to asynchronous mode, so that the events are retrieved in handshake mode.
or
- Track event timestamp no. 1 in the online display:
5. Processing of events in the PLC
The channel supplies 32-bit timestamp. The following function block can be used for scaling up to the convenient 64-bit format:
Download (example file)