12-07-2012 01:00 AM
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?
Solved! Go to Solution.
12-07-2012 01:17 AM - edited 12-07-2012 01:18 AM
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.
12-07-2012 01:19 AM
Show us the code that wrote this file.
Attach the *.dat file
Attach the VI you are trying to read it.
12-07-2012 01:19 AM
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.
12-07-2012 01:22 AM - edited 12-07-2012 01:23 AM
@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.
12-07-2012 01:26 AM
Here are the Vi,s
12-07-2012 01:28 AM
I used Write Wavform to File and used .dat extension in the name.
12-07-2012 01:35 AM - edited 12-07-2012 01:37 AM
@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)
12-07-2012 01:40 AM
12-07-2012 01:48 AM
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