Allen Bradley UDT vergleichen

BeckABOm

Level-1
Beiträge
19
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo zusammen
Ich mache gerade meine ersten Gehversuche auf einer Allen Bradley Logix Steuerung.
Nun bin ich auf follgendes Problem gestossen:

if UDT_Tag1 <> UDT_Tag2 then

Kann mir jemand sagen warum das nicht geht?
Die UDT sind die gleichen muss ich jeden einzelnen Typen der UDT vergleichen?(für was brauch ich denn UDT wenn das nicht geht?)

Danke für die Hilfe
 
Zuviel Werbung?
-> Hier kostenlos registrieren
CMP geht für UDTs nicht ich habe jetzt aber die lösung gefunden ist ein bischen mühsam:

By design, all of the compare type instructions must be specified down to the element level of a file or structure of a UDT in order to execute. Therefore it would not be an easy task to compare all the values of a complex UDT to see if perhaps they had changed or to make sure they are what they are supposed to be.
Aside from creating individual routines to check each structure, one way to check the whole thing all at once could be done as follows.
Basically look at the sizes of each UDT and then do a COPy of that UDT to a DINT array using that size as the number of elements to copy.
Now this DINT array can be compared with another DINT array that also has the UDT contents in it using one of the file comparison type of instructions. If a mismatch is found it will tell you about it but obviously it won't be easy to determine where in the original UDT structure the data is actually different in.
 
Zurück
Oben