Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create separate graphs for each type of measurement input using the 9219?

Hello,

 

I just bought the USB 9219 module, and am trying to take measurements as follows:  2 thermocouples, and 2 voltage differentials with their own scale each.  I want to be able to have 3 graphs, one for temperature measurements, one for voltage using scale A, and one for voltage using scale B.  I've been trying to modify the example online of "DAQmx task example" and "DAQmx task example_configuration" but this example code puts all the channels onto one graph.  What is the best way to separate the graphical representations?

 

Also, after running this example code I'm seeing the data flash up but when I press "stop" the graph is cleared and I get an error saying that not all the data has been acquired or my sample size should be changed... I need to be able to export these graphs, how do I fix this error?

 

Thank you,

 

Blayne Kercher

0 Kudos
Message 1 of 10
(3,688 Views)

Hello Blayne,

 

Yes this is possible to put the data on different graphs in order to have different scales. Could you post a picture of you block diagram so I can see how you are acquiring the data? I think this will help me as well to understand the error you are getting. Also can you post the error you are getting?


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 10
(3,666 Views)

I suppose I'm not getting the error anymore, but at any rate, this is not the configuration that I want anyways.  Here is the slightly modified example, and in this case I have only one voltage measurement going but in the near future I want to add another.  Separating the graphs is what I want to do.

 

I'm guessing that I need to run the DAQ tasks in parallel instead of in series, is that right?  Or can I just run this VI and add something to separate the graphical output?

Download All
0 Kudos
Message 3 of 10
(3,655 Views)

Ok, new update, I think I found how to separate the data, by indexing the array and outputting to different graphs.  But now I got the error I was getting before, where after I press STOP, the data is erased from view on the front panel and then the error pops up.  I've attached the updated vi's and error picture.  Please help, I'm planning on documenting these graphs tomorrow afternoon.

 

Thanks,

 

Blayne

0 Kudos
Message 4 of 10
(3,651 Views)

Hello Blayne,

 

The error you are seeing in a timeout error because you have request 100 sample per channel which is 50 seconds worth of data. The DAQmx read has a default timeout value of 10 seconds so this is why the error occurs. I would suggest increasing the timeout by placing a constant on the timeout input of the DAQmx or decrease the number of samples per channel.


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 5 of 10
(3,629 Views)

I see the problem, thank you.  I have revised my program, but am running into some problems now in two different areas: 

 

1)  I have 4 measurements set up and although I think I have the right channel specifications and data flow through "data reader", the program seems to misplace the data onto the wrong graphs.  This must have to do with my indexing, and how I'm placing the data into graphical form, but I don't know a better way to do it... help? 

 

2) I'm trying to connect a TEDS capable torque sensor through one of the voltage channels, and I got the TEDS info read and saved to the computer by configuring a channel through the MAX interface, but I want to use LabVIEW to measure torque and the TEDS data to scale the mV signal.  The problem, I believe, arises because I need a 4.5V excitation (external) and the 9219 is not letting me use external excitation when acquiring the signal from DAQmx using "custom voltage with excitation"... how can I use the TEDS data to scale the signal while accounting for an external excitation?

 

Thank you for your help, I'm learning as I go, I'm fairly new to LabVIEW.

 

Blayne

Download All
0 Kudos
Message 6 of 10
(3,601 Views)

For the data reader, go to the block diagram and while moving the mouse over one of the chart indicators, look at your context help window. You are using the chart in a completely wrong way. Move them inside the loop. And if you are trult requesting a single sample, change the DAQmx read to single sample. Your index array function (only use one) will return a scalar for each channel.

0 Kudos
Message 7 of 10
(3,588 Views)

I would agree that I'm probably using it wrong, but I do want the result to be graphs of measurement vs time... not a single point.  I happened to stumble on this configuration and it worked in the sense that it gave me measurement vs. time.  What I thought I was doing by leaving the charts outside the loop was reading a single sample in the loop and then graphing it, and while the previous sample is overwritten by the next sample, the chart holds onto the values as time passes.

0 Kudos
Message 8 of 10
(3,574 Views)

A chart WILL plot voltage versus time. It will plot as data is acquired and keep adding new points - not a single one. That's basic LabVIEW knowledge. With your scheme, nothing will get plotted until the loop finishes and as already noted, plotted completely wrong.

0 Kudos
Message 9 of 10
(3,570 Views)

Ah, I see, yeah that makes sense.  Like I said, I'm learning as I go because I'm under a time constraint, so I really appreciate your help Dennis.  Here's what I switched to, and just from testing briefly, it works like I want it to.  Thanks.

 

Blayne

0 Kudos
Message 10 of 10
(3,564 Views)