11/19/2022 5:41 PM | |
Joined: 9/27/2006 Last visit: 7/7/2024 Posts: 12268 Rating:
|
Hello ArmandoLC; I have examined your Excel file, and I have some comments. First, the DP/DP couler does not wrok with DBs, it is configured using I/O addresses, as you can see in the configuration examples in the DP/DP couple manual, section 4.3.4: https://support.industry.siemens.com/cs/ca/en/view/1179382 Note in these examples that the arrangement of data in Master1 must have the same size as in Master2, but thta they are reversed: IN words in Master1 become OUT words in the Master2 configuration, OUT words in Master 1 become IN words in the Master2 configuration. This is very important. So, to create your toggle bit program you will first have to creae DBs in bot masters' porgrams, amd MOVE the OUT words to DB50 (for example) and the IN words to DB51 (again, a suggestion) in both of your programs. Then you can start to program the toggle bt logic, where Master1 DB50.DBX4.1 (the LSB of Word 3) is set (becomes 1) then in Master2 DB51.DBX4.1 (the recieve toggle bit) you examine if the bit has a value of 1. If this is the case, you res DB51.DB4.1 in Master2, transfer it to DB50.DBX4.1 so it is transfered back to Master1, where you can evaluate if theis bit has been received in DB51.DBX4.1 of Master1. If ithe value received is 0, set it nd transfr it to DB50.DBX4.1 for transfer to Master 2, and so on... You could yuse a timer on the received bits to make sure that you declasre an alarm only if the value does not change for 2 seconds (again, a suggestion) so as not to declare a fault unless it lasts a moment. As you can see, that takes a bit of work and many tests before you can be satisfied with the results. The DP/DP coupler provides you with a much simpler tool to validate whether the communications are valid between the 2 masters: if you set the DIA switch on the coupler on both sides of the coupler, you will receive a fault signal in a dedicated bit as soon as comms are lost. Read section 4.2.2 of the manual for a description of the impact of the DIA switch. The only issue is that you receive the fault bit in the first byte of the configured IN area of each master, which mean that you would have to modify your Excel sheet a bit, adding a Word (or a Byte) to your list, in the first position. The LSB of this first word (DB51.DBX1.0 in our cnfiguration example) would be set if a fault of communication is declared. Examine both possibilities and decide how you would like to set your fault detector code in your programs. Hope this helps, Daniel Chartier |
Follow us on