pallen Posted September 6, 2005 Report Share Posted September 6, 2005 This is probably an easy one. But I'm not sure if I'm missing something. One of the tools our company purchased recently was the State Diagram Toolkit. For the type of programing we've been doing, this a nice, simple tool that I've found very useful. On most of my applications, I end up adding a "Wait" or "Wait Until Next Multiple" in my main loop. Usually just 10ms or so. I'm doing this with the intention of freeing up a little CPU time when operations aren't time critical. But being fairly new to the whole LabView environment, I'm concerned I may be committing a faux pas or be guilty of employing bad technique. (No point in developing bad habits if I can avoid it) There are some "States" in my current project where I'd like the code to process as quickly as possible. (Re-sizing and saving images) But I notice poor front panel performance (lagging mouse and keyboard etc.) when there is no "Wait" function in my main loop. My question is; Am I asking for trouble by doing this? Is there a better way? Thanks. Quote Link to comment
tetrarch Posted September 6, 2005 Report Share Posted September 6, 2005 This is probably an easy one. But I'm not sure if I'm missing something. One of the tools our company purchased recently was the State Diagram Toolkit. For the type of programing we've been doing, this a nice, simple tool that I've found very useful. On most of my applications, I end up adding a "Wait" or "Wait Until Next Multiple" in my main loop. Usually just 10ms or so. I'm doing this with the intention of freeing up a little CPU time when operations aren't time critical. But being fairly new to the whole LabView environment, I'm concerned I may be committing a faux pas or be guilty of employing bad technique. (No point in developing bad habits if I can avoid it) There are some "States" in my current project where I'd like the code to process as quickly as possible. (Re-sizing and saving images) But I notice poor front panel performance (lagging mouse and keyboard etc.) when there is no "Wait" function in my main loop. My question is; Am I asking for trouble by doing this? Is there a better way? Thanks. 6009[/snapback] The wait function will normally happen in parallel with the rest of the code, so if you have something that takes more than the 10ms, there won't be a problem, and if it takes less than 10ms, it'll free up some time for the rest of the system to do its thing. Putting a wait in the main loop is generally a good idea. Quote Link to comment
Mark Balla Posted September 6, 2005 Report Share Posted September 6, 2005 There are some "States" in my current project where I'd like the code to process as quickly as possible. (Re-sizing and saving images) But I notice poor front panel performance (lagging mouse and keyboard etc.) when there is no "Wait" function in my main loop. My question is; Am I asking for trouble by doing this? Is there a better way? Thanks. 6009[/snapback] One of the things I do when I want certain cases to run as fast as possible is put the input to the Wait primitive inside a case structure and send a 0 to the input base on the incoming state. Quote Link to comment
Michael Aivaliotis Posted September 7, 2005 Report Share Posted September 7, 2005 There are some "States" in my current project where I'd like the code to process as quickly as possible. (Re-sizing and saving images) But I notice poor front panel performance (lagging mouse and keyboard etc.) when there is no "Wait" function in my main loop.My question is; Am I asking for trouble by doing this? Is there a better way? Thanks. 6009[/snapback] My customer's look at me strange when I tell them: "I improved the performance of the software by adding a delay". This technique is perfectly fine. 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.