Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a timed input control

Hello,

 

I have been working on creating a control such that it has to be true for a variable timeframe before it returns a true. For example, I have a low flow alarm which may come in due to a bubble in the line but clears immediately. I only want an alarm if the low flow is rung in for a certain amount of time. The engineer requested that there is a 2 minute delay, but I think 30 seconds would be more than enough. I think a little background on this project is in order.

 

My project involves three main parts, a PLC, an OPC server and LabVIEW with the DSC module. The main vi is a stacked sequence; first which basically initializes the system, the second sequence is the heart of the project where all the magic happens and the last sequence is a shutdown. The second sequence has seven different while loops, all of which run independently of each other. One handles events, one gathers real time data, and one checks for alarms in the shared variables. This is where I get “creative” to make it work. Another while loop in this sequence handles the alarms. I use a local variable from the “alarm” loop to pass alarm conditions to the “control” loop. In the “control” loop I pass the alarm condition into a subVI. The subVI basically is logic “mess” which took up too much space so I converted it to a subVI. This subvi spits out which alarms are in/clear and what systems should be on/off.

 

So this brings me to the point of this post, I want the No Flow Alarm to be in for minimum of 30 seconds before I get the alarm, BUT I don’t want to hang up the process of handling other alarms, some of which are much more important to the system and safety of personnel. Any help will help
Daniel Keyser


"I reject your reality and substitute my own"
Adam Savage
"Mythbusters"
0 Kudos
Message 1 of 7
(5,468 Views)
Hi

If I understand correctly you need an extra level before an alarm goes.
You need the low level alarm to be true a certain time before you make it a real alarm.
maybe you can write an intermediate level that has checks the original value (each second) and outputs the alarm only when both conditions are met.

good luck
greetings from the Netherlands
0 Kudos
Message 2 of 7
(5,466 Views)
Thank you Albert for that response,
 
I think that would work on some scale, but I am not sure it will accomplish what I am looking for. From your idea it may be possible to still get a false alarm. I far as I understand you have two checkers checking the same thing just at differents times. It may possible the intermediate checker checks at the time in which the original checker is getting a bad signal. Your idea decreases the odds of a false signal, but doesn't completely eliminate it.
 
Attached is an idea I am playing around with. The issue I am seeing now is that the alarm signal in the main vi is not a Boolean controller as in this example but is an Boolean indicator. Plus timing will change when I move this vi to another computer which is running differently then this one.
Daniel Keyser


"I reject your reality and substitute my own"
Adam Savage
"Mythbusters"
0 Kudos
Message 3 of 7
(5,461 Views)
Hi

The least you should change is the wait ms multiple into the wait ms.
the wait ms multiple can wait zero to x ms because it triggers on the next multiple of the system clock and that can be immediate.
the wait ms can generate a tiny timeshift too long but never too short.

I tried to tell to not look at the original anymore but only at the intermediate alarm.

good luck,
tomorrow I'll look again at your proposal.
greetings from the Netherlands
0 Kudos
Message 4 of 7
(5,449 Views)
Hi,
 
 I believe I misunderstood you about not looking at the original signal. After reading your last response, I think I have a better understanding of what you were trying to explain. I have not been able to accomplish my task as of this post. I will change the wait until next ms Multiple to wait ms. I think I am on the right track, but it is not "clicking" just yet. Thanks for your input it is greatly appreciated.
Daniel Keyser


"I reject your reality and substitute my own"
Adam Savage
"Mythbusters"
0 Kudos
Message 5 of 7
(5,423 Views)
Hi Dan,
 
Along the same lines as Albert's suggestion, you can read your alarm and compare the set time to the current time. If the current time is 30 seconds (or 1.5 minutes), you can generate an alarm on a Boolean. Then you can just use this Boolean's alarm. The image below demonstrates this. I hope this helps!


Message Edited by lion-o on 01-04-2008 11:05 AM
0 Kudos
Message 6 of 7
(5,374 Views)

Hi Mike,

I like what you have shown here. It was more of what I wanted to do. It seems to have more control on the time delay then what I have used. What I did was read in the alarm as a Boolean variable. That controlled a case structure, where if true, read the alarm as a local variable in a for loop which integrated 32times. There was a wait ms.vi in the for loop to control the time delay. The array was converted to unsigned 32 bit number. If all array members were 1 then the number would be xFFFFFFFF (in hex). I compared the resulting number to xFFFFFFFF. I would only get the alarm if the results were equal. It turned out to do what I needed. Thanks to both Albert and Mike for your help. I may incorporate Mike's suggestion when the system goes offline again.

 

cheers!

Daniel Keyser


"I reject your reality and substitute my own"
Adam Savage
"Mythbusters"
0 Kudos
Message 7 of 7
(5,358 Views)