01-22-2018 03:28 AM
Dear GerdW,
Thank you very much for your kind replies. I will check it out.
-Praveen
01-22-2018 01:41 PM
@GerdW wrote:
No need to convert to "binary" or something else - just save the data to a file!
While the data is just a string, you need to make sure to use the binary file IO and not the text file IO tools. While both can be used if done right, you need to be more careful with the text tools, because there are options such as "convert EOL", which could make a mess out of binary data.
01-22-2018 08:44 PM - edited 01-22-2018 08:45 PM
I tried saving the string file directly to the binary file. When i open the file its not opening. The VI attached with this.
01-22-2018 10:02 PM
What's the point of the FOR loop that iterates only once? You currently read only a few bytes from the serial buffer, you probably need to read the entire image data before saving it.
01-22-2018 10:09 PM
Yes, you are correct. I used FOR loop for no reason. It won't affect the result too. (Can modify while sync condition).
The thing is while reading the image data I am not exactly getting 512 bytes. It's changing every time. (I think because of the delay time).
1. I am struck here to receive the full image. 512 byte
2. Even I received 512 bytes sometimes I am not sure to convert into image (jpeg type).
Totally confused.
01-23-2018 01:22 AM - edited 01-23-2018 01:26 AM
Hi praveen,
- those 512 bytes are just an example in your manual, you might change the block size to other numbers as is described in the flowchart for reading JPEG Snapshots…
- you surely need to read more than just one block of 512 bytes to recevie your full JPG image: do you change the package ID as is described in the flowchart for reading JPEG Snapshots?
- just save the received bytes to a file using WriteBinaryFile…
01-23-2018 01:41 AM
Yes. you are correct. I flush the buffer using the VISA flush IO buffer.vi.
Now I can receive 512-byte data (actually those are HEX but received in String).
If I saved this directly in "Write to binary file" in Big-endian - network order (in jpg or jpeg format) the result is not openable.
I think I am near to the solution. Needs to find how to save the file and its format.
Thank you once again for your valuable feedback.
01-25-2018 04:28 AM
I acquired all the image byte packets and joined together. (To get the whole image)
when I save in "write text file" as well as"write binary file" (saved as .jpg). It doent work.
01-25-2018 04:41 AM
Hi praveen,
we told you NOT to use WriteText - only use WriteBinary!
What didn't work?
Is the data you got from your device as expected?
Can you attach such a data file (after saving it with WriteBinary with "Prepend Array Size" set to FALSE)?
01-25-2018 04:59 AM
Yep. I saved "write binary file" (in suffix .jpg)
as you said I made "Prepend Array Size" set to FALSE.
When I open it in paint shows error in format (error snapshot image attached)
I also attached the saved jpg file and the LabVIEW code for your reference.