dimes1827 Posted October 26, 2005 Report Share Posted October 26, 2005 Just want to add question regarding wait functions.. what's the similar structure of DoEvents of the VB in Labview?? Quote Link to comment
atreding Posted October 26, 2005 Report Share Posted October 26, 2005 I assume you are looking for a way to "release" the processor during a loop to allow other processes to run - correct? If so, the standard solution recommended is to wire a wait(ms) vi with zero for its input and place it inside the loop. Each time through the loop the wait will release the processor to other tasks if there are any waiting. Quote Link to comment
dimes1827 Posted October 27, 2005 Author Report Share Posted October 27, 2005 I assume you are looking for a way to "release" the processor during a loop to allow other processes to run - correct? If so, the standard solution recommended is to wire a wait(ms) vi with zero for its input and place it inside the loop. Each time through the loop the wait will release the processor to other tasks if there are any waiting. yes, like allotting some CPU thread to another possible interrupts, or process.. that's awesome..thanks a lot! i think it's a WAIT FOR FRONT PANEL ACTIVITY.VI?? not a wait.vi?? because it has an error if no input value is wired to the WAIT.VI.. but in the WAIT FOR FRONT PANEL ACTIVITY.VI it got a wait indefinitely ( when it is not wired).. Quote Link to comment
Yair Posted October 27, 2005 Report Share Posted October 27, 2005 yes, like allotting some CPU thread to another possible interrupts, or process.. that's awesome..thanks a lot! i think it's a WAIT FOR FRONT PANEL ACTIVITY.VI?? not a wait.vi?? because it has an error if no input value is wired to the WAIT.VI.. but in the WAIT FOR FRONT PANEL ACTIVITY.VI it got a wait indefinitely ( when it is not wired).. Yes, there is an error, because you have to tell the function how much time to wait. If you have a loop with no wait function, LV will try to run that loop as fast it can, and it will take all the CPU time it can get. If you put a wait function (you have to tell it how long to wait), then the loop code will execute very fast and the wait function will wait until the time you told to wait has elapsed, allowing the CPU to do other things. Only when the wait function is done, the loop can proceed to the next iteration. Wait for FP activity waits until you do something on the FP, and if you don't wire anything into it, it has an infinite timeout - meaning it will wait until you do something. In any case, you should not use it, because it has been superceded - if you want to have a loop which is controlled only by the user interface, you should use an event structure. Try reading the help for these functions to see exactly what each one does. You should also try reading more on data flow programming - have a look at the LV FAQ part of this site. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.