LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

where is Read from I16 File.vi ?

Allright, I finally had a chance to return to this issue, and I'm so very close.  I didn't change much to your existing code, it's very clever, thank you.  I added the filter that finds the 0x01 to determine header length (works great), and then I added some code to save the newly created arrays as binary files.  But what I added doesn't work, and I'm confident that I'm not saving the files correctly.

 

Originally, I had the Open/Write/Close Binary file outside the loop with the built array and the loop index number wired to that Open/Write/Close sequence so that the original file name would be used with simply an _00, _01, _02, _03 sequence after the filename, but that didn't work.  I then put the sequence inside the loop, and still it doesn't work.  What am I doing wrong?

 

To put this issue to rest, all I need to do after this is concatenate the ASCII header file to the beginning of each subfile created.  Is it possible to do this with two differenet data types (ASCII, U8)?  Must I translate one of them into the other format and then concatenate and then save?

 

Thanks,

~Tristan

0 Kudos
Message 11 of 14
(825 Views)

You're not setting the file position to the correct location after reading the 1024 bytes. As I noted, you have to set the file pointer to the position where the data actually begins, and prior to entering the loop, since the actual end of the header is somewhere within that first 1024 bytes. As it is right now, the loop starts reading at the 1025th byte, which is probably in the middle of a record.

 

0 Kudos
Message 12 of 14
(810 Views)

Maybe I don't understand what you mean by "file pointer" because I attempted to do what you suggested.  I am not getting results, which suggests you are right, but I am confused as how to proceed.

 

I can see how what I am doing is not setting the file pointer to the end of the header, it is simply defining the size of the binary data by subtracting the length of the header from the calculations of file length.  But I still don't see how it's hard wired to begin reading data at 1025 bytes.

 

It is not apparent in the Help topics how to set the file pointer, will you shed some light on this for me please?

0 Kudos
Message 13 of 14
(797 Views)

It's not that difficult: Set File Position.

 

See attached mod. Check to make sure the position is being set to be right after the 0x01 byte that indicates the end of the header. 

0 Kudos
Message 14 of 14
(790 Views)