04-29-2008 05:20 PM
04-29-2008 05:38 PM
JMJ wrote:
Does it seem reasonable to think this will work? I want the "switch until released" so that I can modify my command string and send it to the servo drive multiple times without having to stop LabVIEW.
04-29-2008 06:09 PM - edited 04-29-2008 06:13 PM
Here's an example area:

As a first alternative, take the shared stuff outside and wire across structures, eliminating the locals and globals.

You actually probably only need one output string, so the following might be sufficient.

04-30-2008 11:09 AM
04-30-2008 12:09 PM
04-30-2008 03:02 PM
Hello again,
I made the changes suggested and added the wait statement.
Could the reasoning behind using the wait statement please be explained? Does this simply give the functions inside the while loop time to operate before a new loop begins?
Thanks, Mark
04-30-2008 03:33 PM
A wait statement will help provide pacing for the loop. In the event your case structures are set for jog and false, nothing will really happen that takes any time and the while loop will run as fast as it possibly again, potentially even starving other windows process from getting processor time. I actually haven't seen this as much of a problem lately, but if it does happen, you will see it as a sluggish system. For example your mouse will be very herky jerky moving across the screen.
The while loop will not begin its next iteration until all nodes inside of it have executed. So that may be a little bit of time for the cases that have some code, and near zero time if the cases have no code in them. Having a wait statement in there guarantees that it will take at least a little bit of time to execute a loop and will allow the processor to handle other tasks. Whether you need 500 milliseconds or not is up to you and something you can experiment with. Even a 0 millisecond wait statement allows the processor to handle other tasks. You probably don't need to spin an empty while loop that fast. I find 100 to 200 milliseconds is still fast enough to appear to be an instantaneous response to a user pressing the front panel buttons.