06-10-2009 01:46 PM
Hi,
I built a Binary File writer vi and a Binary File reader vi but I can't get the file reader to read from the writer file. I get error message each time. I've attached both VIs and I will appreciate any inputs. Thanks
06-10-2009 01:51 PM
What error message do you get? What error number? That kind of information would help.
I see a couple problems with your Binary writer VI.
1. The big one. Why do you wire the array size to the Input of the writer which tells whether it is big endian or little endian?
2. There is an input for prepend array or string size which you did not wire. By default it is true. Try making that False.
06-10-2009 02:51 PM
Ravens Fan
I made the changes you suggested but I still get the same error message. Here is the error message I got when I ran the file reader:
Error 4 occurred at Read from Binary File in Binary File Reader.vi. Possible reason(s):
LabVIEW: End of file encountered.
=========================
NI-488: Invalid argument or arguments to function call.
06-10-2009 03:31 PM
06-10-2009 03:33 PM - edited 06-10-2009 03:34 PM
Hey Mbdeck,
First, Check your operation enum on your open/create/replace file, you are telling it to replace or create the file, eliminating the data that was there before. Try 'open' instead.
Second, you are only writing one item to the binary file, an array. If you use an array constant as the input to the data type on the read from binary file and set the number of data points to '1,' you do not get the error. Your output will become a cluster of arrays, but it displays the same, and you can unbundle if truly necessary.
-Mello
PS looks like I crossed time with Matt above...
06-10-2009 03:36 PM
Beat you be 2 minutes Mellobuck!
🙂
06-10-2009 03:36 PM
Your read VI destroys your data. Wire "Open" to the Open/Create/Replace VI instead of "replace or create". While writing set "prepend array or string size?" to FALSE.
If you set "prepend array or string size?" to TRUE while writing your data you need to read an array at once. In this case wire a real array to "data type" of the Read from Binary File VI.
There is a difference in reading "Number of data Points" times a single real and reading an array of reals with "Number of data points". Sounds stupid? Replace in mind array by cluster than you will see the difference.
Regards
Jörn
06-10-2009 03:39 PM