Compare UDT's?

johnfarrugi

Member
Join Date
Mar 2008
Location
London
Posts
99
Is it possible to compare two tags using the same UDT? I've tried the compare statement but I get errors. Both tags are using the same UDT's as their data types. So both tags have the same formate.
 
what PLC?

I would expect that you could compare parts of the UDT, if for instance one part is a DINT, you should be able to compare the DINT's individually.

I doubt any PLC would have a compare function where you could compare the whole UDT structure.
 
Logix5000 does not have any inherent method I know of for comparing UDT's, aside from element by elelment.

You can hack it I suppose, with the FBC instruction, but my gut feeling is that it would not work properly, (padding) and even if it did, it's only going to say that some bit at some offset is different.

Why do you need to compare UDT's for equality? You must be looking for (in)equality, as if you are trying to do greater then or less then, you already have a certain ordering scheme in mind.
 
I want to compare a UDT to see if an operator has changed any of the information available on the HMI. If the information has changed then I have other things that need to be done. In my case, there aren't to many elements in the UDT so its not a big deal to compare them individually. I just thought it would be better to do a compare with one instruction. I am using logix50000.
 

Similar Topics

Hi all, Is there an efficient way to compare the UDT elements below in ladder logic, I need to know when they're not equal? Compare...
Replies
13
Views
4,610
I have a UDT that has 3 UDT's inside it. One is used for control and two are used for status. In the polling PLC I need to examine the CMD...
Replies
14
Views
3,989
Help please. Im new to Omron and have a machine down. I have a compare = for barcode label scan. I've attached two pics. On the Mnemonics you can...
Replies
4
Views
618
Hi everyone! Accidentally closed it and it wont appear again. Checked and unchecked the option and seem to make no difference. Running v7.10.00...
Replies
16
Views
1,888
I'm working on an array that contains a UDT of 5 Items Array[4] DataType[0] - Part 1 - Part 2 - Part 3 - Part 4...
Replies
1
Views
837
Back
Top Bottom