Tags: channels, daq, implementing, labview, ltbrgtltbrgtltbrgtltbrgtfor, multiple, programming, time

multiple channels on DAQ

On Programmer » LabVIEW

11,884 words with 4 Comments; publish: Wed, 30 Apr 2008 10:51:00 GMT; (20078.13, « »)

I know this question has been asked before but i am having a hard time impl=

ementing what im trying to do.<br><br><br><br>For my project I am attaching=

4 sensors (2 LVDTS and 2 Load cells) to a analog/digital converter which i=

n turn is connect to a NI pci-6024e daq card.<br><br>I was able to attach a=

signal to channel 0 of the a\d card and obtain a voltage in labview. Howe=

ver I have no idea how to have a second channel open at the same time to ta=

ke measurements of that channel.<br><br>I have read many posts and looked a=

t many tutorials but i am very new with labview so am having a hard time co=

mprehending some of the material. <br><br>Also, I was wondering if anyone w=

ould know how to do the follow:<br><br>I am taking in voltages from 4 senso=

rs. One of the sensors is a LVDT. If I calibrate the sensor and get a cali=

bration curve, is there anyway to attach the formula for the calibration cu=

rve to a graph or waveform and if there is how do you do it?<br><br>An LVD=

T 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 volt=

ages on the y-axis and distance on the x-axis. Once I get a voltage to dis=

tance ratio\equation, how do I apply this to a graph so that I can graph co=

ntinous voltages coming from a channel onto a distance vs time graph<br><br=

>Thanks in advance.<br><br>Jee

All Comments

Leave a comment...

  • 4 Comments
    • wow X thank you very much...I'm going to try this out..<br><br>I have Anoth=

      er question for you that maybe u can answer.<br><br>I am taking 4 inputs in=

      to 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.<br><br>The analog to d=

      igital converter is attached to a PCi-6024e daq card from national instrume=

      nts.<br><br>What I am wanting to do is somehow take these signals and input=

      them into a graph.<br><br>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? <br><br>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 cur=

      ve.<br><br>From this I should be able to generate an equation. This is whe=

      re i get stuck. Is there a way to input a calibraiton curve or equation in=

      to a graph so that I can graph a sensor to what it is measuring?<br><br>For=

      example, for the LVDT, once i get the calibration equation or voltage to d=

      istance relationship, Can I automatically input this into a graph so I can =

      measure distance vs TIme?<br><br>Thanks in advance<br><br>G

      #1; Wed, 30 Apr 2008 10:52:00 GMT
    • Nah, you wanna stay away from that thing hahaha. <br>Here's what to do.<br=

      >1.) configure DAQ <br>Open the VI<br>Click Tools --> Measurement and Autom=

      ation Explorer.<br>Configure and Analog input. (this is where you assign it=

      to a channel and configure the channel settings...)<br><br>2.) Get the cha=

      nnel into the VI<br>On the block diagram in the For Loop you will see an Ar=

      ray for the channel I/O names.<br>You need to drag/drop a channel constant =

      in there.<br>Here is the pathing:<br>Functions --> NI Measurements --> DAQm=

      x Data Acqusition --> DAQmx Global constants<br>you will place as many in t=

      here 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)<br><br>3.) On the front panel you=

      must configure the list box.<br>The list box will let you select which cha=

      nnels you wish to run (that way you don't have to run all 4 all the time)<b=

      r>Just click in the listbox and retitle the names to correlate with the cha=

      nnel names<br><br>That should fix you up:)<br><br>Let me know if you get st=

      uck

      #2; Wed, 30 Apr 2008 10:53:00 GMT
    • hey X thanks again man, youve been a great help.<br><br>I do have some ques=

      tions again, hopefully im not getting to annoying.<br><br>You wrote for con=

      figuring the following:<br><br>1.) configure DAQ <br>Open the VI<br>Click T=

      ools --> Measurement and Automation Explorer.<br>Configure and Analog input=

      (this is where you assign it to a channel and configure the channel setti=

      ngs...)<br><br>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 cli=

      cked 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?<br><br>For the next part you wrote:<br><br>=

      2.) Get the channel into the VI<br>On the block diagram in the For Loop you=

      will see an Array for the channel I/O names.<br>You need to drag/drop a ch=

      annel constant in there.<br>Here is the pathing:<br>Functions --> NI Measur=

      ements --> DAQmx Data Acqusition --> DAQmx Global constants<br>you will pla=

      ce 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)<br><br><br>I see t=

      he 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 pl=

      ace 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 any=

      where into the box? Do I place each constant on a separate line? and do i p=

      lace the constants beside the "i/o"? What i initially tried was to place th=

      em on separate lines of the array beside the little "i/o" symbol but it did=

      nt seem to do anything. <br><br>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 b=

      e 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 al=

      ready been a great help man.<br><br>Anyways, thanks in advance and thanks f=

      or the speedy responses<br><br>Jee<br><br><br><br><br><br><br><br><br><br>N=

      ah, you wanna stay away from that thing hahaha. <br>Here's what to do.<br>1=

      ) configure DAQ <br>Open the VI<br>Click Tools --> Measurement and Automat=

      ion Explorer.<br>Configure and Analog input. (this is where you assign it t=

      o a channel and configure the channel settings...)<br><br>2.) Get the chann=

      el into the VI<br>On the block diagram in the For Loop you will see an Arra=

      y for the channel I/O names.<br>You need to drag/drop a channel constant in=

      there.<br>Here is the pathing:<br>Functions --> NI Measurements --> DAQmx =

      Data Acqusition --> DAQmx Global constants<br>you will place as many in the=

      re as needed...(i think you have 4 channels...so you will put 4 in there an=

      d change all the channel names 1,2,3,4)<br><br>3.) On the front panel you m=

      ust configure the list box.<br>The list box will let you select which chann=

      els you wish to run (that way you don't have to run all 4 all the time)<br>=

      Just click in the listbox and retitle the names to correlate with the chann=

      el names<br><br>That should fix you up<br><br>Let me know if you get stuck =

      <br><br>Chances are if you have seen VI in the forest it hasn't fallen.

      #3; Wed, 30 Apr 2008 10:54:00 GMT
    • I am not sure what your program is like, but I have attached an altered exa=

      mple 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. Th=

      en 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 ca=

      lled "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 th=

      e 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 p=

      lace 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 Traditio=

      nal VI's and example programs (Traditional example programs have a large gr=

      een 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 a=

      rrays, one being the calibration values and the other being the actual valu=

      es, 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 fa=

      miliar to Labview).<br><br>To answer your last question about the distance =

      vs time graph, you can collect the data, as either an array, or as a wavefo=

      rm. 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 n=

      ew 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 dis=

      tance versus time graph. <br><br>You mentioned that you are really new to L=

      abVIEW. I would suggest a couple of things. First, if there is anyone you k=

      now on your campus that is familiar with LabVIEW, see if they would be will=

      ing 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/h=

      ow_learn_lv.htm. Let me know if you have any further questions or if this d=

      oes not resolve your issue. Thanks again and have a great day!

      Ex with 4 Cont Acq&Graph Voltage-Int Clk.vi:

      http://forums.ni.com/attachments/ni/170/98445/1/Ex with 4 Cont Acq&Graph Vo=

      ltage-Int Clk.vi

      #4; Wed, 30 Apr 2008 10:55:00 GMT