AB rslogix 5000 instruction logic...

AmazingTrans

Member
Join Date
Nov 2005
Location
Illinois
Posts
38
Hi there,

I have a word with 16 bits. I want to do a logic where it check if any two bits are true, trigger an output. What type of instruction should i use?

Hope someone have a solution.

Thanks!
 
Does it have to be exactly two or is it two or more? How about taking the word value modulus 2? If the result is 1, then two or more bits are true.
 
TheWaterboy - this checks for two or more bits. And it may fail if the math treats the location as signed and the MSB is '1'.

jkerekes - mod 2 = 1 just shows odd. The original may be '1'.

I you need exactly 2 bits then try this algorithm. If it needs two executions to clear the number then you have it.
 
Thanks for everybody quick reply.
Yes, i am only looking for 2 bits and it can be in any position of the 16 bits. As long 2 bits are high, trigger the output.
 
OK. Let's try this again. :oops: How about the FBC function? This will find all the mismatches. If the result .LEN = 2, then you can act on it. If it isn't, ignore.
 

Similar Topics

Hey guys, thanks for taking the time to look into my question. I'm building a system to monitor several other systems for faults and one of the...
Replies
17
Views
4,638
I"m trying to average an array of DINT's called FIFO_ARRAY. It has 1000 elements in it. Here is what I have entered into the AVE instruction...
Replies
11
Views
4,728
Hello Please Help, I want to use a FSC instruction that will scan 20 DINT arrays. If the arrays are greater than 1000 display the value. How do I...
Replies
4
Views
1,765
Hi There, When i did FRD instruction in SLC 500 its working, when i try to simulate in RSLogix 5000 same way as i did in SLC 500 which is not...
Replies
14
Views
2,728
This is a real simple interface problem. Typically when I'm developing in ladder I will Ctrl+C an instruction and Ctrl+V, the new instruction will...
Replies
2
Views
1,677
Back
Top Bottom