Duplicate Value in files detection?

RSL

Member
Join Date
Nov 2004
Location
Missouri, USA
Posts
356
I have an array and would like to never have the same number in any 2 words.

If you enter a 3 in my_array[0] and there is a 3 in my_array[4] I want the values to trade places. I would be ok with moving zero to the old array element.

By the way I want it to be ok to have 0 in as many words as you want. Multiple 0's are ok.

I have been testing on this for a while now and have come close but never quite got it.

If anyone can point me down the right path it would help a lot. I can't help but think there is a fairly easy way to do this?

I am programming in RS5000/CLX
 
Some progress made

I finally got it to work. If I enter the same number in 2 words my logic sets the older word to "0"

I am going to try and get the data to trade places, but I am not there yet.

I will try and post my code. I used Loops to cut down on the typing.

It is a zipped .ACD file.

If anyone knows an easier way to do this PLEASE give me a hand.

Thanks

I Just got it to work, I am pretty glad!

I am still very interested in any other way to do this. I spent an embarrassing amount of time getting this figured out.

I attached the final version. It swaps the values from word to word unless you enter "0" .
 
Last edited:

Similar Topics

Hello All, need one help , looking for a example which can help me to write following code in Studio 5000 ladder logic. I have 2 String...
Replies
14
Views
10,574
Hello, We have an older machine that has a standard PanelView (2711-T10C3) connected over DH485 to a SLC 5/04 PLC via a 1761-NET-AIC module in...
Replies
1
Views
692
I have an application where I am sending emails and SMS text messages via an SMTP server, using MSG instructions. Everything works fine, except...
Replies
4
Views
1,240
Hello all, Stupid newbie question... Just making sure, a bit constantly flipping, and it is reference by 2 OTE in different ladders, that is...
Replies
9
Views
1,757
I have an existing FTV SE application running on a computer and trying to add another "station" at the location. The application is FTV SE v12...
Replies
0
Views
864
Back
Top Bottom