Support Forums
Alarm trigger only once

Hello all,

I'm in the process of trying to set up a program that reads in pressures and resistances. It has digital inputs that trigger counters. It also has an alarm that triggers when the test goes out of a certain resistance range for a certain amount of time.

Basically, I only want the resistance alarm to trigger once during the entire test (not every time it makes a false-true transition). I also would like for "FAIL - ?1 STEPS" to display the entire time after the resistance alarm has been triggered.

I thought I had something that would work, but upon testing it, I wasn't able to get the resistance alarm (lines 018 and 019) to trigger. This is what I have so far:

014: RA"A"("B:",ALARMS:OV:100KB,DATA:OV:10MB)2S LOGONA GA 
015: 3*L("Pressure (psi)",180) 
016: 3HSC("Steps taken",=1CV) 
017: ALARMR(4DS("Trigger")>0.5000){[3HSC=1]} 
018: ALARM2(1R(3W,"Resistance (ohm)")<>0.0000,2500.0000)AND 
019: ALARM3(2CV<0.5/3S)"FAIL - ?1 STEPS"{[2CV=1]} 
020: END

Why is this the case?

Best Regards,
Lisa

Hello all, I&#039;m in the process of trying to set up a program that reads in pressures and resistances. It has digital inputs that trigger counters. It also has an alarm that triggers when the test goes out of a certain resistance range for a certain amount of time. Basically, I only want the resistance alarm to trigger once during the entire test (not every time it makes a false-true transition). I also would like for &quot;FAIL - ?1 STEPS&quot; to display the entire time after the resistance alarm has been triggered. I thought I had something that would work, but upon testing it, I wasn&#039;t able to get the resistance alarm (lines 018 and 019) to trigger. This is what I have so far: ```` 014: RA&quot;A&quot;(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:10MB)2S LOGONA GA 015: 3*L(&quot;Pressure (psi)&quot;,180) 016: 3HSC(&quot;Steps taken&quot;,=1CV) 017: ALARMR(4DS(&quot;Trigger&quot;)&gt;0.5000){[3HSC=1]} 018: ALARM2(1R(3W,&quot;Resistance (ohm)&quot;)&lt;&gt;0.0000,2500.0000)AND 019: ALARM3(2CV&lt;0.5/3S)&quot;FAIL - ?1 STEPS&quot;{[2CV=1]} 020: END ```` Why is this the case? Best Regards, Lisa

Good morning Lisa,

I would have thought this would work. You do need to make sure that 2CV is set to 0 in the immediate schedule and that you are not using 2CV any where else in your code.

What is the resistance level you need to trigger? You can't have a resistance of less than 0 so you could simplify the code to ALARM2(1R(3W,"Resistance (ohm)")>2500.0000)AND

Also ALARM3(2CV<0.5/3S) is not very clear. 2CV will always be less that 0.5 it you have initialized it at the start of the code so teh trigger delay is not very effective

But I would have thought the logic would be correct.

Cheers,
Roger

Good morning Lisa, I would have thought this would work. You do need to make sure that 2CV is set to 0 in the immediate schedule and that you are not using 2CV any where else in your code. What is the resistance level you need to trigger? You can&#039;t have a resistance of less than 0 so you could simplify the code to ALARM2(1R(3W,&quot;Resistance (ohm)&quot;)&gt;2500.0000)AND Also ALARM3(2CV&lt;0.5/3S) is not very clear. 2CV will always be less that 0.5 it you have initialized it at the start of the code so teh trigger delay is not very effective But I would have thought the logic would be correct. Cheers, Roger

Hi Roger,

Thanks for the advice. I did forget to declare 2CV in my immediate schedule.

To clarify on the /3S, I wanted to make sure that the resistance was above 2500 ohms for 3 seconds before taking action. However, since I couldn't define it in the Delogger after selecting the AND option, I put it in the other alarm. I ended up just switching the order of the 2 alarms so that I had that capability.

Now that I've fixed up those basic things, though, it still doesn't seem to go off.

018: RA"A"("B:",ALARMS:OV:100KB,DATA:OV:10MB)2S LOGONA GA
019: 3*L("Pressure (psi)",180)
020: 3HSC("Steps taken",=1CV)
021: ALARMR(4DS("Trigger")>0.5000){[3HSC=1]}
022: ALARM3(2CV<1)AND
023: ALARM2(1R(3W,"Resistance (ohm)")>2500.0000)"FAIL - ?1 STEPS"{[2CV=1]}
024: END

Thanks,
Lisa

Hi Roger, Thanks for the advice. I did forget to declare 2CV in my immediate schedule. To clarify on the /3S, I wanted to make sure that the resistance was above 2500 ohms for 3 seconds before taking action. However, since I couldn&#039;t define it in the Delogger after selecting the AND option, I put it in the other alarm. I ended up just switching the order of the 2 alarms so that I had that capability. Now that I&#039;ve fixed up those basic things, though, it still doesn&#039;t seem to go off. ```` 018: RA&quot;A&quot;(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:10MB)2S LOGONA GA 019: 3*L(&quot;Pressure (psi)&quot;,180) 020: 3HSC(&quot;Steps taken&quot;,=1CV) 021: ALARMR(4DS(&quot;Trigger&quot;)&gt;0.5000){[3HSC=1]} 022: ALARM3(2CV&lt;1)AND 023: ALARM2(1R(3W,&quot;Resistance (ohm)&quot;)&gt;2500.0000)&quot;FAIL - ?1 STEPS&quot;{[2CV=1]} 024: END ```` Thanks, Lisa

Good morning Lisa,

Go back to basics and check the resistance is wired correctly, the reading does go over 2500 Ohms, is connected to channel 1 etc. You can also test the logic by changing the input to a channel variable then in the send part of the text window, write values to the CV and see if the logic is correct, e.g.: set up a job with:

RA1S
ALARM3(2CV<1)AND
ALARM2(10CV>2500.0000)"FAIL - ?1 STEPS"{[2CV=1]}
end

And in the command window send:

2CV=0
10CV=0

and the alarm should trigger when you enter 10CV=3000

Cheers,
Roger

Good morning Lisa, Go back to basics and check the resistance is wired correctly, the reading does go over 2500 Ohms, is connected to channel 1 etc. You can also test the logic by changing the input to a channel variable then in the send part of the text window, write values to the CV and see if the logic is correct, e.g.: set up a job with: ```` RA1S ALARM3(2CV&lt;1)AND ALARM2(10CV&gt;2500.0000)&quot;FAIL - ?1 STEPS&quot;{[2CV=1]} end ```` And in the command window send: ```` 2CV=0 10CV=0 ```` and the alarm should trigger when you enter 10CV=3000 Cheers, Roger

Hrm, I tried that with no luck. I've also tried triggering each alarm by itself - that works. Something about using the AND seems to be tripping the code up.

Hrm, I tried that with no luck. I&#039;ve also tried triggering each alarm by itself - that works. Something about using the AND seems to be tripping the code up.

Good morning Lisa,

I just tested some code here and it works as expected:

begin
1..2cv=0
ra10s
1..2cv
alarm1(1CV<0.5)and
alarm2(2cv>0.5)"Alarm is true^M^J"{1cv=1}
end

Setting 2CV=1 the first time triggered the alarm and any time after that didn't trigger. The output was:

DT85> 1CV 0.0
2CV 0.0

2cv=1
2CV 1.0

DT85> Alarm is true
1CV 0.0
2CV 1.0

2cv=0
2CV 0.0

DT85> 1CV 1.0
2CV 0.0

2cv=1
2CV 1.0

DT85> 1CV 1.0
2CV 1.0

Cheers,
Roger

Good morning Lisa, I just tested some code here and it works as expected: ```` begin 1..2cv=0 ra10s 1..2cv alarm1(1CV&lt;0.5)and alarm2(2cv&gt;0.5)&quot;Alarm is true^M^J&quot;{1cv=1} end ```` Setting 2CV=1 the first time triggered the alarm and any time after that didn&#039;t trigger. The output was: ```` DT85&gt; 1CV 0.0 2CV 0.0 2cv=1 2CV 1.0 DT85&gt; Alarm is true 1CV 0.0 2CV 1.0 2cv=0 2CV 0.0 DT85&gt; 1CV 1.0 2CV 0.0 2cv=1 2CV 1.0 DT85&gt; 1CV 1.0 2CV 1.0 ```` Cheers, Roger
30
5
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft