04-03-2013 12:46 PM
Hello 🙂
I'm trying to get several boolean inputs (formed to an array) to my DAQ Assistant, where there is 1 digital output. (see attached software file)
Physically I want a valve to open and close in a certain pattern, where the user can setup/control this pattern before the program starts.
I'm thinking that the easiest way to do this is to have several booleans that the user can press or unpress.
Before I started this I tried with only 1 bolean where it worked perfectly.
As seen on the attachment (error) it is possible an easy problem to fix, but I just can't figure it out, i'm stuck at my already made solution.
I'm using USB6008.
I hope there is a gentle soul who can help me out.
Best regards
Kenneth G. Vejen
Solved! Go to Solution.
04-04-2013 04:17 AM
Hi Kenneth.
When outputting to DO the generation mode is set to "1 sample", meaning that each time you call the DAQ Assistant you will only generate 1 sample. In order to generate 5 samples, you therefore need to call it 5 times.
I have attached a modified version of your VI, that shows one way of archiving this. However, be aware that the samples will be generated fast and not at the 100 ms rate your while loop is executing at. It depends on your application, if this is the way you want the samples to be outputted.
04-04-2013 04:55 AM
Hi Alex.
Thanks for answering.
That actually makes a lot of sense and I should have seen that before.
Actually we could convert the talk to danish (from denmark to), but let us keep this way.
What I want is for a valve to turn on/off in a specific pattern which the user chooses, let's say with a 100ms delay of each boolean. on, off, off, on, on just as an example. If it helps, the purpose is to build a water display.
I have tried your example but without success. But I can see that I somehow I need a loop telling the DAQ to change its output every 100ms, depending og the user.
04-04-2013 05:54 AM
Hi Kenneth.
If you want 100 ms between every sample, then a simple modification is to add a "Wait (ms)" inside the for-loop as well. This will make the for-loop output 1 sample every 100 ms, and the While loop to execute every (5*100 ms + 100 ms) 600 ms.
04-04-2013 07:28 AM
Of course.
I think the new way of programming graphically confuses me, but thanks for helping me out.
I will look into the matter and see if I can solve it myself from here.
If I have no success I will return to this post.
Thanks again Alex.
Kind regards
Kenneth.
04-04-2013 07:31 AM
You are welcome 🙂
I just want to show you one last thing, though. We have a great document about how to use DAQmx in LabVIEW. You can find it here:
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
http://www.ni.com/white-paper/2835/en
04-04-2013 07:34 AM
Seems like a great link for a tutorial of DAQmx, thank you 🙂
This will probably help me in the near future.
Best regards
Kenneth