11-08-2010 03:14 PM
I am a new LabVIEW and am still learning the basics.
I cannot seem to use this example VI to use as a subVI.
Any feedback would be appreciated.
Any other example VIs that can be used in the same way as a timer would be greatly appreciated as well.
11-08-2010 03:26 PM
What do you mean by "I can't see this VI as a subVI"?
The VI you posted does have a major problem. You have a control called Counter Enable which is read when the VI starts before the while loop starts. Then that outer while loop will run exactly one time or run forever since the control is never read again on the wire going to the while loops Stop/Continue terminal.
Actually your inner while loop WILL run forever because you have a stop boolean constant wired to the loop's stop terminal.
Where did you get this VI from? It is a bad example to be looking at. And if you are new to LabVIEW, I wouldn't start messing around with Occurrences yet until you have the basics mastered.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
11-08-2010 03:39 PM
Thanks Ravens that was insightful. I will definitely look at the links you sent me. In the mean time can you point me towards a good example VI that uses Boolean values to start/stop a timer. The timer should accumulate seconds, minutes and hours every time the Boolean is set to true and stop accumulating time when it becomes false.
Thank you
11-08-2010 04:00 PM
sorry I meant "use" instead of "see"
I am very new to this forum as well, how do I edit the title? Couldn't find it 😛
11-08-2010 09:18 PM
You can edit your reply up to 10 minutes after you first posted it if you go to the options menu to the upper right of your message.
To see an example of a timer VI, look at the Elapsed Time Express VI. You can drop it on the block diagram and configure it in its dialog box. Then right click on the VI and choose "Open Front Panel". It will ask if you want to convert it to a subVI. Say yes and open it up to see what it is doing behind the scenes.
11-09-2010 07:48 AM
Thanks Ravens, I never knew the Elapsed Time Express VI had the front panel functionality. However I need a Boolean control to start and stop the timer. The timer should accumulate the time. A reset function would also be needed to put the value back to 0.
Any idea on how I can get around this.
Thanks again.
11-09-2010 09:07 AM
@mhaque wrote:
Thanks Ravens, I never knew the Elapsed Time Express VI had the front panel functionality. However I need a Boolean control to start and stop the timer. The timer should accumulate the time. A reset function would also be needed to put the value back to 0.
Any idea on how I can get around this.
Thanks again.
You need a "stopwatch". Search the forums, there's a few examples. However, you can create your own, and learn something in the process, by creating one from the innerds of the Express VI mentioned by Ravens.