LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read simulation data file (*.DAT) using spreadsheet (file reading eror - zeros)

Solved!
Go to solution

Dear NI commuunity,

 

Im pretty new in LabVIEW, so i have some broblems with data reading.

I take a screenshot and mark a problem as Part - A and Part -B below:

DAT_file_read.png

 

The goal description: 

I'm making a mathematical simulation using the old software whitch exporting results as shown in Case1... .DAT file, also it shown in picture (notepad).

Firstly i need no read this data then i need to draw XY graph. 

Problem Description: 

I was created a LabVIEW program and im using a read spreadsheet funciont shown in Part -B but when im trying to read data im getting all zeros...

so i cant identify my problem... what is wrong?

i have try different file to read its Case_test_working.txt and everything is good with this data but when im trying to read *.DAT file the zeros comes to array...

I was tryed to use different seperator symbols, also try to imort data to exel then export to *.scv, *.txt formats, but rezults was the same as shown in Part-A. 

Every time i get zeros but not a results as in *.DAT or other exported format file with same data. 

 

Please be respectifull and understand that im still newbie in labview but i think its great software for data analysis filtering and calculations, so i want master this software for my future usages.

 

With Respect,
Tomas E

 

0 Kudos
Message 1 of 13
(6,067 Views)

The decimal point , rather than a comma , can be solved by using a period .

Then, replace "," to "."

 

Discuss20150514_5.png

0 Kudos
Message 2 of 13
(6,045 Views)

@KONDOH wrote:

The decimal point , rather than a comma , can be solved by using a period .

Then, replace "," to "."


You could also use "%.;%6f" for the format string.  The "%.;" sets the localization decimal to use a period.


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 3 of 13
(6,038 Views)

Dear  KONDOH,

 

 

i was tried to use different decimal point symbol, but result was the same.  You post the picture with block diagram, can you explaint what is the function of this diagram? some of this bloks i newe use and dont know how to find them. I want to try to create similar diagram and try again to read *.DAT file.

 

Thank you for quick responce,

Tomas E.

0 Kudos
Message 4 of 13
(6,031 Views)

Dear 

 

 

0 Kudos
Message 5 of 13
(6,019 Views)

The picture i posted is " VI snippet " .

Drag a VI Snippet PNG image onto the block diagram it will drop the snippet as LabVIEW code. http://www.ni.com/tutorial/9330/en/

0 Kudos
Message 6 of 13
(6,016 Views)

are Two spaces.

Decimal point is piriod.

Format is Scientific Notation.

 

Discuss20150514_7.png

Message 7 of 13
(5,997 Views)

Dear KONDOH,

 

This time is almost perfect, except negative values. this block diagram do not understand negative values and somehow convert it to positive. 

here is a screenshoot of the results shown in part a.  DAT_file_read_3.PNG

 

I try to edit your block diagram to solve this problem but its to difficult with my expierence, so i posted the results with oroginal your diagram. 

Sorry for long respond, i was in conference last weekend. 

 

Thanks for your solution, this time all values are readed except negative.

With Respect,
Tomas E.

 

0 Kudos
Message 8 of 13
(5,952 Views)

Dear tmsworld

 

 Oh! This data file is not a separated string.

 This data file is fixed length string file.

 

FixedLengthTextFile.png


Message 9 of 13
(5,939 Views)

Dear KONDOH,

 

I do not understand why everything works well for you, but for me its still zeros...

Maybe, my computer or LabVIEW settings are different? or something with configuration? 

There is your Block Diagram results:

DAT_file_read_4.PNG

 

I make the assumption that something is wrong with configuration, or my computer do not uderstand some fragments of block diagram...

Do you have any advice for this, or maybe need to take same changes in diagram?

 

Thanks for your patience with me,

With Respect,
Tomas E

 

0 Kudos
Message 10 of 13
(5,932 Views)