Current Position:Home > Issue in reading a binary file, with 'Flatten to String' data.

Issue in reading a binary file, with 'Flatten to String' data.

Update:10-11Source: network consolidation
Advertisement
I'm facing issue while reading a binary file (created using LabVIEW).
I've mentioned everything (issue and method to reproduce it) within the attached VI.
Same vi is attached in 2012 and 8.0 versions.
Regards
I am not allergic to Kudos, in fact I love Kudos.
 Make your LabVIEW experience more CONVENIENT.
Solved!
Go to Solution.
Attachments:
Issue in VI.vi ‏26 KB
Issue in VI (Version 8.0).vi ‏43 KB

The Best Answer

Advertisement
moderator1983 wrote:
crossrulz wrote:
The reading of a string from a binary file stops at a NULL character (0x00).  When the first character is 0x00, you are just reading the one character.  I would suggest writing to a byte array since you are doing the inverting.  And then you can read as a byte array.
crossrulz:
U rocks..!!
you have hit bull's eye...!!
After playing around a little more, I think I might have misinformed you a little.  If you explicitly tell it a string, it looks for the string length at the very beginning and reads that length of bytes as a string.  It appears that if you implicitly tell it to read a string (not wire the data type) it reads all of the bytes directly, including the length of string you wrote.
Regardless, my advice is the same.  You should just write and read using byte array.  It is less conversions if you are performing your "encryption".
EDIT:  Here's a snippet of the VI I was playing with to figure this out.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
String Binary File.png ‏12 KB
  • Issue in reading a binary file, with 'Flatten to String' data. Update:10-11

    I'm facing issue while reading a binary file (created using LabVIEW). I've mentioned everything (issue and method to reproduce it) within the attached VI. Same vi is attached in 2012 and 8.0 versions. Regards I am not allergic to Kudos, in fact I lov

  • Read Binary File - variable binary format Update:11-30

    Hi Everyone, I'm using the "read from binary file" subvi to interpret some data from a file. I have the code running fine if the the temp file is always the same format, however I want the "read from binary file" to adapt to different

  • Read an avi file using "Read from binary file" vi Update:10-11

    My question is how to read an avi file using "Read from binary file" vi . My objective is to create a series of small avi files by using IMAQ AVI write frame with mpeg-4 codec of 2 second long (so 40 frames in each file with 20 fps ) and then se

  • How can I convert Binary File to Normal Text File? Update:10-11

    Hi, I need to read a binary file and need to conevrt as normal text file. The binary file contains some number & String (Names) with fixed length. It is the combination of Char, String, Integer, Byte & Single Bit. I used DataInputStream but I didn

  • Follow/read a growing binary file Update:11-30

    Hello, Application space: 1 - I have an application that has created and opened a binary file, and is is writing data to it on a continual basis. 2 - Using another program written in Labview, I need to open this file for reading, get all the data ava

  • How to read binary file into a 2D float array?? Update:11-30

    Hi All, I really need help to get this one as I am stuck and can't seem to find any way out of it. I am given a '.dat' file that has float values in it. I want to read this file in java and put it in a 2D float array. The file has basically a matrix

  • Please Help on Reading Binary file Update:11-30

    I'm trying to read a binary file and find a string like "DE F0 CA 01" i'm new for java and looked in the forum for solution without success please help best regards gebinow i can read the binary file, my problem is now to find the position of by

  • Search binary files? Update:11-30

    How can I search through a folder full of binary files for a specific string (either hex or ascii) ? i.e. I have a folder of 2,000 binary files and need to find one that has a specific string in it. Spotlight doesn't seem to be the ticket. I can't se

  • Struts commons binary file upload issue Update:11-30

    Hi, I was wondering if someone could help me with uploading binary files using jakarta commons file upload. I've looked at several examples and forums and it seems to work but sometimes the binary files that I upload get corrupted. I have no idea why

  • Issue in downloading Binary File on Safari 5 (MAC OS) Update:10-11

    Hi, We are working on an application, which download binary file when clicks the button, when i am using Safari 6 the below code snippet download file successfully. Image: Safari 6: on clicking Export file downloaded: code: String userAgent = request