Showing results for 
Search instead for 
Did you mean: 

My sequence with a subvi in it stops in the first frame that contains the subvi.

I am attempting to write a labview program that will, amoung other things, control the flashing of 3 lights, one green, one red and one blue. I want to syncronize the flashes with the flashing of indicators on the labview panel.

I have a computerboard PCI-DAS1001 to run the lights. I am using subvi's based on their universal library to
interface the board to labview. I modified the computerboard subvi to turn on the digital control that will
actually flash a red light. The control works, I can manually turn the control off and on and using my multimeter see that the voltage on the board goes high and low.

I wrote a simple sequence with five frames to control the panel indicators. It alternately:

1. Turns all lights on.
2 All off.
3. Blue on.
4 Green on.
5 Red on.

at 2 second intervals. That works fine.

When I introduce the computerboard vi to the sequence and try to run it, I run into problems. If I place the vi in the first frame and wire it to the true constant that turns the red indicator on and then try and run the
vi, it runs the first frame and then stops. It won't continue to the next frame.

What am I doing wrong here. I've included both the sequence (BlockedBGRnew) and the subvi (XDBitOutRed).
0 Kudos
Message 1 of 3
Well of course your main VI stops. You have a while loop in the subVI that only terminates when you click the stop button and since the subVI's fron panel is not visible is runs forever. What I would suggest you do is move the daq config to the main and do that once. Then, create a subVI with only the daq write.

Also, The subVI is very hard to read with the colors you've chosen. All the coloring does is hide the wires. It's the same thing as doing a Word document with white text. You may know hwat words you write but no one else will.
0 Kudos
Message 2 of 3
Your "blockedBGRnew" VI is just a mess. It is not clear why you would repeat all that code som many times using local variable when you could do it with a single loop and no locals. Please also don't hide elements under structures, e.g. there is a stray "Tick Count" under the while loops of every frame!

I have attached two suggested alternatives. If you don't need to see the timer progress, you can use a simple wait. If you really want to see the timer indicators, use something like suggestion 2. (both are LabVIEW 6.1)

And YES, you need to remove the while loop in your subVI. (It is also not clear why you need to run the initialization (frame 0) with every call, but I don't know your hardware).

Message Edited by altenbach on 05-18-2005 12:44 PM

Download All
0 Kudos
Message 3 of 3