10-20-2009 07:53 PM
Hi,
I need to run a VI for very short amounts of time, say 100ms, 200ms, 500ms or 1s. I want to get this time from the user, maybe as a control variable. How may I do this? I tried using the "elapsed time" function but seems like it was not meant for such small time periods. Any ideas?
Thanks
Kaiser
10-20-2009 08:15 PM
Sure it will work for such short periods.
I would recommend dropping on your VI, right clicking, and pick open front panel. That way you can see what is going on inside.
10-20-2009 08:16 PM
What are you trying to do in the "short time"? When you say "run a VI" do you mean "start, run and stop running", or do you mean for the vi to do something for the specified time, i.e. flash a front panel LED for a precise period after the operator clicks a button? In the later case 100mS is actually fairly long, and can be accomplished with various timing functions, with varying degrees of accuracy. The most accurate, in a Windows environment, would probably be the timed loop. If you need really accurate, particularly if you are interfacing with hardware (a pushbutton, an actual lamp, etc.) a real-time system would be the best bet.
10-26-2009 02:48 AM
Thanks for your prompt replies and sorry for not replying for a while. got busy.
The thing is, when I compare with the elapsed time, it compares with the time for which the VI is running, which is much greater than 100ms, actually around 3s, though the hardware runs for only 100ms to get the data. Would it be possible to get the data of 100ms, which would be the 100ms of the device, and not the running time of the VI? If the only way is to use the real-time component, can you please tell what that would entail: I've never used the real-time component before so have no idea how to convert my current VIs to real-time, and how hard or how much time it would take.
Thanks
10-26-2009 04:27 AM
Also, for some reason the values which are supposed to be stored in the buffer, are only stored if I run the VI in highlight mode. If I run it without it, the entire buffer shows the default values('0'). Do you know what could be causing this?
Thanks
Kaiser
10-26-2009 05:23 AM
10-26-2009 10:04 AM
I'll try to see if it contains a race condition. Anyway, I was able to find another way to do it using the data itself. Thanks for your responses.
Kaiser
10-26-2009 07:19 PM
10-27-2009 12:51 AM
10-27-2009 04:17 AM
Hi
is this what you are asking ? (see attached vi)