Jump to content

Need your advice in design


Recommended Posts

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

Link to comment
  • 2 months later...

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

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
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.