Error Reactions

Failure of a slave

If a slave does not respond or the response is faulty, the master repeats the telegram several times, up to the Max Retry limit (see: Bus Parameters (DP)). If a faulty telegram is received, the master repeats the telegram immediately. The slot time, which can be set on the same tab, indicates how long the master waits for a response from the slave.

For a Data_Exchange telegram with 12 Mbaud, a slot time of 1000 tbits and a Max Retry_Limit of 4 (defaults), sending of the next telegram is delayed by the value:

TDelay = (4 x ((15 + number of outputs) x 11 + 1000) - (15 + number of inputs) x 11)/12 µs

The DpState of the slave is set to a value other than 0. The effect on the DP connection can be set (see below: response in the master).

Normal DP cycle (12 Mbaud, 5 slaves, 20 bytes in, 20 bytes out per slave on average)

Error Reactions 1:

 

First occurrence of a faulty DP cycle (slave 3 does not answer)

Error Reactions 2:

 

Subsequent DP cycles (slave 3 no longer in the polling list)

Error Reactions 3:

It can happen that the slave answers incorrectly, e.g. because, as a result of a local event on the slave, the DP connection has been removed. In this case the telegram is not repeated, but the next telegram is sent. The DpState is set to a value other than 0. The slave is removed from the poll list and no longer addressed in the next DP cycle. The send time of the next telegram changes, until the DP connection has been re-established.

 

Reactions in the master

The response in the master can be set for each slave (see: Features tab). The response in the master can be set with the option NoAnswer Reaction.

Here you can specify whether the DP connection to the slave should be interrupted immediately or not until the DP watchdog time has elapsed without a correct receipt telegram (Data_Exchange telegram).

If the DP connection is to be interrupted immediately (Leave Data Exch, Features tab of the slave), the slave is removed from the poll list discharged and no longer addressed in next DP cycle, until the DP connection has been re-established. At least seven telegrams are sent, in order to re-establish the DP connection. The process usually takes at least 10-20 ms.

If the DP connection is not to be interrupted until the watchdog time has elapsed (Star in Data Exch for WD time, Features tab of the slave), the system waits for a correct response for the watchdog time set for the slave. The slave is addressed once more in the next poll cycle. If the slave again fails to respond, no further repeat telegram is sent.

It makes sense to wait for the watchdog time to elapse in situations where the PROFIBUS cycle should be as constant as possible in the event of a slave failure, and the failure of a slave can be tolerated for one or several cycles (e.g. in DP/MC mode (equidistant)). In this case the DP watchdog time for the slave should be set according to the tolerable outage time of the slave, and the Max Retry_Limit (DX) (Bus Parameter (DP) tab of master) should be set to 0.

Normal DP cycle (12 Mbaud, 5 slaves, an average of 20 bytes In, 20 bytes Out for each slave) in the "Stay in Data-Exch (for WD-Time)" mode

Error Reactions 4:

 

First faulty and subsequent DP cycles in the "Stay in Data-Exch (for WD-Time)" mode (slave 3 does not respond)

Error Reactions 5:

  • Changes of the slave's input data if the slave does not respond correctly
    Here you can specify whether the slave input data are set to 0 (inputs will be set to 0, Features tab of the slave) or the old value is retained (No changes), if the slave fails. In either case the DpState of the slave is set to value other than 0, so that the task can always recognize whether or not the data is valid. If a slave gives a faulty answer, the input data is always set to 0, independently of the setting of Changes of the Input Data.
  • Setting the slave's restart behaviour if the DP connection to the slave is removed
    Here you can specify whether the DP connection to a slave, whose DP connection was interrupted, should automatically be re-established, or whether this should be done manually through an ADS WriteControl call.
    This setting is available if the slave is not connected to a CX master.
  • The reaction of the master if the DP connection to the slave is removed
    This specifies whether removing the DP connection to a slave has no other effects (No Reaction, the default setting), or whether the master should enter the STOP state, thus removing the DP connections to all the slaves.
    This setting is available if the slave is not connected to a CX master.

Failure of the master

  • Monitoring in the PLC/IO task
    In the presence of a persistent bus fault, the DP cycle can be extended up to 100 ms, even at 12 Mbaud. CycleCounter status variable, which can be linked in the PLC, is available for monitoring the DP master. This variable is incremented by master after each DP cycle. The variable can be monitored in the PLC monitored, in order to detect a failure of the master.
  • Monitoring in the slave
    A watchdog time can be enabled in the slave, in order to monitor the failure of the master or the transfer to the PROFIBUS (see: Profibus tab). The watchdog time must be set to at least twice the maximum of the estimated DP cycle and the cycle time (see: CCAT PBM tab).

Failure of the PLC/IO task

A distinction is made between a PLC stop, reaching a break point and a task stop (the I/O task and NC task are only stopped when the entire system stops). In the case of a PLC stop, the output data is set to 0 by the PLC, whereas when a breakpoint is reached the data initially remains unchanged.

In the master the task is monitored with a task watchdog time (see: Startup/Fault settings tab). If no new data transfer takes place within this task watchdog time, the master switches to Clear state, according to the setting Reaction on Task Stop (outputs are set to 0 or to the safe state Fail_Safe = 1 in the GSD file). With the “Operate” setting, the outputs retain the last value.

Start-up behaviour

The DP connections to all the slaves are established when the TwinCAT system starts up. Until the highest priority task that is involved has not been started, the master still does not send any Data_Exchange telegrams even after the DP connection has been established, and sends only diagnostic telegrams. As soon as the highest priority task has transferred data once, and the DP connection for the corresponding DP slave has been established, the master cyclically (with the highest priority assigned task) sends one Data_Exchange telegram to each of the corresponding slaves.