Sergey Kolbunov Posted May 12, 2007 Report Share Posted May 12, 2007 I've wrote a program for Light Controller testing using Producer/Consumer with events design pattern. It monitors the controller digital outputs, I use change detection technique for this. That I don’t like: If DAQmx Read.vi doesn’t detect change it runs forever if timeout is -1 or exit with error if timeout is positive. For my device under test changes happen not too often, so most of time of execution it is waiting for change. I’m using events mostly to stop the upper loop and to handle errors coming from the bottom loop. DAQmx Read.vi sits in a Timeout event and exits every second just to handle other events if changes were not detected. Everything works fine this way, but this solution doesn’t look nice for me. Any thoughts on what else can be used here? Main vi is Light Box.vi Quote Link to comment
Sergey Kolbunov Posted August 2, 2007 Author Report Share Posted August 2, 2007 No answers. Might be I didn't ask my question clear enought. Well, I have found the answer at LAVA! My ugly solution can be improved with Dynamically Registered Events. Creating a Change Detection Event solves the timeout problem. Besides that I've removed unnesessary third loop and did a lot of other improvements so now I really like how it looks like. http://forums.lavag.org/index.php?act=attach&type=post&id=6513 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.