LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data being collected does not look as expected? Can someone please help?

Solved!
Go to solution

@GRCK5000 wrote:

I made this change below and still missing data from the x-axis (0 to 999)


That code makes absolutely no sense!

0 Kudos
Message 11 of 22
(760 Views)
Solution
Accepted by topic author GRCK5000

If you need the time column you need to generate that array before the loop (assuming that the number of points is known and fixed. 

You also need a shift register to pass the last time to the next iteration and continuously add the time to the reading , then the saving function will be wired as a 2D array, with True booleans for Append and Transpose (to have it as 2 columns). 

ROtakeCanada_0-1681219328753.png

 

0 Kudos
Message 12 of 22
(736 Views)

@GRCK5000 wrote:

I tried but I'm only getting one column of the data. I'm not missing tank pressure column if only I can get the tank pressure, my problem will be solved. I don't even care much about the headers. 


You need to be more clear. Both columns are labeled "tank pressure" in the excel export (one freq. and one PSI). If you are NOT missing it, so what's the problem?

 

You have a CSV file (NOT an Excel file, even if you later open it with Excel!!!) where you append one row of data with each iteration (i.e. all Y values of the graph, only the PSI column). I assume the frequency column is static across iterations, so you would only need to write that once, right? The information is in the waveform data, where you repurpose the timing information (t0, dt) generically as x0, dx. Nothing wrong with that.

If you right-click the graph and "export to excel", you get generic frequency values because you don't retain the original waveform metadata. This is a real Excel file! Big difference! You seem to use the term excel for both.

 

In order to help you further explain in detail how you want to see the data:

 

A: In the csv file as it grown

B: when you export the graph to excel.

 

So far you just peppered us with a litany of pictures without really telling us what you want or don't want in each. Please be very specific! Thanks

0 Kudos
Message 13 of 22
(728 Views)

I am sorry for the misunderstanding. I meant " I am missing Frequency (Hertz) - tank pressure". Yes, you are right, the frequency column is static across iterations. It shouldn't change.

This below is what I want to get:

GRCK5000_0-1681244468597.png

 Instead I get this below. when I tried to transpose and I only get one column (tank pressure)

 

GRCK5000_1-1681244468601.png

 

 

 

 

0 Kudos
Message 14 of 22
(713 Views)

Also Mr. Altenbach! I meant .CSV file. I use excel file and csv file interchangeably. I shouldn't. Sorry for all the misunderstanding.  I need to start reading carefully my post before posting. 

0 Kudos
Message 15 of 22
(711 Views)

We still don't know what you want.

 

  • Do you want a correctly scaled first column when exporting to excel?
  • Do you want a csv file with two columns as in the excel export, but where each iteration adds a large number of rows?

Both problems are trivial to solve, but we need to know what you want, not what you have.

 

Assuming the frequency column is a linear ramp, you have all the information to create it from scratch (x0, dx, N).

0 Kudos
Message 16 of 22
(698 Views)

Hi Mr. Altenbach,

Your second question is exactly what I want to accomplish. You got it right there. 

 

But in brief, here is what I want to accomplish:

 

I would like to replicate what "export data to excel " invoke node

 

can do using "writing to text fileGRCK5000_2-1681260708120.png " , "tdms write GRCK5000_3-1681260772454.png "  or "write delimited spreadsheeGRCK5000_4-1681260864774.png 

 

To use export data to excel, I did this below:

GRCK5000_5-1681261162974.png

 

 

In other word, if export data to excel" wasn't existing, how would you write your code so that the .csv file looks exactly like what "export data to excel" invoke node can generate?

 

 

GRCK5000_0-1681264268980.png

Now how would you write the code without using "export data to excel" so that the data on .csv file looks exactly the same as what "export data to excel" invoke node can generate?

 

 

 

0 Kudos
Message 17 of 22
(680 Views)

As I said create the x ramp and append both to the csv file in the correct orientation.

 

Your graph export only contains data from one iteration. I assume you want to append data to the csv file forever, right? I assume you want the frequency column to be a sawtooth, starting over with each iteration.

0 Kudos
Message 18 of 22
(663 Views)

Yes, exactly. It sounds like you know exactly what I am trying to achieve. But this screenshot is the one thing I can think of.  Is this what you mean?

GRCK5000_0-1681269967496.png

 

 

I don't know why this is being so hard. I can successfully generate the y-axis data, data on the x-axis is the only thing I am struggling with. 

I will test this when I go to the lab tomorrow. I don't have any equipment with me.

 

 

 

0 Kudos
Message 19 of 22
(655 Views)
Solution
Accepted by topic author GRCK5000

OK, lets' look at this:

 

altenbach_0-1681308006252.png

 

 

You are creating a waveform with no Y values, a start time of zero and a dt=50, then you are using "variant to data" even though a a waveform is NOT a variant! to convert it to a single scalar DBL, then you convert it to a 1d array with one element which you then built into a 2D array with your data, but since it is much shorter (only one element), it will get padded with zeroes to match. There is no reason and logic to any of this! It's like a picture of a fish riding a bicycle! You can't just line up a cacophony of random functions and assume it is correct if the wires are not broken.

 

Here's is one way to create an x ramp from known dx and adding it as first column to the Y data. Y can be any size, of course. (Assuming x0=0, but it would be easy to have that as variable too).

 

altenbach_1-1681308880989.png

 

 

0 Kudos
Message 20 of 22
(632 Views)