02-18-2010 04:32 PM
My user needs the ability to create and control (on/off) a set of (constant) digital oputputs.
I've come up with the attached VI, but I'm certain there has to be an easier way of doing it. My only method of creating a constant output is to use a square wave with a 100% duty cycle.
I like to do things right, and I know the solution is out there, though a search of the forums revealed nothing of use.
Any help would be much appreciated.
02-18-2010 04:43 PM
Yes, that is massive overkill. To put out a constant, all you have to do is use the DAQmx Write set to Single Channel>Single Sample>Boolean. You wire your control directly into the data input.
And either place a small Wait inside the loop so you don't starve the cpu or even better, use an event structure. A value change event for each control would work much better.
02-18-2010 05:43 PM
Thanks Dennis! I'm able to get the DAQmx Write to work.
I think I theoretically understand what you mean by event structure though I've never used it before. I've gone through the help section and now I'm even more confused. Would I need 4 separate event loops? or just 4 separate cases? or otherwise?
02-18-2010 06:50 PM