10-13-2009 03:14 AM
Hello,
I have a problem. I need to execute some code at a specific time: subVI A should run at e.g. 2 seconds (after start) and stop at 3.5 seconds and subVI B should execute at 3.5 seconds until 5 s. The user can choose the time points. It could also be that subVI B has to execute before subVI A or at the same time.
Time precission is not important +/- 20 ms is ok.
I have implemented it like that: In a loop (period time approx. 20ms) I query if the timeframe has come and then the subVI will be executed.
See attached picture.
I don't believe that this is an economic way. It will produce high CPU load. How can I do it better?
10-13-2009 03:15 AM
10-13-2009 03:56 AM - edited 10-13-2009 03:56 AM
Like this. Use the "Upload or insert an image" option on the Toolbar of the Reply window.
10-13-2009 04:05 AM
Use "While Loop" with Case inside, and use Shift register to remember the last time that the Case was executed...
and if you need to run both vi's in parallel use two while loops.
10-13-2009 04:15 AM - edited 10-13-2009 04:18 AM
Aah, all right.
You've uploaded a picture with a red cross?
10-13-2009 04:33 AM
@HaD
Something like this?
Johannes
LabVIEW 7.1 (!)
10-13-2009 05:17 AM
I don't think that this is an optimum solution.
I see a problem. The timer value will wrap from (2^32)-1 to 0, so there might be a problem during comparison.
Even though it is very seldom, I can not accept that.
How can I improve it?
10-13-2009 07:15 AM
How is this?
Better?
Johannes
LabVIEW 7.1
10-19-2009 04:54 AM
Yeah, this is definitely a more correct approach.
P.S.:- PFA the missed-out attachment.
10-21-2009 03:27 AM
Thanks parthabe,
but doesn't this require considerable processor power? Imagine I needed the timing accureate to a millisecond...
Is there no way similar to event structures?