LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I turn on an LED when a sub-VI is called?

Isn't there some way to illuminate a front panel LED when a certain VI is executing, and turn it off when it completes? I have tried many ways to implement this with various boolean functions (including the transition), but the LED stays latched once set.

Any ideas?
0 Kudos
Message 1 of 9
(3,740 Views)
Hi,
you can do it with the help of application control functions from "Functions->Application Control" palette. Make the following thing:
1. Open application reference with "Open application reference.vi"
2. Open VI reference to VI you want to test with "Open VI reference.vi"
3. Create property node and wire it to "VI reference" output of "Open VI reference.vi".
4. Choose "Execution->State" property. This returns the state of the vi - run, idle etc. Read this value.
5. Then close references with "Close LV Object Reference".

I have created example which tests the execution state of specified VI. You can use it as a basis for your application.

Good luck.

Oleg Chtuko.
Message 2 of 9
(3,742 Views)
I am quite sure, there should be several ways. This forum was supported by many LV experts. Here is my view. Example says more than words. Hope this would help.

Best Regerds,
LV lover
Download All
Message 3 of 9
(3,740 Views)
Thank you! I see how this works and will now attempt to use it to fix my application.
0 Kudos
Message 4 of 9
(3,740 Views)
Thanks Oleg - after some experimenting & adding some more logic, I was able to connect an LED & make it go on/off depending on the execution state of the sub-vi.
Download All
0 Kudos
Message 5 of 9
(3,740 Views)
The best way to do this is with an event structure. Use the Change of State to toggle when the event has occurred.

Hope this helps!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 6 of 9
(3,740 Views)
Thanks Eric,

I was not aware of event structures until now. I read up on it this morning and will have to experiment with it. One thing - can you tell me where to find the Change of State that you mention? I can't seem to locate it on any of the right click palettes, or even on a Help search.
0 Kudos
Message 7 of 9
(3,740 Views)
Ahh...silly me.... "Change of State" was a vi from an older version USING events. The actual event has no such terminal name, but detects a change of state by wiring a SOURCE terminal to the left edge of the structure. If you click on the left edge of the structure, there will be a pallet of different kinds of activities that can cause an event to happen. I will be sending you an example shortly....I'm working on just such a project for myself.

Be back soon!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 8 of 9
(3,740 Views)

Hi Oleg,

 

Wonder if you can help me.I have attached my LV for your reference. I have designed my LV in the way my LEDs will turn on and off. But how do I design to make R led to turn on for 10ms when IR is off. Then when IR is on, R is off for 10ms, lastly both off. If possible, pls modify my lv and guide me pls. Your help is greatly appreciate.

I can only design my program in LV 6i with PCI-MOI-16E-1 daq card. And do you have any idea how much current this card draw??

 

Thanks a million

0 Kudos
Message 9 of 9
(3,558 Views)