LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

high scale-density plot

Solved!
Go to solution

Hello, I use the Labview 8.2.1 and I create a diagram in my program.

The plot that is created isn't as accurate as the data of the *.txt file.

The data are in 2 columns, the left corresponds to x-axis and the right to y-axis.

Here is a sample of the data:

0-931
0.2-920
0.4-910
0.6-902
0.8-895
1-892
1.2-888
1.4-884

1.6-882
1.8-882
2-882

 

And here is an abstract of the diagram that corresponds to these data.

22068i23C98D6EED911079

 

As we can see the the y-values 931, 920, 910, 902, 895 that correspond the the x-values 0, 0.2, 0.4, 0.6, 0.8 are plotted to the same x-value 0.

The rest values are plotted in the same way, that is, the y-values that correspond to floating x-values, are not plotted to the corresponding floating x-values but they correspond to the most significant digit of the floating number.

I tried to solve this problem by changing to 1 the Precision Digits in the "Format and Precision" menu of the "Waveform Diagram" but

22070iEE44331CFC400AA1

 

the result is only in the appearance of the x-scale and not in the resolution of the plot.

 

What do I miss?

 

Hope I have been understood.

Waiting for an idea.

Thank you in advance.

 

 

0 Kudos
Message 1 of 12
(3,523 Views)

Post your VI with the data saved in the controls as defaults so we can experiment with it ourselves.

0 Kudos
Message 2 of 12
(3,520 Views)

I post the vi and a txt file that contains the data of the graph.

 

The file "sample_data.txt" must be placed in C:\

 

Thank you for your time.

Download All
0 Kudos
Message 3 of 12
(3,504 Views)
Solution
Accepted by nikosfs

You are reading the data as integers, so you lose all the fractional parts.

 

Go to the diagram and select Double as the datatype for the Read from Spreadsheet File VI.

 

Lynn

0 Kudos
Message 4 of 12
(3,491 Views)

You've selected integer as the data type for the Read From Spreadsheet. Of course you will have the same x value for the different y points. The format and precision will not make up for discarding the decimal data.

 

What is the purpose of all that code? To plot the data, all you need is a single Index Array and a single Bundle function.

0 Kudos
Message 5 of 12
(3,487 Views)

Dennis,

 

The dataset has two distinct groups of Y values, with the split occurring at index 163-164 in the array.  If you plot the whole thing on one graph, much of the detail is hard to visualize.  Without knowing the details of his data recording scheme, I cant tell how efficient his code is.

 

Lynn

0 Kudos
Message 6 of 12
(3,479 Views)

Okay. Did not even see the comment on the block diagram. At first glance, seems a pretty ineffecient way to split the y data into 2 separate arrays..

0 Kudos
Message 7 of 12
(3,477 Views)

Thank you for your replies.

It has to be double indeed, I didn't notice it.

Moreover, the decimal data must use the comma "," and not the dot "."

0 Kudos
Message 8 of 12
(3,467 Views)

The color of the wire was a giveaway (and the word 'Integer' below the Read From Spreadsheet). If you are not aware that the wire color changes for different data types, you should check out the LabVIEW 101 tutorial.

0 Kudos
Message 9 of 12
(3,457 Views)

After some days, I transfered the code to another PC and the diagram hasn't the same behavior.

The Labview in the first PC uses double numbers with commas "," and the second PC uses the dot "."

How can I check it and change it programmatically?

 

 

0 Kudos
Message 10 of 12
(3,382 Views)