RMA
Member
Somewhere along the line either somebody told me, or I read somewhere, that it was better to spread DP-addresses out, rather than using adjacent addresses. I didn't understand this at the time, because I reckon either the address matches or it doesn't. However, having been told to it that way, I did and have carried this over into my current project.
After having tried detecting missing DP-Stations using SFC12 and discovering it wasn't suitable (it only registers missing DP-Stations after a 1 min Timeout - 1 min would be OK, 20 + mins is NOT!), I decided to try FC125 as mentioned in another Thread here.
This works fine and fast, but I could make my life REALLY comfortable if I were to readdress my DP-Stations so that DP-address = Module number. What FC125 returns in four DWORDS is the Bit representing the address of each faulty/missing DP-Station. So if I renumber my Module DPs 1 - 21 (plus a couple more for general switching gear) and push the CPU up to, say, 25, I could simply do:
L DW#16#34444E //Get Mask for Modules 1 - 21
L DB100.DBD52 //This is where FC125 stores the Bits for the mising DP-Stations
UD
T DB1000.DBD0 //Here is the list of available stations which gets ANDed with attempts to set the SELECT Bit for the Modules.
This would save about 300 lines of code which was being used before with SFC12 (well, OK, about a third of that was handling the SFC12) as well as being understandable at a glance.
Anybody got any reasons why it won't work, or other reasons why one shouldn't do it, even though it might work?
After having tried detecting missing DP-Stations using SFC12 and discovering it wasn't suitable (it only registers missing DP-Stations after a 1 min Timeout - 1 min would be OK, 20 + mins is NOT!), I decided to try FC125 as mentioned in another Thread here.
This works fine and fast, but I could make my life REALLY comfortable if I were to readdress my DP-Stations so that DP-address = Module number. What FC125 returns in four DWORDS is the Bit representing the address of each faulty/missing DP-Station. So if I renumber my Module DPs 1 - 21 (plus a couple more for general switching gear) and push the CPU up to, say, 25, I could simply do:
L DW#16#34444E //Get Mask for Modules 1 - 21
L DB100.DBD52 //This is where FC125 stores the Bits for the mising DP-Stations
UD
T DB1000.DBD0 //Here is the list of available stations which gets ANDed with attempts to set the SELECT Bit for the Modules.
This would save about 300 lines of code which was being used before with SFC12 (well, OK, about a third of that was handling the SFC12) as well as being understandable at a glance.
Anybody got any reasons why it won't work, or other reasons why one shouldn't do it, even though it might work?