LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looping structures/Data Acquisition.

 
Hi,
I have attached the zip files here. 
There are basically 2 zip files. 
The concept carried in the coding is the same except for the loops and iteration blocks.
Under Data Acquisition op:
1. Signal is captured and the waveform corresponding to the data is perfect. 
2. However In the excel sheet I require a format of 20 rows (number of analog channels) and 500 columns (number of samples).
Note that, I am able to record 500 columns, the number of rows is not equal to 20 and depends on my time target. 
Under Data Acquisition Sample: 
1. I used previous sample codes to generate the data. The concept of data acquisition is same. 
    Also, the format of number of channels x number of samples is perfect. 
2. But here, the waveform obtained is not correct. 
 
I guess the problem lies in the looping structures. I am able to achieve either of one in both methods. 
If you could help me in getting anyone of them right, I will be able to move to the next stage of the coding.  
Thanks
Download All
0 Kudos
Message 1 of 4
(2,308 Views)

@sup_1993 wrote:
2. However In the excel sheet I require a format of 20 rows (number of analog channels) and 500 columns (number of samples).
Note that, I am able to record 500 columns, the number of rows is not equal to 20 and depends on my time target.

Normally you want your channels to correspond to the columns.  Then as you append the data, it keeps adding to the channel's waveform data.  So you really want 20 columns and 500xN rows, where N is the number of iterations of this loop you run.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,296 Views)

I have to agree with crossrulz on this one. In over 30 years in the industry I have never been asked to put data in a spreadsheet with the channels in rows and the measurements in columns. That just makes no sense at all.

 

But if you are sure that is what you want, try the Transpose Array function to swap the rows and columns in your array

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(2,236 Views)

Yes, I have already used a transpose function in my code to exchange the rows and columns. 

I require the format (i.e, channels in the rows) as that's how the csv file is read in MATLAB (which is next stage of the project; existing file). 

0 Kudos
Message 4 of 4
(2,230 Views)