LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Unflatten from String could be used to read waveform data .dat file

Solved!
Go to solution

Hi refer to these two threads

http://forums.ni.com/t5/LabVIEW/Can-labview-read-dat-file/td-p/2243080

http://forums.ni.com/t5/LabVIEW/2-complement-hex-convert/td-p/2245980

 

I tried to read the Dat file by using Unflatten From string and Got this error.

Can anyone tell me How to do it?

Labview user
0 Kudos
Message 1 of 13
(3,336 Views)

As Altenbach commented in the other thread, the data in the file has to have been written as flattened waveform data (LabVIEW waveform) before you can read it and "unflatten" it as waveform. You MUST know the format of the file before you can proceed to do anything meaningful with the data.

0 Kudos
Message 2 of 13
(3,331 Views)

Show us the code that wrote this file.

Attach the *.dat file

Attach the VI you are trying to read it.

0 Kudos
Message 3 of 13
(3,325 Views)

Its a waveform data.

I also tried to save a wavform data from Oscilloscope as .dat extension and read it thorugh this way. Got the same error.

Labview user
0 Kudos
Message 4 of 13
(3,324 Views)

@Aojha wrote:

Its a waveform data.

I also tried to save a wavform data from Oscilloscope as .dat extension and read it thorugh this way. Got the same error.


I don't care what kind of data it is. I need to know how it was written. Giving a file a certain extension does NOT define any data format.

Show us the code how you saved it.

 

 

0 Kudos
Message 5 of 13
(3,322 Views)

Here are the Vi,s

Labview user
Download All
0 Kudos
Message 6 of 13
(3,320 Views)

I used Write Wavform to File and used .dat extension in the name.

Labview user
0 Kudos
Message 7 of 13
(3,319 Views)

@Aojha wrote:

I used Write Wavform to File and used .dat extension in the name.


You are trying to read the waveform file as flattened string. It is NOT a flattened string. You used the Write Waveform File.vi. All you have to do to read it is to use the Read From Waveform File (although you could probably wire the waveform constant to the "data type" of the Read From Binary File.vi and accomplish the same thing).

 

And this has nothing to do with the OPs problem. He is dealing with an unknown file format (unknown to us at least)

0 Kudos
Message 8 of 13
(3,315 Views)

What's wrong with using read waveform from file?

 

0 Kudos
Message 9 of 13
(3,311 Views)

hi I did this created a sine wavform and saved it as dat file.

 

 

 

Now read it with read Binary file.

 

 

But still got error.

Error 116 occurred at Read from Binary File in new thread.vi

 Possible reason(s):

LabVIEW:  Unflatten or byte stream read operation failed due to corrupt, unexpected, or truncated data.

C:\Documents and Settings\AVANISH\Desktop\sin.dat

Labview user
Download All
0 Kudos
Message 10 of 13
(3,309 Views)