LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the easiest way to get time stamped wvm data with AI samp Ch Vi?

The AI sample channel VI only outputs single point waveform data which is making it a beast for me to get my input data into XY graphs. I have been trying to combine the data with a elapsed time clcok so I can synchronize all my inputs but it isnt working too great. All this stuff is in a while loop also, so that gives me trouble. Basically I just want to make an XY graph from both AI inputs.
0 Kudos
Message 1 of 8
(3,224 Views)
Tim - I think I can help, but I have a question or two for you. Do you truly want to synchronize your input channels? If you do, then it will not be possible, as the devices are not synched. If you simply want to plot the data that is read from each device together on one plot, then I have already modified your example code to accomplish this. Also, do you change the loop rate while running? If you do not, you can use the Waveform chart, as it is much easier and keeps track of the elapsed time for you. Sorry about all of the questions, but just want to help. Post the answers and I can post the example code for you.
Message 2 of 8
(3,224 Views)
Hey thanks for the reply.
Yes, I dont want to synchronize the inputs exactly I just want to be able to take the data from each input and but them into a graph that once the experiment has been executed will show how input 1 changed with input 2. I assume that the inputs take in data at the same rate so when I get a temp reading at one input and a voltage reading at the other they correlate with each other in time. I used the charts to look at the inputs individually with a time scale, but I want to combine them into a final xy graph. The loop rate is set. I think I answered your question. Thank you greatly.
Tim
0 Kudos
Message 3 of 8
(3,224 Views)
Tim, no problem. I have attached the modified code that displays the readings from both devices on the same plot. I used a chart instead of an XY graph since it is much easier to use (it keeps track of elapsed time for you if you know the amount of time in between data points - and since the loop time is fixed we do know that). If this time were to change, then we would have to re-create the X-axis (time) and the XY graph would be necessary. One other note - the code that reads the values from the DAQ cards will not execute at exactly the same time, therefore the data will not be acquired at exactly the same time, though it will be close. Therefore, if your application requires these readings to be dead on together in time down to the mi
crosecond for example, then you would have to synch the two devices via hardware. Let me know if you intend to do that and I can steer you in the right direction. Hope this helps.
0 Kudos
Message 4 of 8
(3,224 Views)
Thanks a lot for the help, the whole thing looks a lot cleaner now. I just had one more question. I noticed that you deleted my little ramp rate function. I suppose it was a tad on the ghetto side of things. I was using it to adjust the set point higher according to a certain slope after every loop in hopes that at some point I could ramp the temperature at a constant rate. Do you know of a better way to do this with the type of loop that I have. My next mission is also to get all the data in the charts to accumulate into different xy plots after running an experiment. So I can show how over the course of the experperiment the AI one changed with temp for example. I think to do this I just need a write subvi for each input and then a r
ead and then into the final graph. Is that correct. Any help I could get would be great. I spend days looking at this dumb stuff I know some people could do in 20 minutes. Thanks again!
0 Kudos
Message 5 of 8
(3,224 Views)
Tim,

I wouldnt say the ramp rate function was ghetto, it was just overkill - the 'ADD' function I put in there should do the same thing. If you want to ramp the setpoint by a certain value every loop, then you need a shift register to hold the latest value, and the you need to add the ramprate value to that shift register every time. I added that function in the attached VI. I am still a little unclear on your final goal of displaying the channels. Can you clarify a bit more?
0 Kudos
Message 6 of 8
(3,224 Views)
Well the data we bring in is usually a voltage from a monochromator(ai2) and a temperature from a thermocouple(ai1), then we would graph the voltage as a function of temperature in excel. What I hope to do with labview however is as after ramping the temperature and then stopping the experiment, to have a graph created in labview that shows how the voltage changed as a function of temperature during the entire experiment. The chart is useful to monitor during the experiment but I would like to be able to get a graph of temp vs voltage that can be saved or printed. This would save a lot of time. I am also working on bringing in another input in the future from a massspec, which would also be cool to graph on another axis of
the same graph, but that might be overkill. I dunno. Thanks for being so helpful. I am getting more done in the last few days then I have in weeks.
Tim
0 Kudos
Message 7 of 8
(3,224 Views)
Tim, Thanks for the explanation - I think I was a little slow last night! I completely understand what you need now and have implemented it in the latest version. This will produce a plot with temperature on the x-axis and the voltage on the y-axis. Also, the VI sorts the data so you will see what happened as the temperature increased. Hope this helps. If you ever have to tackle something larger, let me know and maybe my company can help you in a pinch. (www.signalxtech.com). Good luck and let me know if this works out for you.
0 Kudos
Message 8 of 8
(3,224 Views)