FB_EcExtSyncIsSynchronized

This function block FB_EcExtSyncIsSynchronized checks whether the internal and external clocks are synchronized (bSynchronized). For this purpose, the system checks whether the difference between the clocks over 10 cycles is within the specified synchronization window nSyncWindow. In the event of invalid data (bNotConnected = TRUE), the synchronization is reported as failed.
The function block is not absolutely necessary for readjustment, but it can be used for information purposes.
Inputs
VAR_INPUT
nSyncWindow : UDINT;
bNotConnected : BOOL;
nDcToTcOffset : LINT;
nDcToExtOffset : LINT;
nExtTime : T_DCTIME64;
nIntTime : T_DCTIME64;
END_VAR
Name | Type | Description |
---|---|---|
nSyncWindow | UDINT | Time window [ns] within which the internal and external time are regarded as synchronized. |
bNotConnected | BOOL | TRUE, if the data is invalid (corresponds to the WcState of the EL6692) |
nDcToTcOffset | LINT | Offset between the distributed clock time and the TwinCAT time [ns] from the InfoData of the EtherCAT master |
nDcToExtOffset | LINT | Offset between the distributed clock time and the external time [ns] from the InfoData of the EtherCAT master |
nExtTime | T_DCTIME64 | External timestamp |
nIntTime | T_DCTIME64 | Internal timestamp |
Outputs
VAR_OUTPUT
bSychronized : BOOL;
nDcOffset : T_DCTIME64;
END_VAR
Name | Type | Description |
---|---|---|
bSynchronized | BOOL | TRUE if the difference between the internal and external time over at least 10 cycles is within the synchronization window. |
nDcOffset | T_DCTIME64 | Magnitude of the current difference between the internal and external time [ns] |
Requirements
Development environment | Target platform | PLC library to be integrated (category group) |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64, Arm®) | Tc3_EtherCATExtSync |