LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing Binary data

Hi
 
I am trying to write a binary data file in single precision format. Writing the data is not a problem, but when I read the binary file, the data seems to have one extra zero at the start of the data. the data seems to shift towards right. Labview is introducing a zero point s at the start of the file which is making that shift. How to get rid of that extra point when I am writing the data. I am attaching the program I made to write the binary data file (write binary data) and also the file (file.zip)which I am trying to analyze. Also attaching the program to read the binary file.
 
Thanks,
 
0 Kudos
Message 1 of 9
(3,625 Views)

Works fine for me. I don't get the extra zero when reading the file.

Message Edited by altenbach on 01-19-2006 10:44 AM

0 Kudos
Message 2 of 9
(3,619 Views)
Sorry, I see the problem now.
 
You are talking about the binary file 1.spn.
 
You are writing it as a cluster, but read it as a SGL array. You need to write it as a SGL array to keep the universe in balance. 🙂
 
Here's ther relevant modification:
 

Message Edited by altenbach on 01-19-2006 10:55 AM

Message 3 of 9
(3,613 Views)
Hi,
 
I tried that way, writing it the way u said, but when I am reading it, it gave me some unexpected results. I want the data in SGL format and as the write binary file.vi uses 8 byte little indian format, when reading it thru the Read SGL data vi I am not able to read it properly.
 
thanks
 
Nitin
0 Kudos
Message 4 of 9
(3,594 Views)


@npai wrote:
Hi,
 
I tried that way, writing it the way u said, but when I am reading it, it gave me some unexpected results. I want the data in SGL format and as the write binary file.vi uses 8 byte little indian format, when reading it thru the Read SGL data vi I am not able to read it properly.


Of course data types for write and read should match. The function as in altenbachs picture will write doubles to the file. Just put a "To Single Precision" conversion node right after the log function and everything should be fine.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 9
(3,588 Views)

Hi Rolf,

I tried that and still it is not working. I am attaching the two wave form graphs which I am getting. The first one is the one which I am reading which is one point off and the second is the one which it is supposed to write. There is a just one point difference in the two graphs.

0 Kudos
Message 6 of 9
(3,576 Views)

Hi Rolf,

I tried that and still it is not working. I am attaching the two wave form graphs which I am getting. The first one is the one which I am reading which is one point off and the second is the one which it is supposed to write. There is a just one point difference in the two graphs.

Thanks

Nitin

0 Kudos
Message 7 of 9
(3,577 Views)
OK, I found the problem. You need to wire a FALSE to the "prepend array size" input of the write operation.

Message Edited by altenbach on 01-19-2006 01:55 PM

Message 8 of 9
(3,564 Views)

Thank you very much for that information.

I was trying everything for that, and that was just a small problem and I wouldn't be able to figure that out. Thank you very much

 

Nitin

0 Kudos
Message 9 of 9
(3,548 Views)