LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Plot 16 Signals From a Single 8 Channel 2 Sources Data File?

Solved!
Go to solution

Matrix A is a time + 8 channels from a single assyncronos data source; MSC is a XY Chart. This works fine until now that data records changed to 2 assyncronos sources. Format now is: where the data came from (0,1) + time + 8 channels data.

 

Rgds,

rgds,
Haroldo - Brasil
LV 7.0
0 Kudos
Message 1 of 13
(3,075 Views)

Your description doesn't make much sense to me.  And if you want to post a screenshot, you must first attach an image file to your message.  The image you embedded in your message is located on your hard drive, and for obvious reasons, we don't have access to that.

 

A VI that has some real data saved in the controls as the defaults would be even better to look at.

Message Edited by Ravens Fan on 04-14-2009 03:21 PM
0 Kudos
Message 2 of 13
(3,071 Views)

HiHaroldo,

 

when the file format changes you have to change the reading routine too...

 

If you would give more information we could provide better help!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 13
(3,070 Views)

Sorry but I haven't seen any attachment button.Smiley Sad

 

 

rgds,
Haroldo - Brasil
LV 7.0
0 Kudos
Message 4 of 13
(3,065 Views)

A is not a matrix, but a 2-D array.

 

Please post your VI and a data file so we can try running it.  I am still unclear as to how the image you posted relates to your question.

Message Edited by Ravens Fan on 04-14-2009 03:37 PM
0 Kudos
Message 5 of 13
(3,062 Views)

Haroldo-Itap-Br wrote:

Sorry but I haven't seen any attachment button.Smiley Sad

 

 


So even without seeing an attachment button, you still managed to a attach a file.Smiley Very Happy

Message Edited by Dennis Knutson on 04-14-2009 01:36 PM
0 Kudos
Message 6 of 13
(3,060 Views)

I am from the time where we call 1-D of vector and 2-D of matrix. If you push the 'tree icon' you can add an image, too. Sorry, 'veterans'.Smiley Surprised

 

Anyway, bellow you find code and files.

rgds,
Haroldo - Brasil
LV 7.0
0 Kudos
Message 7 of 13
(3,048 Views)

I can't run your VI because the Read spreadsheet file with headers is missing.  I think it is an ancient VI that NI no longer ships with LV.

 

Looking at your 2 Source file, it looks like you have a new column at the beginning that has a 0 or a 1 and you want to break these out?

 

I think what you will need to do is read in the text file line by line, and depending on whether that first column is a 0 or 1, build the new line of data into 2 different 2-D arrays.  Once you have the 2 different 2-D arrays, then you can use the code similar to what you already have to break it up into X and Y data for graphing.

 

(In LabVIEW, a matrix is a different structure than an array.  It is located in the math palette for linear algebra.  It is of course similar to an array, but is a special structure.)

0 Kudos
Message 8 of 13
(3,023 Views)

Original 8 Channels ed.txt is a file where a line is a record of time followed by 8 data values. They

are TAB separated. Data are sampled assyncronously taking from 130ms to 160ms to get a

record. It is plain text TAB separeted and the first line is the name of the channel so Excel can

plot then (you can have an "idea" how it looks like because is not sync.).

 

We can use Test Read File 8 Channel.vi to plot a file like the one above. It uses XY chart instead

of graph to show data. Read From Spreeadsheet File.vi is set to transpose rows and columns so

 the 2D array (A) living it are split and combined as 1D pairs keeping the fisrt row (now "time") ), or

X, for the XY chart vi.

 

On the new situation we have one more source of data, that also fills the file (2 Source 8 Channel ed.txt) with a record from 65ms

to 90ms. Thus, in fact, the file now have two sets of 8 channels or 16 channels of data.

 

The trouble here is to know if we can keep using a single XY chart to show 2 sets of 8 XY pairs of

different length but 16 channels. We was wondering if it will be necessary to convert then to a

waveform data type first.

 

PS. The data files bellow came from a simulator and the time values are smooth. We edited then

removing header to keep what is relevant to the problem.

rgds,
Haroldo - Brasil
LV 7.0
0 Kudos
Message 9 of 13
(3,005 Views)

Hi Haroldo

 

Like Ravens Fan says, you can use the first column to split the data into two 2D arrays, then build your XY plots from them. Take a look at the attached vi.

 

Ian

0 Kudos
Message 10 of 13
(2,992 Views)