FC310x - PCI Cards for PROFIBUS

Slave Prioritization/Multiple DP Cycles

 

Distribution of the DP slaves over a number of DP cycles (prioritization of the slaves)

Slaves can be prioritized so that the DP cycle time can be kept as short as possible in systems in which a few slaves must be polled very rapidly, whereas a larger cycle time would be adequate for other slaves. It is possible to specify for each slave in what multiple of cycles (Divider under Data-Exch Poll-Rate on the slave's Features tab) it will be polled. Distributing the polling is then helpful, as, for instance, in the case illustrated below where there are four slaves, each of which is only to be addressed in every second cycle. It is possible to make settings so that two slaves will be polled in one cycle and the other two slaves in the other cycle, so that the overall DP cycle time is kept as constant as possible. For this purpose, the Features tab for the slave offers the Modulo setting under Data-Exch Poll-Rate. In the illustrated case, slaves 3 and 5 have Modulo 0 while slaves 4 and 6 are given Modulo 1. The current modulo can be read in the ActualModulo variable which is described in the Master Diagnostics chapter.

 
Allocation of DP slaves to several DP cycles
 
 

Multiple DP Cycles in one Task Cycle

If the task cycle time is more than twice as long as the DP cycle time, it is possible for a number of DP cycles to be carried out within a single task cycle, in order to acquire the most up-to-date input data possible. Based on the Number of DP cycles per task cycle factor, which can be set on the "FC310x" tab of the master (for TwinCAT 2.8 or TwinCAT 2.9), a timer with the cycle time (task cycle time/number DP cycles per task cycle) is started when the first DP cycle starts, through which further DP cycles can then be started. It is, however, necessary to check that the last DP cycle is completed in good time (before the next task start), since otherwise one DP cycle will fail (or possibly more than one, depending on the ratio expressed in the number of DP cycles per task cycle), as described in the Synchronization chapter.

 
Multiple DP Cycles in one Task Cycle
 
 

Multiple data samples within one task cycle

The two functionalities just described can now be combined in order, for instance, to give one or more slaves in a 2 ms cycle new data every 1 ms, or to obtain new data from the slave in order to achieve better regulation quality. In this case, settings are made under Additional Data_Exchange Samples on the slave's Features tab instead of under Data-Exch Poll-Rate (as described above).

In the sample shown below, first set the factor Number of DP cycles per task cycle in the "FC310x" tab (for TwinCAT 2.8 or TwinCAT 2.9) of the master to 2. So that the task can send 2 different values to the slave, or is able to receive 2 different values from the slave, the appropriate slave is to be entered into the System Manager twice. All settings, with the exception of Modulo under Additional Data_Exchange Samples on the slave’s Features tab, must be the same. A 0 is entered here for the corresponding slave in one of the boxes and a 1 in the other box in the System Manager. The Multiplier under Additional Data_Exchange Samples is to be set for this slave in both boxes to 2, so that each of the two boxes that have been entered is only polled in every second DP cycle (the slave is in fact polled in each DP cycle, as it is entered twice). For all other slaves that are only to be polled once within the task cycle (and which of course are only therefore entered once in the System Manager), the Multiplier under Additional Data_Exchange Samples is also set to 2. Modulo under Additional Data_Exchange Samples can now be used to distribute these slaves over the two cycles. A slave that is polled twice but which is only to have one variable image in the task is only to be inserted once; the Multiplier would be set to 1, and Modulo to 0.

In the present example, slaves 1 and 2 would each be entered into the System Manager twice, with these settings:

Additional Data_Exchange Samples/Multiplier = 2
Additional Data_Exchange Samples/Modulo = 0 or 1

Slaves 3 and 5 would only be entered into the System Manager once, and would have these settings:

Additional Data_Exchange Samples/Multiplier = 2
Additional Data_Exchange Samples/Modulo = 0

Slaves 4 and 6 would also only be entered into the System Manager once, with these settings:

Additional Data_Exchange Samples/Multiplier = 2
Additional Data_Exchange Samples/Modulo = 1
 
Multiple data samples within one task cycle

For slaves 1 and 2, the variables are present twice (in each case 2 boxes in the System Manager). The variables associated with the box where Additional Data_Exchange Samples/Modulo is set to 0 are sent or received first.