LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple indicator from elapsed time

Hello all,
 
I need help in simplifying my block diagram. In my semII)timing.vi, i include multiple LED indicators that would light up on specific time. I've also included a time display to indicate the elapsed time. I've also included and On/Off light tht would turn red when the test time(6mins) has ended.
 
But recenlty, i came across the Elapsed Time function as seen in the sem11)elapsed time.vi. I'm trying to incorporate that function, but it only allows one set timed.
 
Could anyone suggest how i could include multiple controls, so multiple LEDs can light up at different times (at every mins)
 
regards,
beplusso.
Download All
0 Kudos
Message 1 of 7
(3,756 Views)
I think using the Get Date/Time in Seconds is a better method for getting the elapsed time. This is a very simple example, but you could adapt it very easily to your program. You could also create a sub-vi that compares the elapsed time with your set points to clean up the code a bit. Finally, I would greatly recommend labeling each control and indicator, so you can tell them apart.

Good luck!

B-)
Download All
Message 2 of 7
(3,739 Views)

Hey,

Thanks alot! that greatly helped me.

i have one more question though, how do i group that block diagram so i could put it into another VI?

0 Kudos
Message 3 of 7
(3,722 Views)
Here's the VIs to show what I meant.
 
The first VI, II)field indicators.VI is with all the LED and timing.
The second, II)Counter DAQ, is my "main" VI.
 
I need help in putting the first VI into the 2nd VI. i've come across setting up a sub VI, but i'm not quite sure of how to do it.
 
Thank you so much!
Download All
0 Kudos
Message 4 of 7
(3,718 Views)
Absolutely. Glad I could help.

A sub-vi can be its own stand-alone program, or just a bit of code put together to clean up your block diagram. In your case, you probably just want to clean up the code some.

Usually when I do this I have one main VI where all of the user interface controls and indicators are together in the same vi, and then break down some of the block diagram functions into separate sub-vi's, which you place inside the main vi. In your case, none of the code is doing anything terribly complicated, so you could probably put parts of either program into a sub-vi. You could put all those comparisons into a sub-vi, and that would reduce the code a little bit. But you'd have a vi with one input and 7 outputs, and I don't know if the timing values or number of LED's would ever change.

Let me see if I can throw something together quickly that would give you the general idea of how that would work.
Message 5 of 7
(3,712 Views)
Here's something that should at least give you the general idea. I don't know what version of LabVIEW you have, but these are in 8.2.

I put the comparisons for your LED indicators into one vi, and the code that calculates the (m) and (cm) into another. In a simple program like this, they are not really necessary, but if your code were to grow (which it easily can) it might make things cleaner later on.

Finally, you should always use labels for all of your controls and indicators. You can simply hide them if you don't want to see them on the front panel (right-click on the front panel item and select Visible Items - Label), and it makes wiring and debugging much easier.

Good luck!
Message 6 of 7
(3,705 Views)
hey, THANKS A LOT!!
 
you've really helped me. unfortunately, im using Labview version 8. so i cant open the VIs you have sent me.
Anyway, how did you create the LED triggers.VI and the CounterDAQ.VI?
0 Kudos
Message 7 of 7
(3,692 Views)