Help Please

cobbrobinson

Member
Join Date
Jul 2008
Location
sullivan IN
Posts
7
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.
 
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.
 
Last edited:
  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.
 
Last edited:
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

please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
311
Hello, I am trying to get a Yokogawa Hart pressure Transmitter and a Rosemount Temp Transmitter to read on a 1769-IF4 module on an L33ERM...
Replies
10
Views
378
Please help me, I have solve many week but still not solve it. I found trouble of factory talk studio when I set tag by browse address of OPC...
Replies
0
Views
118
Hello Everyone, i Have im my Industry a Endress & Hauser Promag400 this has a screen that constantly have that error, it says to wait, somebody...
Replies
2
Views
479
Back
Top Bottom