Schneider Unity equivalent of RSLogix DDT instuction

sarahc

Member
Join Date
Oct 2005
Location
Waikato, NZ
Posts
22
Hi, I have some RS Logix 5000 code and have to write the equivalent in Unity Pro 8.1 in function block.
In Logix I am using the DDT instruction to look for differences in the bits of 2 arrays (type DINT[32]), then record where those differences are.
To paraphrase Rockwell help: The DDT instruction compares the source array to the reference array and stores the locations of any mismatches in the result array. The controller also changes the mismatched bits in the reference array to match the source array.
So I'm completely stuck on how to do this in Unity (I'm not familiar at all with it). I'm investigating the EQUAL_ARDINT but don't think that will quite do it.
Help?
 
I think that there is no direct replacemant, you need to do own FBD block

Maybe XOR and invert result after XOR. Then you have bit table which shows if there is differences.
After founding bits, copy source to result array.

Another way can be to use search GT and LT array functions. Then copy from source to reference with founded place. You need to do this x times
 
Hi Sarah
Equal_ardint does a comparison between 2 arrays. This gives you a result where the 1st difference is in the 1 array. But you can specify where the comparison must start. So if you write some code you could start initially at position 0 then if the array does find a difference record it and the let the block compare from the position it found the difference +1.There are other array function blocks aswell in the library that you could use

Find_eq_ardint might also be an option
 
Last edited:
Doing this:

FOR (WordIndex :=0 TO 63) DO
FOR (BitIndex :=0 TO 15) DO
wMask := SHL(16#0001, BitIndex );
IF A[WordIndex] AND wMask NE B[WordIndex] AND wMask THEN
B[WordIndex] := B[WordIndex] OR (A[WordIndex] AND wMask);
Res := (WordIndex*16) + BitIndex;
(other stuff) ;
END_IF;
END_FOR;
END_FOR;
 

Similar Topics

Hi, I've exported a PL7 application to the .FEF file succesfully. Imported the .FEF file in my Unity Pro project, but two of the five sections in...
Replies
0
Views
765
I want transfer my I/O data from schneider (Unity Pro) as a write data and RS Logix 5000 as a read data. I use Ethernet as an communication...
Replies
0
Views
688
Is there a tool to convert a ControlExpert project (.sta, .ztx or .zef in v14.1 or v15) to be opened using Unity Pro (v11 or V10) ? Thanks,
Replies
6
Views
2,218
Hello everyone! On a project using the P572634M CPU , what is the best/safest way to determine what Words(%MW) have been used in Unity v10 ...
Replies
12
Views
3,029
Hi all, I'm sure this is a stupidly simple question, but I'm really struggling to find any EFB or similar to do this. I want to map a block of...
Replies
10
Views
3,380
Back
Top Bottom