LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous measurement buffer issue

I have a couple of DaqMX reading and writing vi inside 1 loop, 1 reads the output of an encoder, another reads the output of a transducer. The idea is that when the loop performs an iteration, all of the DaqMX operation will be run at ALMOST same instance.

Both 2 tasks' timing are set to 1 sample (on demand). How do i combine these 2 outputs into 1 graph display, for eg: Encoder reading vs Transducer reading vice versa? So that whenever they acquire a new sample it would be updated on the graph?

Can i have both encoder samples all stored into array1 and transducer samples into array2 and when the loop ends combine these 2 into a 2D array and plot it onto a graph? Would this work? (I do not have the hardware with me yet thus i'm unable to try it now)
0 Kudos
Message 1 of 7
(3,288 Views)
Hi,
 
If I understaood you want to plot encoder reading=f(transducer reading) ? if yes you need to use XY graph so you need one Tab for result of encoder reading (Tab[Y]) and one tab for transducer ( Tab[X]) after you group in cluster and send to XY graph.
 
You are reading one point by one point so use retroaction to build each arrays (if you want a update inside loop) or build using indexation at the end of your loop.
 
If you just want to have 2 courbs on same graph just build array by your 2 arrays and you will get 2D array (function build array do not concatenate) and you can plot on Graph
 
Hope it will helps
 
Regards
 
Greg
Greg S.
CNRS
LV 7.1 8.2 8.6 2009 2011 2012 2013 2014
LPMC - CNRS
N'oubliez pas de complimenter cela fait toujours plaisir.
0 Kudos
Message 2 of 7
(3,276 Views)
Yes Greg.

Basically this is what i've done (refer to image). Should work right (sorry i can't test without the hardware)?
0 Kudos
Message 3 of 7
(3,253 Views)

Hello ATMA

from your post, this is what you want:

i have to warn you tough, that the analog read and the counter will not occur at the same time. the reason is data flow: the two read will be performed in parallel, and it is very likely the analog input will be read before the counter, as inherantly the counter waits for a count. the best option out is to force the counter to read first, and only then read analog in.

this can be done by wiring the error signal from the counter read to the analog read.

Message Edited by Gabi1 on 09-19-2007 11:08 AM

Message Edited by Gabi1 on 09-19-2007 11:09 AM

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 4 of 7
(3,245 Views)

of course, modify as needed 🙂

dont forget to wire input to the DAQmx read

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 5 of 7
(3,238 Views)

If you want to test without hardware you can under MAX simulate a card.

Right click on DAQmx -> create new DAQmx ->simulate DAQmx -> choose card

and now you can test VI even without hardware

 

Greg S.
CNRS
LV 7.1 8.2 8.6 2009 2011 2012 2013 2014
LPMC - CNRS
N'oubliez pas de complimenter cela fait toujours plaisir.
0 Kudos
Message 6 of 7
(3,230 Views)
Thanks Gabi and Greg. I'll definitely try the modification!
0 Kudos
Message 7 of 7
(3,204 Views)