Comparing two STRUCT?

BoSChoW

Member
Join Date
Apr 2006
Location
Nova Gorica
Posts
107
It is possible to compare two STRUCTs that has the same number or entrys and the same data type? If not, it is posible to transform the STRUCT into the word or integer or any other data type?

Thanks for your help.
 
Sure, but it really doesn't have anything to do with it being in STRUCT format (I'm speaking from a Siemens perspective).

All you would do is compare the bytes, words, or doublewords one by one until you are finished. You can determine the length dynamically if you want. As for different lengths, I don't know what the point would be of measuring structs of two different lengths (they will never be equal, right?).

Another way to approach it would be to determine a checksum of each, if all you wannted to know if they were equal or not, and didn't care about what is different.
 
I am doing a testing program, which with the technician will connect the inputs and outputs of the device, will select the inputs and outputs on the display and then will test the device by pressing the buttons on the remote console pr touchscreen.....

So i was thinking to compare the inputs that will be selected through the OP and the inputs on the PLC, if the value is equal the output will be true if not the output will be false.
 

Similar Topics

I’m running a micro 820 to measure a tank level, then turning on equipment at certain levels. I have an analog input (4-20) that I’m storing and...
Replies
10
Views
288
How do you go about implementing, on the M580 PLC, how many days, hours, minutes before a predefine event in the future? The RRTC_DT yields the...
Replies
3
Views
1,825
This is a Citect SCADA question I have Six variables of type REAL (Float) to compare and determine (identify) which variable has the highest...
Replies
4
Views
1,426
I have currently made a logic to read Serial input from a barcode scanner. The situation is that I need to read the barcode from the machine and...
Replies
5
Views
2,045
Hello, We are using Schneider SCADAPack 357 and Trimble Acutime 2000GPS. We are getting the data as a string(ASCII) from...
Replies
3
Views
1,484
Back
Top Bottom