LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I delay 1 of many outputs exiting a case structure?

I have a system here which is sort of a finite state machine, using digital I/O, I am monitoring a series of digital inputs which in turn form a binary number which is the input to a case structure. Depending on the binary string (number) that is read by the case structure, a particular series of boolean constants (T or F) exit through the case structure which are then used as my digital outputs (in my case they are controlling a series of relays). Basically, I have a condition where I would like one of the relays to be time delayed when switching in one direction, but not in the other. The problem is that when I do delay this bit, it also delays all of the bits coming from the case structure.
i.e. all the relays are delayed. How can I delay just one of them?
0 Kudos
Message 1 of 9
(3,439 Views)
You could try bundling your boolean constants with time delay specifiers (numbers) such that the one channel has a higher number than the rest. You would need to pull out that number (unbundle) when you do your relay operation and wait the specified delay time.

Dan Press
www.primetest.com
0 Kudos
Message 2 of 9
(3,439 Views)
Dan, how is it going? This is Jim Kring from Cal-Bay Systems. I am going to NIWeek. I heard from one of the ex-b2 guys that you were going, too. Hopefully we'll bump into one another.

-Jim
jkring@calbay.com
0 Kudos
Message 4 of 9
(3,439 Views)
Jim,

Yup! I'll be there. I'm back in the Alliance Program with PrimeTest out here in Florida. See you in Austin!

Dan
www.primetest.com
0 Kudos
Message 5 of 9
(3,439 Views)
Well, I can't think of a really easy way. You could generate a delayed pulse on a counter output, instead of using a digital line. Otherwise you will need to keep track of the delay time in your loop somehow. The timing is only going to be as accurate (deterministic) as your loop rate, and will be operating system dependant. You may have some jitter. Attached is an example of a software delayed boolean indicator. Download both VIs.

-Jim
Download All
0 Kudos
Message 3 of 9
(3,440 Views)
In this case, I think you would have to build your delay outside of the case structure. A structure does not pass any variables out until ALL are filled. You might try building another case structure (outside the first one) that looks at that one line and passes it straight through in one case and in the other, uses a delay (one of the timers).

Rob
0 Kudos
Message 6 of 9
(3,439 Views)
I tried that, but it still delays all the relays...This is only my second project using labview, how could something so simple be so complex? anyway thanks for the help...
0 Kudos
Message 7 of 9
(3,439 Views)
I am a new user to labview. I am trying to do something similar. I want to use a boolean button to activate an ouput. I need the "ture" boolean to turn it on immediately and the false case to delay when it turns off.

The delayed_relay.vi and Boolean_trigger.vi looks like what i need only i need it to work in reverse.

can any one help?
0 Kudos
Message 8 of 9
(3,367 Views)
It seems your requirements are much simpler than discussed in these very old posts. 🙂

You could do something like in the attached code (LabVIEW 7.0). Modify as needed.
0 Kudos
Message 9 of 9
(3,356 Views)