LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read I32 file

Hello all,

I am using LV 7.1, and XP.  I have large data sets that contain important information (binary) in the header stored in specific bytes for specific lengths.  The type of data are Long Integers.  I have found an I16 binary open but am unable to find an I32 binary open file (to accomidate the long integer).  I have tried to use the open file than read command but have been unsuccessful in reading the file correctly.  If any one could help it would be great.  As an example I need to know what exists at the start byte of 16 where the length in the byte is 4 and the data is stored as a long integer.

Thanks:)

Azazal
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 1 of 6
(4,298 Views)
Hi Azazal,
If you use "read from binary file" you can tell what kind of data to read by wiring the datatype to the appropriate input. Then this function interprets the file as a stream of that datatype. See the example below, it reads the file at position 16 (in bytes) and shows it in the indicator (in Hex notation)



Greets, Dave

Message Edited by daveTW on 01-30-2007 11:22 PM

Greets, Dave
0 Kudos
Message 2 of 6
(4,290 Views)
Hello DaveTW,

Where are those file icons located as I could not find them in the palette.  Are you using lv 7.1?

Azazal
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 3 of 6
(4,283 Views)
8.x is a little different. You've just got the Read File function but it works in am similar fashion with an input called byte stream input. Wire an I32 constant to it and you read I32 values. The high level example you are talking about (Read From I16) calls a subVI called Read File+[I16]. If you want, make a copy of this and remove the To Word Integer function so that the I32 pos offset control is wired straight to the byte stream inpu. Call this copy Read file+[I32]. Make a copy of Read From I16 that calls your new VI and call this Read From I32. Make sure you save these new files in a new location. I think it's just as simple to use the lower level Read File function and not worry about the high level stuff.
Message 4 of 6
(4,276 Views)

Dear Dennis,

          I am using "Read from I16" block in my LV7.0 for binary file reading. My program is working fine. But i have a question that. Like othre file function, do i need to close file? If yes please guide me how i can close that, because i couldn't get an option to close binary file.

 

Thanks

 

--vishnu

0 Kudos
Message 5 of 6
(3,945 Views)

Vishnu Patel wrote:

Dear Dennis,

          I am using "Read from I16" block in my LV7.0 for binary file reading. My program is working fine. But i have a question that. Like othre file function, do i need to close file? If yes please guide me how i can close that, because i couldn't get an option to close binary file.


 

Did you read the Help? Quote:

Reads a 2D or 1D array of data from a byte stream file of 16-bit signed integers. The VI opens the file before reading from it and closes it afterwards.

0 Kudos
Message 6 of 6
(3,930 Views)