Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Open valve digitally

I need to write a VI that will send a 5V signal over one of my 8 digital pins and a ground. In turn this will open a valve when the 5V is across these two and close when there is no voltage. I have been learning LabVIEW but haven't really received or found anything that is sufficient on working with the external things.  Can anyone help me out?
0 Kudos
Message 1 of 15
(3,840 Views)

I'm pretty certain that the Getting Started with DAQmx link I provided goes over this but in case you missed it, it's really quite simple. Shown below is code using the DAQmx functions and using the DAQ Assistant. The object between the control and the DAQ Assistant is a Build Array function. Note that these are for controlling a single line. You can also control multiple lines at the same time.

All of the functions are on the Measurement I/O>DAQmx palette. The functions are polymorphic. That means that in order to select the actual function you want, you need to right click and select - Select Type. Or, you click on the arrow of the Plolymorphic VI Selector (the little box below the function. The DAQ Assistant walks you through the creation of a DAQ task.



Message Edited by Dennis Knutson on 08-12-2008 07:48 AM
0 Kudos
Message 2 of 15
(3,835 Views)
I was looking through all those links and I guess I'm not looking in the right place. I have no idea what most of these things do on this picture. It is not at all trivial to me.
0 Kudos
Message 3 of 15
(3,830 Views)

You will need some time (at least a week) to go through the tutorials and all of the lessons before you can start writing any code of your own. The specific tutorial on Digital I/O with the DAQ Assistant can be found at http://zone.ni.com/devzone/cda/tut/p/id/2744#toc5. This covers digital input but digital output is similar.

When you do start writing code, you should always have the context help window open (Help>Show Context Help). As you move your mouse over a function on a palette, you get a brief description. Fully detailed help is also available.

0 Kudos
Message 4 of 15
(3,823 Views)
I went through that page and tried it but I don't understand how to make it work. I just go through the steps then always end up with this box on my screen that says DAQ assistant. I have no idea how to turn it on or what to connect to it to do so.
0 Kudos
Message 5 of 15
(3,820 Views)
With the DAQ Assistant and a digital output task, the data input expects an array of Booleans. This is default behavior and not really all that useful for controlling just a single line. What you should do after configuring the assistant, is go to the front panel and create a Boolean control. Any type of Boolean will do. If you do not know how to create a Boolean control or do not what the front apnel is, you really, really need to spend some time with the LabVIEW basics class.
 
Anyway, after you have the Boolean control, go to the block diagram and from the Array palette, place a Build Array function on the diagram. Wire from the Boolean to the Build Array input and from the Build Array output, wire to the data input of the DAQ Assistant. Go to the front panel and set the Boolean control to what you want. Run the VI. If you have a scope or DMM connected to the DAQ card output, you should see the output change when you change the front panel control and run the VI.
 
You might also want to mention the type of DAQ board you are using if you have any problems.
0 Kudos
Message 6 of 15
(3,808 Views)
Thank you so much, it works. I tried to connect the Boolean to it before but it produced an error as I didn't know there had to be an array between it. Now it is completely successful. Thanks for the time.

M. Sheranko
0 Kudos
Message 7 of 15
(3,783 Views)

Hi Dennis,

 

This case might be applicable to my problem as well.  Do you mind attaching the vi?  I was trying to set it up in LabView but can't link the Channel to the Lines in DAQmx though.

 

thx

wkc

0 Kudos
Message 8 of 15
(3,779 Views)
The code is above. I don't know what you mean by linking the channel to the lines. Why don't you post your code.
0 Kudos
Message 9 of 15
(3,775 Views)
Here is what my code is. It turns on and off 8 individual digital I/O channels. Now I have to make it so I can have them turned on for an inputted amount of time and off for an inputted amount of time. Then I need to put that in a loop.
0 Kudos
Message 10 of 15
(3,760 Views)