Jump to content

what's the similar structure of DoEvents of the VB in Labview??


Recommended Posts

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.

Link to comment
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)..

Link to comment
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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.