LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotStripChart with continuous sampling DAQmx and multiple channels

Solved!
Go to solution

I have modified the DAQmx sample code sychAI-AO.cws slightly to offer more output wavforms. I can read simultaneously on one channel no problem. Then when I try two channels I read in an array of N (N>>2, a lot of PlotStripChart examples have N=2 with 2 traces so it updates one point at a time... I don't want that.)  samples. 0 to N/2-1 is what AO1 (output channel 1) writes out, and N/2 to N-1 is what AO2 writes out. Now if I set the number of traces to 2 and try to plot them on a stripchart I get the entire array 0 to N-1 on both traces. 

 

How do I plot an array of say 10000 samples on 2 traces with the array grouped by channel?

 

Thank you

0 Kudos
Message 1 of 5
(4,454 Views)
Solution
Accepted by topic author EricJR

I changed my DAQmxReadF64 to Group by Scan Number instead of by channel and set skipcount = 0 and staringIndex = 0 and that worked exactly the way I wanted it to... but according to documentation it should not work. 

0 Kudos
Message 2 of 5
(4,445 Views)

Why you say it shouldn'work? It seem the exact way it should to me.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 5
(4,415 Views)

You are right RobertoBozzolo. I guess I was initially confused by the documentation of skipcount and startingindex, but I got some clarifcation from an answer on the labwindows forum. Possibly a post by you 🙂 I just don't understand how groupbychannel didn't work. What should skipcount and startingindex be if I have an array of 1000 elements and the first 500 elements are my first trace and the last 500 are my second trace?

 

Thanks again.

0 Kudos
Message 4 of 5
(4,404 Views)

You can't organize your data this way, that's how stripcharts work. You can plot a single point per trace by passing an array with one element per trace. Passing a larger array simply permits to plot more points per trace, but the intreleaved structure is to be respected anyway.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 5
(4,395 Views)