LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i read a rz-file?

Take a look at the "Read Binary File" example that ships with LabVIEW. Open the Example Finder (Help->Find Examples...), switch to the "Search" tab and enter "binary" in the search textbox. In the listbox of results you should get "Read Binary File" as an example. This example opens a file in which the data is interpreted as an array of numbers. The datatype is the DBL constant that's wired to the "datatype" input of the "Read from Binary File" function that tells it how to interpret the data.
0 Kudos
Message 11 of 23
(1,310 Views)
ok thank you, thats is realy nice.
here is the file, i hope you have luck


0 Kudos
Message 12 of 23
(1,311 Views)
Looking at your file, it looks like it may be a mixture of a binary and ASCII file.

Since you said it is a camera output, it looks like it may be 24-bit numbers in binary seperated by spaces.  So, you won't get away with a simple file read, as you may see ASCII spaces in the binary representation of a 24-bit number.  The 24-bit number may be RGB points (8-bit for each color).  But this is just speculation.  Assuming I am correct, your first data point could be 199,116,76 for R,G,B.

You may want to sit down with the developer of the other application and get the definition of that file.  Any time you are writing an application which is creating a file which is not self-explanatory, it should be documented as how the file is constructed.

Message Edited by Matthew Kelton on 09-17-2007 02:04 PM

0 Kudos
Message 13 of 23
(1,290 Views)
As I was writing a response explaining the format of the file I received notification of Matthew's response, so I'm skipping the explanation of the file format. When I looked at I assumed it was a 24-bit number followed by a space. You had said "cam", though I didn't intepret that as meaning "camera", but Matthew's assumption of RGB value makes sense.

You can use the attached VI to read the file, but as far as how to interpret the pattern of numbers, you need to check with the device that generated the file. For the file you provided there's 35975 triads of numbers (assuming 3 8-bit numbers in the triad). This doesn't seem to divide evenly as far as common resolutions.

0 Kudos
Message 14 of 23
(1,279 Views)
This is the VI I wrote to look at your data.  I'm not saying it is the best way to do it, but I made the assumption that the file was a 2-D array in the pixel resoltuion of the image.  With this, you'll get a 380x762 image.  It doesn't sound standard to me, but I am not familiar with standard camera resolutions.
0 Kudos
Message 15 of 23
(1,274 Views)
Matthew, I don't think that VI will work as you intend it to. You're assuming that you can use EOL to break up the lines, and there are no EOL characters in the file to delineate scan lines. For instance, running your VI on the file gives 267 RGB values for the first iteration (row), 333 RGB values for the second iteration (row), 18 for the third iteration, 39 for the fourth, etc. Each iteration should give the same number of values.
0 Kudos
Message 16 of 23
(1,271 Views)
I agree it's probably 24 bit numbers with space (x20) as delimiter. If we read it as little endian U32 and mask off the x20, it looks like we have a noisy square wave with a halfperiod of about 900 samples. (there is no pattern in the lower order bytes, so it's probably not an rgb picture).
 
It could be may other things. 🙂 You really need to talk to whoever made that file.
 
 
 

Message Edited by altenbach on 09-17-2007 01:11 PM

0 Kudos
Message 17 of 23
(1,268 Views)
I apologize, you are correct, I wrote it in such a hurry I didn't verify that there were EOL's.  The VI is catching EOLs that are actually part of the 24-bit numbers.  So, you will also need to know the image size in order to use this file.
0 Kudos
Message 18 of 23
(1,265 Views)
The file is very repetitive with a period of 1764 (4byte) elements. There are only very, very small differences between individual stretches of 1764 elements, most corresponding elements are identical.
 
a subset of A(x+n*1764) is "mostly" a flat line for any integer x and n

Message Edited by altenbach on 09-17-2007 02:21 PM

0 Kudos
Message 19 of 23
(1,251 Views)
realy realy thank you, the date loks a litel bit strong, but that is it.
i will now test it with the hole data


THX THX
0 Kudos
Message 20 of 23
(1,212 Views)