FC310x - Master Diagnostics
Diagnosis Inputs
The master possesses a variety of diagnostic variables that describe the state of the card and of the PROFIBUS. They can be linked in the PLC:
CdlInfo:
CdlInfo.error: Shows the number of slaves with which data exchange could not take place in the last cycle. The box status (BoxState) of the slaves should only be checked if this value is not equal to 0.
CdlInfo.cycleCounter: Is incremented at the end of each PROFIBUS cycle in order that this variable can indicate whether the last cycle was completed before the task was started.
CdlInfo.actualCycleTime: Shows the current cycle time in 4/25 µs. This variable is updated only when all slaves are involved in the data exchange (also when CdlInfo.error is 0).
CdlInfo.actualModulo: Indicates the current modulo. This variable is only of significance if the slaves are prioritized (see the Slave Prioritisation/Multiple DP Cycles section)
Counter: Used for the Redundancy mode
DiagFlag: Indicates whether the card's master diagnostic information has changed. It can then be read via ADS by the controller program, after that the "DiagFlag" variable is reset.
GlobalState: GlobalState[0] indicates the state of the FC310x, GlobalState[1-2] indicate global bus statuses, while GlobalState[3] is reserved for extensions:
RESET (1): Card router not started (after start-up of the PC).
INIT (2): Router started but card not active on PROFIBUS.
STOP (3): Card active on PROFIBUS, but no cyclical data exchange.
STOPPING (4): Card ends cyclical data exchange.
RUN (0): Card in cyclical data exchange.
GlobalState[1] counts the detected bus errors (as from FC310x, version 1).
GlobalState[2]: Bit 0 is set, if no 11 bit idle time is detected on the PROFIBUS (-> check cabling), bit 1 contains the operating mode CLEAR (bit 1 = 1) or OPERATE (bit 1 = 0), the other bits (2..7) are reserved for expansions (from FC310x, version 1).
GlobalState[3] is reserved for expansions.
CycleFailedCounter: This counter shows how often the FC310x PROFIBUS cycle was unready at the start of the TwinCAT task.
StartRedundantMasterFlag: Is used for the Redundancy mode
Master Diagnostics Data
The master diagnostic data can be read by ADS:
ADS-Read parameters |
Meaning |
---|---|
Net-ID |
Net-ID of the master (see the device's ADS tab) |
Port |
200 |
IndexGroup |
0x0000F100 |
IndexOffset |
offset within the diagnosis data |
Length |
Length of the diagnostic data that is to be read |
Data |
Diagnostic data |
The master diagnostic data has the following structure:
Offset |
Description |
---|---|
0 -125 |
BusStatus List, one byte per station address 0-125 which contains the station status (see BoxState for PROFIBUS boxes and for non-selected stations: 0x80 - not present, 0x81 - slave, 0x82 - master not ready for token ring, 0x83 - master ready for token ring, 0x84 - master in token ring). |
126 - 127 |
reserved |
128 - 135 |
State of the FC310x (->GlobalState). |
136 - 137 |
Send error counter for all sent telegrams. |
138 - 139 |
Receive error counter for all received telegrams. |
140 - 255 |
reserved for extensions |
256 - 257 |
Sync Failed Counter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9). |
258 - 259 |
Cycle Start Error Counter, counts up one when the PROFIBUS cycle is restarted before the old cycle is complete (intercepted by the TwinCAT-IO driver, only possible with customised drivers). |
260 - 261 |
Time Control Failed Counter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9). |
262 - 263 |
reserved for extensions |
264 - 265 |
Minimum reload value of real time timer. |
266 - 267 |
Maximum reload value of real time timer (max. FCxxxx-Jitter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) = max. reload value - min. reload value). |
268 - 269 |
PLL Overflow counter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
270 - 271 |
PLL Underflow counter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
TcIo diagnostic data
The TcIo driver also generates diagnostic data that can be read, activated, deactivated and reset by ADS. It is, however, deactivated by default. It is activated if the EquiDiag or GeneralDiag tab (TwinCAT 2.8) or MC-Diag or DP-Diag tab (TwinCAT 2.9) of the device is selected, and is deactivated when the tab is deselected.
Activation, deactivation and resetting the TcIo diagnostic data
ADS-Write parameters |
Meaning |
---|---|
Net-ID |
PC Net ID. |
Port |
300 |
IndexGroup |
0x00005000 + Device-Id (device's General tab) |
IndexOffset |
0xFFFFF100 |
Length |
2 |
Data |
0: Deactivation of the Tclo diagnostic data 1: Activation of the Tclo diagnostic data 2: Resetting the Tclo diagnostic data |
Reading the Tclo diagnostic data
ADS-Read parameters |
Meaning |
---|---|
Net-ID |
PC Net ID. |
Port |
300 |
IndexGroup |
0x00005000 + Device-Id (device's General tab) |
IndexOffset |
0xFFFFF100 |
Length |
Length of the Tclo diagnostic data |
Data |
TcIo diagnostic data |
The Tclo diagnostic data has the following structure:
Requirements
Offset |
Description |
---|---|
0 -3 |
Max. TwinCAT jitter (in 100 ns, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
4 - 7 |
Min. Mapping-Time (in 100 ns, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
8 - 11 |
Max. Mapping-Time (in 100 ns, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
12 - 15 |
max. FC310x jitter (in FC310x ticks, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
16 - 19 |
CycleWithNoDxch-Counter (see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
20 - 23 |
CycleWithRepeat-Counter (see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
24 - 27 |
Max. Repeat/Cycle (see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
28 - 31 |
Actual Cycle-Time (in 4/25 µs, see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
32 - 35 |
Max. Cycle-Time (in 4/25 µs, see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
36 - 39 |
Min. Cycle-Time (in 4/25 µs, see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
40 - 43 |
RealFailedCycle-Counter (see GeneralDiag tab for TwinCAT 2.8 and DP-Diag tab for TwinCAT 2.9) |
44 - 47 |
EquiCycleNoDxch-Counter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
48 - 51 |
EquiCycleRepeat-Counter (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
52 - 55 |
Max. Repeats/Equi-Cycle (see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
56 - 59 |
Actual Equi-Cycle-Time (in 4/25 µs, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
60 - 63 |
Max. Equi-Cycle-Time (in 4/25 µs, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |
64 - 67 |
Min. Equi-Cycle-Time (in 4/25 µs, see EquiDiag tab for TwinCAT 2.8 and MC-Diag tab for TwinCAT 2.9) |