04-14-2009 02:14 PM
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,
Solved! Go to Solution.
04-14-2009 02:21 PM - edited 04-14-2009 02:21 PM
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.
04-14-2009 02:21 PM
04-14-2009 02:28 PM
Sorry but I haven't seen any attachment button.
04-14-2009 02:33 PM - edited 04-14-2009 02:37 PM
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.
04-14-2009 02:35 PM - edited 04-14-2009 02:36 PM
Haroldo-Itap-Br wrote:Sorry but I haven't seen any attachment button.
So even without seeing an attachment button, you still managed to a attach a file.
04-14-2009 02:57 PM
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'.
Anyway, bellow you find code and files.
04-14-2009 03:19 PM
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.)
04-15-2009 06:37 AM
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.
04-15-2009 07:56 AM
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