LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I plot an array of waveforms?

Solved!
Go to solution

The computer on which I am building my VI doesn't have access to the internet, so I can't post any of my code (so I'll use as much detail as possible)

I am taking DAQ measurements for four devices that come in as (I believe) an array of dynamic data type. I split the signal and I have each channel outputting its own dynamic data type. After a user-specified time interval, a timed while loop will trigger the DAQ to take a measurement and write the data to a file and plot the data. The file writing was easy, but I am stuck on the plotting aspect. 

What I have: Since efficiency won't be an issue (~15 minute average time delay), I have created a shift register of dynamic data type. Each iteration of the while loop, I append the newly acquired data to an array of dynamic data using the BuildArray function. I need to be able to take this and plot it in a graph, but every time I try it tells me that the dimensions of the source and sink don't match. Also, I need to do this for each of the four sets of data (and put them on the same plot). 

 

What can I do to get plottable data from my shift register?

I cannot open .VI files, so I would really appreciate it if I could get responses in pictures of block diagrams or text. Thanks.

0 Kudos
Message 1 of 6
(2,878 Views)

Sorry, I wrote waveforms in the title because I was originally converting my dynamic data type to waveform before trying to plot.

0 Kudos
Message 2 of 6
(2,876 Views)
Solution
Accepted by topic author nc61

Hi nc61,

 

stay away from DDT (dynamic datatype) and you will be fine. Especially when trying to collect data by building up arrays of DDT (which probably isn't doing what you really want)...

 

- Use DAQmxRead to get either arrays of data or waveform(s). Use BuildArray for simple data or waveform functions for waveforms to collect data in shift register. Plotting will be easy with those data!

- There's the well-known example finder in LabVIEW's help menu. Try it...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(2,872 Views)

Where is the DAQmxRead function? Right now I am just using a DAQ assistant to output the data.

0 Kudos
Message 4 of 6
(2,865 Views)

Nevermind, I found it. So this will just read the ouput only and I will have to add my own time stamps? Is that the only difference?

0 Kudos
Message 5 of 6
(2,863 Views)

Hi nc,

 

when you read waveforms you don't need to add timestamps later on.

 

See the example finder for example VIs for all kind of DAQmx tasks...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(2,858 Views)