compare multiple addresses

panel1

Member
Join Date
Nov 2004
Location
North Carolina
Posts
24
Im writing values to different N7 addresses from my operator interface. Im writing at least eight values ranging in value from (0-7) These values are being written to eight different N7 locations The value in each N7 location determines an output..... with all that being said, is there an easy way to compare and ensure that I have not duplicated an input from my operator interface. I feel like i could accomplish this using many compare statements. I dont really feel like that is the best way. Doing it that way could be very long. I need a lil help. Thanks


This is an example of what Im trying to prevent. These values (0-7) can be written in any order. Just not duplicated.

N7:10 = 1
N7:20 = 2
N7:30 = 3
N7:40 = 4
N7:50 = 5
N7:60 = 6
N7:70 = 7
N7:80 = 7 *duplicate input of 7*
 
If the CPU allows indexing then set a word to zero (let's say N7:0) and reset a 'duplicate found' bit.

For each storage location X = 10,20 etc:

XIC N7:0/[N7:X] - OTL 'Duplicate Bit'

Obxiously if your 'duplicate bit' is set then you can get out of the test. Otherwise:

XIO N7:0/[N7:X] - OTL N7:0/[N7:X]
 
You could do 7 Wordwise AND operations.

Word-1 AND Word-2 = Result-1
Result-1 AND Word-3 = Result-2
Result-2 AND Word-4 = Result-3
Result-3 AND Word-5 = Result-4
Result-4 AND Word-6 = Result-5
Result-5 AND Word-7 = Result-6
Result-6 AND Word-8 = Result-7

You should be able to do this in 1 rung.

If result-7 does NOT = 255 then either you have a duplicate or you have exceeded the allowable range. This is enough to indicate that something is not right. It is a simple matter to prevent the process from using that data until the combination of entries is unique (i.e. 255).

However, in terms of what is really expected or allowed, this does not indicate that the data is correct. It only indicates that the entries are unique. If there are certain sequences that are allowed and other combinations that are not allowed then you will have to make other "rules" to determine whether the particular sequence is valid.
 
I got two suggestions:

1. Put Bernie's example into a FOR NEXT loop and do what he says.

2. It is a good practice to have data to and from an operator interface organized into contiguous registers. This will insure
maximum speed of data transfer. This is true even though RSLinx
provides data optimization.
 

Similar Topics

Hey guys, I wanted to see if there was a better way to compare 10 points (or more) using a limit instruction. I have 10 points of data that...
Replies
2
Views
1,588
Hello, I'm looking for a simple way to compare multiple string files with a single string file. If I have a group of 10 files buffered in a...
Replies
3
Views
4,206
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
623
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,909
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
840
Back
Top Bottom