Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple input to DAQ Assistant

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 7
(4,004 Views)
Solution
Accepted by kennethgv

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.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 2 of 7
(3,970 Views)

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.

 

 

0 Kudos
Message 3 of 7
(3,967 Views)

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.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 4 of 7
(3,961 Views)

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.

0 Kudos
Message 5 of 7
(3,957 Views)

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

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 6 of 7
(3,954 Views)

Seems like a great link for a tutorial of DAQmx, thank you 🙂

This will probably help me in the near future.

 

Best regards

Kenneth

0 Kudos
Message 7 of 7
(3,952 Views)