LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to binary binary file

Hello

I'm trying to write the received waveform to a binary file but when I plot the binary file I get a wrong signal. Please help

I attached the my VI and a picture of the wrong waveform

thank you

 

Download All
0 Kudos
Message 1 of 7
(3,909 Views)
It's not only how you write it, but also how you read it later. How do you read the file?
 
Still your code makes very little sense and I recommend that you start with some tutorials or look at some shipping examples.
 
Whatever you have attached is a wild mix of datatypes, (strings, variants, U32 arrays, digital wavefoms, dynamic data, waveforms) and a hair rising wiring pattern. It is difficult to see any purpose in it all. Why do you convert the U32 array to a waveform via dynamic data before writing it to the file???. Can you eliminate the serial parts and add some typical data as diagram constants so we can see what you actually have and test the program?
0 Kudos
Message 2 of 7
(3,896 Views)

Your different conversions are complex and some of your code just doesn't do anything (i.e. all of that stuff with the feedback loop in the read section. If you just want to write the binary data that you receive, you just have to do what is shown below.

p.s. Before posting again, you might want to clean up your diagram. It's hard to see what is going on with wires going every different direction.



Message Edited by Dennis Knutson on 06-19-2008 10:24 AM
0 Kudos
Message 3 of 7
(3,894 Views)
     thank you for your replies I arranged the program and removed the feedbacks as for what I want to do is to save the sine wave or the signal received via serial port in a binary file to plot it later using binary read my problem is when I try to plot the saved binary file I don't get the same sine wave. The program I use for reading the binary file is the one in the examples.


I attached the new VI

0 Kudos
Message 4 of 7
(3,862 Views)
Are you using the Read Binary File.vi example as shown below?  Have you made any changes to it?  It uses a constant of DBL data type for reading the file.  You will want to make sure that constant is a U32 representation to match the data you are writing to that file.  You will also want to make sure the Data Size constant is a 4 instead of 8 since it is a U32.



Message Edited by Ravens Fan on 06-19-2008 04:06 PM
0 Kudos
Message 5 of 7
(3,858 Views)
thank you Raven Fan


I made your changes to the read binary vi and it worked
0 Kudos
Message 6 of 7
(3,845 Views)

Hello!

 

I am a chilean person and my english is not so good.  The reason because your plot is the header that the binary file have.  Before you plot, you must yo try get out the binary file header.

0 Kudos
Message 7 of 7
(3,516 Views)