Help Please

I have 7 inputs from sensors and I want to turn on an audible alarm if 2 or more are triggered. Is there a way to do this without writing all the logic out in a huge rung? I know there should be but I'm drawing a blank.
Thanks in advance.

Ryan
 
do a compare the IO card to the states where the inputs are in a clear state. save the clear state register values. compare the clear state register with the Io card register. If not equal sound alarm horn.
 
If Input is True use a rising edge to add 1 to a holding register. Do this for all inputs. Then if register is >1 set alarm. Else move zero to register.
 
CLR(AlarmIndex)
XIC(input0)---ADD(1, AlarmIndex, AlarmIndex)
XIC(input1)---ADD(1, AlarmIndex, AlarmIndex)
.
.
.
XIC(input6)---ADD(1, AlarmIndex, AlarmIndex)

GEQ(AlarmIndex, 2)---OTE(Horn)

Basically, every scan clear out a tag that keeps track of the number of currently active alarms (AlarmIndex), and add to that tag 1 for every alarm that is active. Set a horn bit high if the tag is greater than or equal to 2.

If the inputs are members of an array, you could condense the code with an FSC, but in my opinion that is a bit overkill and unnecessarily complex for only 7 inputs.

Additionally, you could do an OTL instead of OTE for the horn or tie it into existing alarming as appropriate. If you OTL, just be sure to clear the bit on the first scan.

This is just a more verbose description of Ken's method.
 
  1. If OP can copy the alarm bits into an integer,
  2. AND
  3. if that integer is big enough to hold all your alarms,
  4. AND
  5. if that integer result is non-zero,
  6. AND
  7. if that integer does not have exactly one bit set,
then there must be two or more active alarms.



I assume OP knows how to do, or test for, (1), (3) and (5); they can ask The Google how to do (7) (it was also answered in this forum a several months ago).


This would only work for the "two or more" case, of course.
 
CLR(AlarmIndex)
XIC(input0)---ADD(1, AlarmIndex, AlarmIndex)
XIC(input1)---ADD(1, AlarmIndex, AlarmIndex)
.
.
.
XIC(input6)---ADD(1, AlarmIndex, AlarmIndex)

GEQ(AlarmIndex, 2)---OTE(Horn)

Basically, every scan clear out a tag that keeps track of the number of currently active alarms (AlarmIndex), and add to that tag 1 for every alarm that is active. Set a horn bit high if the tag is greater than or equal to 2.

If the inputs are members of an array, you could condense the code with an FSC, but in my opinion that is a bit overkill and unnecessarily complex for only 7 inputs.

Additionally, you could do an OTL instead of OTE for the horn or tie it into existing alarming as appropriate. If you OTL, just be sure to clear the bit on the first scan.

This is just a more verbose description of Ken's method.

If Input is True use a rising edge to add 1 to a holding register. Do this for all inputs. Then if register is >1 set alarm. Else move zero to register.

Thanks gentlemen. This worked great.
 
If I remember correctly, there was a "bit-hack" posted for this a while back, but it did assume all of the bits were in one integer.

Anyway the OP has got it working, so not bothering to search for it, bit the "bit-hack" method would be of benefit to others facing the same problem.
 
If I remember correctly, there was a "bit-hack" posted for this a while back, but it did assume all of the bits were in one integer.

Anyway the OP has got it working, so not bothering to search for it, bit the "bit-hack" method would be of benefit to others facing the same problem.


see post #7.
 
Made some ladder, this should work too, in one rung:
5eI8QxM.png


Works for 32 bits, but I'm sure for longer boolean arrays we can write an AND and SUB AOI which can handle even more alarms.
 

Similar Topics

Hi We are using a plastic packing machine for facial tissue machines from China . Currently , we have a demand for improvement to check and modify...
3
Replies
327
Views
Proface PFXSTM6400WADE (current model).. can find the hardware manual online, but what I really need is the operations manual, which I can’t find.
1
Replies
213
Views
Please help need lattest CCW download software for a micro820 PLC CAT 2080-LC20-20QWB
1
Replies
551
Views
Hi guys, Looking for some help - as the thread title states, I'm trying to remotely change screens on an older machine. HMI: FT View SE Local...
5
Replies
449
Views
Top