LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple channels on DAQ

I know this question has been asked before but i am having a hard time implementing what im trying to do.



For my project I am attaching 4 sensors (2 LVDTS and 2 Load cells) to a analog/digital converter which in turn is connect to a NI pci-6024e daq card.

I was able to attach a signal to channel 0 of the a\d card and obtain a voltage in labview. However I have no idea how to have a second channel open at the same time to take measurements of that channel.

I have read many posts and looked at many tutorials but i am very new with labview so am having a hard time comprehending some of the material.

Also, I was wondering if anyone would know how to do the follow:

I am taking in voltages from 4 sensors. One of the sensors is a LVDT. If I calibrate the sensor and get a calibration curve, is there anyway to attach the formula for the calibration curve to a graph or waveform and if there is how do you do it?

An LVDT measures displacement so the graph would have distance on the Y axis and Time on the X-axis. Therefore when I calibrate the LVDT, I would have voltages on the y-axis and distance on the x-axis. Once I get a voltage to distance ratio\equation, how do I apply this to a graph so that I can graph continous voltages coming from a channel onto a distance vs time graph

Thanks in advance.

Jee
0 Kudos
Message 1 of 7
(4,741 Views)
I can help you get up and running.
I have attached a VI that may make things easier.
Please keep responding if you have further questions.

Steps and procedures:
1.Create a channel list (typically formed in an array)
2. send the channel list into the Analog input configuration. (chose a buffer size and device number...you can find this all in MAX)
3. read the data in the while loop.

Things to remember:
Don't over flow the buffer. This means you must manage the buffersize versus the scan rate.
Don't stick to my code 100 percent. Try to understand what chicken scratch I threw together for ya and build from it.
Create small steps and test during analyzing your code.

Best of Luck

X
Chances are if you have seen VI in the forest it hasn't fallen.
0 Kudos
Message 2 of 7
(4,701 Views)
wow X thank you very much...I'm going to try this out..

I have Another question for you that maybe u can answer.

I am taking 4 inputs into an analog digital converter. They are 4 sensors, 2 lvdts (1 is measuring a linear distance and the other one is taking a rotational distance. The other two sensors are a load cell and a torque cell.

The analog to digital converter is attached to a PCi-6024e daq card from national instruments.

What I am wanting to do is somehow take these signals and input them into a graph.

For example, for the LVDT, I potentially want to output the sensor data to a graph that will read distance (y axis) vs time (x-axis). Is there a way to do this directly?

The only way I know of doing this is to first calibrate my sensor. FOr example, for the LVDT I would have to get a voltage vs distance relationship or a calibration curve.

From this I should be able to generate an equation. This is where i get stuck. Is there a way to input a calibraiton curve or equation into a graph so that I can graph a sensor to what it is measuring?

For example, for the LVDT, once i get the calibration equation or voltage to distance relationship, Can I automatically input this into a graph so I can measure distance vs TIme?

Thanks in advance

G
0 Kudos
Message 3 of 7
(4,691 Views)
hey again

I was trying to use your VI and just had a question

I obviously have to drop a DAQ assist somewhere onto the block diagram. What do i wire th data output from the DAQ assist to? DO i wire it to the channel list box? Not to sure

Let me know

g
0 Kudos
Message 4 of 7
(4,688 Views)
Nah, you wanna stay away from that thing hahaha.
Here's what to do.
1.) configure DAQ
Open the VI
Click Tools --> Measurement and Automation Explorer.
Configure and Analog input. (this is where you assign it to a channel and configure the channel settings...)

2.) Get the channel into the VI
On the block diagram in the For Loop you will see an Array for the channel I/O names.
You need to drag/drop a channel constant in there.
Here is the pathing:
Functions --> NI Measurements --> DAQmx Data Acqusition --> DAQmx Global constants
you will place as many in there as needed...(i think you have 4 channels...so you will put 4 in there and change all the channel names 1,2,3,4)

3.) On the front panel you must configure the list box.
The list box will let you select which channels you wish to run (that way you don't have to run all 4 all the time)
Just click in the listbox and retitle the names to correlate with the channel names

That should fix you up:)

Let me know if you get stuck
Chances are if you have seen VI in the forest it hasn't fallen.
0 Kudos
Message 5 of 7
(4,681 Views)
hey X thanks again man, youve been a great help.

I do have some questions again, hopefully im not getting to annoying.

You wrote for configuring the following:

1.) configure DAQ
Open the VI
Click Tools --> Measurement and Automation Explorer.
Configure and Analog input. (this is where you assign it to a channel and configure the channel settings...)

Im not to sure what u mean by configure and analog input. I opened up MAX and went through the devices but couldnt find anything that would let me configure anything or set up an analog input? How do I do this? Would you mind giving me a little more detail for this part? I right clicked the card I was using (which is the PCI-6024e DAQ card) which was under the devices and interfaces tab. Where exatcly do I go to assign channels and configure channel settings?

For the next part you wrote:

2.) Get the channel into the VI
On the block diagram in the For Loop you will see an Array for the channel I/O names.
You need to drag/drop a channel constant in there.
Here is the pathing:
Functions --> NI Measurements --> DAQmx Data Acqusition --> DAQmx Global constants
you will place as many in there as needed...(i think you have 4 channels...so you will put 4 in there and change all the channel names 1,2,3,4)


I see the array but I am not sure how to exactly drop a channel constant into it. I found the DAQmx Global constants but i am not sure where exactly do I place the constant in the purple array box (the purple box is the array right? this is where im dropping the constans right?). DO i drop 4 constants anywhere into the box? Do I place each constant on a separate line? and do i place the constants beside the "i/o"? What i initially tried was to place them on separate lines of the array beside the little "i/o" symbol but it didnt seem to do anything.

The third part u wrote seemed to be ok but I was hoping if u could add in some intermediate steps for me if it would be possible. I'm very new to this as u can tell and I have been spinning my wheels for a while so whatever you could do would be great and you have already been a great help man.

Anyways, thanks in advance and thanks for the speedy responses

Jee









Nah, you wanna stay away from that thing hahaha.
Here's what to do.
1.) configure DAQ
Open the VI
Click Tools --> Measurement and Automation Explorer.
Configure and Analog input. (this is where you assign it to a channel and configure the channel settings...)

2.) Get the channel into the VI
On the block diagram in the For Loop you will see an Array for the channel I/O names.
You need to drag/drop a channel constant in there.
Here is the pathing:
Functions --> NI Measurements --> DAQmx Data Acqusition --> DAQmx Global constants
you will place as many in there as needed...(i think you have 4 channels...so you will put 4 in there and change all the channel names 1,2,3,4)

3.) On the front panel you must configure the list box.
The list box will let you select which channels you wish to run (that way you don't have to run all 4 all the time)
Just click in the listbox and retitle the names to correlate with the channel names

That should fix you up

Let me know if you get stuck

Chances are if you have seen VI in the forest it hasn't fallen.
0 Kudos
Message 6 of 7
(4,668 Views)
I am not sure what your program is like, but I have attached an altered example program. If you go to Help -> Find Examples while in Labview, you can find many example programs that are very helpful. I went to the Search tab and then typed in Analog in the keywords section then clicked on analog. Then I typed in Input after Analog and clicked on input. After doing this you will see many example programs. I double clicked on the example program called "Cont Acq&Graph Voltage-Int Clk.vi" and then altered it a little to be able to have 4 graphs with 4 different inputs as can be seen on the graphs on the front panel screenshot. I put 4 "Index Waveform Array.VI" to get the 4 analog input readings from ai0, ai1, ai2, and ai3 off of Device 1 (dev1). To do this, you can delete the graph given in the example program, and place 4 graphs on the front panel. Make the Physical Channel appropriate to your device. Remember that this program uses the DAQmx driver and VI's. If you are using the Traditional DAQ driver, you will have to use the Traditional VI's and example programs (Traditional example programs have a large green card next to them in the example finder). To answer your question about is there anyway to attach the formula for the calibration curve to a graph or waveform and if there is how do you do it, I would suggest having two arrays, one being the calibration values and the other being the actual values, and putting them into a graph. It will get a little harder if you want to have the calibration curve on the graph while the real values are being collected, but that is also possible (just a little harder if you aren't familiar to Labview).

To answer your last question about the distance vs time graph, you can collect the data, as either an array, or as a waveform. If you collect it as an array, you can just get the two columns of data from the other two data collections and then create your graph using the new array of distance data and time data. Or if you collect it as a waveform, you can get the parts of the waveform from the two measurements, use the "Get Waveform Components.VI" and the "Build Waveform.VI" to create your distance versus time graph.

You mentioned that you are really new to LabVIEW. I would suggest a couple of things. First, if there is anyone you know on your campus that is familiar with LabVIEW, see if they would be willing to help you out. Another way to get familiar with LabVIEW is to use the Context Help (Ctrl-H). This Help is useful when trying to figure out what certain VI's do. The last resource I can suggest is an online tutorial. You can find this helpful resource at http://www.ni.com/academic/lv_training/how_learn_lv.htm. Let me know if you have any further questions or if this does not resolve your issue. Thanks again and have a great day!
Message 7 of 7
(4,660 Views)