Timestamp function
EL1252
For each channel and for each fieldbus cycle, the terminal can only store one edge event as rising or falling together with its timestamp. If more than one signal change occurs at the terminal input between two fieldbus cycles, a setting can be made on the DC tab “Advanced Settings -> Distributed Clocks ->Latch” to determine whether the first or last signal change occurring within an interrogation cycle is to be stored in the LatchPosXXXY variable. This value is then fetched by the EtherCAT frame.
- “Single Event”
If the EL1252 is set to store the first signal change, the time of the first change in the signal to occur after an EtherCAT frame has read the terminal is stored in LatchPosXXXY. This time stamp then remains unchanged until the next read by an EtherCAT frame; it is not overwritten. Only after being read by an EtherCAT frame is the value free to be overwritten by another signal change.
In this mode, the flags in the status byte also provide an indication. - “Continuous” (default)
If the EL1252 is set to record the last signal change, the value in LatchPosXXXY is continuously updated whenever a change occurs in the input signal, regardless of reads by the EtherCAT frame.
In this mode the status byte does not contain any edge flags for each channel.
EL1254
The LatchControl registers of the EL1254 cannot be set via TwinCAT-specific dialogs as with the EL1252. The registers must be set after startup from the controller via ESC register access, e.g. with FB_EcPhysicalWriteCmd in Tc2_EtherCAT.lib (not to be confused with KL register access), the addresses of the latch control registers are:
- Channel 1 / Latch 0 : 0x09A8
- Channel 2 / Latch 1 : 0x09A9
- Channel 3 / Latch 2 : 0x09AA
- Channel 4 / Latch 3 : 0x09AB