Programming Techniques
9-177
Data Transfer Schemes
This manual provides two possible methods for transferring data from a primary to a secondary processor
The first programming alternative transfers a data block per program scan. With this method, the application program defines the order that is used for transferring the data blocks. This programming scheme results in a lower overall data transfer throughput and has a minimal impact in the program scan time.
The second programming alternative transfers each data block at its maximum possible throughput. This method is shown in the ladder program example earlier in this chapter. With this method, the application program tries to make all the possible data transfers in each program scan, according to the DTSW bits.
Data Transfer Method 1
With this alternative, the primary SLC 5/0x uses a counter to select the 1747-BSN module to which the data block is sent. The primary
SLC 5/0x also uses a second counter to select which block is sent to the BSN module. If the system has only one 1747-BSN, only one counter is used. The following procedure is used in the primary SLC
5/0x for sending the data blocks:
1. Read all the DTSWs from the respective 1747-BSN modules.
2. Clear all DTCW bits corresponding to the data blocks that are marked as already transferred to secondary system in the
DTSWs. Send the data blocks to their respective 1747-BSN modules.
3. Look at the counters and DTSWs to check whether the next data block that is sent is able to receive new data from the SLC 5/0x:
• If the next data block is not able to receive new data, increment the data block counter and check whether it is time to select the next 1747-BSN module.
• If the next data block is able to receive new data, increment the module counter, restart the data block counter and repeat step 3.
(Repeat this step until all possible data blocks are scanned.)
4. Copy the data block from the SLC 5/0x to the 1747-BSN module indicated by the module counter.
5. Advise the 1747-BSN module that the data block is ready through the DTCW (set the bit corresponding to the data block in this word).
6. Increment the data block counter and check whether it is time to select the next 1747-BSN module. If it is time to select the next module, increment the module counter and restart the data block counter.
7. Start step 1 in the next program scan.
Publication 1747-6.22
9-178
Programming Techniques
To receive the data blocks, the secondary SLC 5/0x application program uses the following procedure:
1. Read all the DTSWs from the respective 1747-BSN modules.
2. Clear all DTHW bits corresponding to the data blocks that were previously read and that no longer have a data ready bit set for them in the DTSWs. Send all the DTHWs to their respective
1747-BSN modules.
3. Look at the counters and DTSWs to check whether the next data block that is received is ready in the 1747-BSN module
• If the next data block is not ready, increment the data block counter and check whether it is time to select the next 1747-
BSN module.
• If the next data block is ready, increment the module counter, restart the data block counter and repeat step 3. (Repeat this step until all possible data blocks are scanned.)
4. Copy the data block from the 1747-BSN module to the
SLC 5/0x.
5. Advise the 1747-BSN module that the data block was already read through the DTHW (set the bit corresponding to the data block in this word).
6. Increment the data block counter and check whether it is time to select the next 1747-BSN module. If it is time to select the next module, increment the module counter and restart the data block counter.
7. Start step 1 in the next program scan.
The worst scenario with this transfer method is a system that has eight
1747-BSN modules in which each one is transferring 16 data blocks.
The total number of data blocks is 128 and the backup system spends
128 program scans to transfer all the data blocks.
Data Transfer Method 2
With method 2, the application program in the SLC 5/0x considers each data block independent from the other data blocks. This is shown in the ladder program example earlier in this chapter for one set of BSN modules. Reproduce this logic for additional sets of BSN modules, being sure to update the slot number in the M-file addresses for each set. The following procedure is used in the primary SLC 5/0x for sending the data blocks:
1. Read all the DTSWs from the respective 1747-BSN modules.
2. Clear all DTCW bits corresponding to the data blocks that are marked as already transferred to secondary system in the
DTSWs. Send the data blocks to their respective 1747-BSN modules.
Publication 1747-6.22
Programming Techniques
9-179
3. For each data block, do the following:
• Check whether the block is free to receive new data from the
SLC 5/0x.
• Copy the data block from the SLC 5/0x to the 1747-BSN module.
• Advise the 1747-BSN module that the data block is ready through the DTCW (set the bit corresponding to the data block in this word).
4. Start step 1 in the next program scan.
To receive the data blocks, the secondary SLC 5/0x application program uses the procedure below:
1. Read all the DTSWs from the respective 1747-BSN modules.
2. Clear all DTHW bits corresponding to the data blocks that were previously read and that no longer have a data ready bit set for them in the DTSWs. Send all the DTHWs to their respective
1747-BSN modules. For each data block, do the following:
• Check whether the data block is ready in the 1747-BSN module.
• Copy the data block from the 1747-BSN to the SLC 5/0x.
• Advise the 1747-BSN module that the data block was already read through the DTHW (set the bit corresponding to the data block in this word).
3. Start step 1 in the next program scan.
The worst scenario with this transfer method is a system with eight
1747-BSN modules in which each one is transferring 16 data blocks.
The total number of data blocks is 128. In each program scan, the system transfers all 128 data blocks. Total transfer time is approximately 700 msec.
Other transfer methods
Data transfer methods 1 and 2 were designed to be used as sample methods. In a real application, the user would develop other methods of transferring data. Theses alternatives would optimize the data transfer throughput without causing an excessive loss of time due to the M-file transfers.
Publication 1747-6.22