04-27-2009 07:43 PM - edited 04-27-2009 07:44 PM
I made a data converting program.
The original data should be written in "fwrite (&arrImageData[iCol][iRow], sizeof (double), 1, pDestinationFile);" in Windows c++.
I got to know there somethings to consider such as Endian problem.
Anyway, Does above fwrite can be realized like this (pic) for an array?
(It's not worked now.)
04-27-2009 10:36 PM
In what way is this not working? Are you getting an error message?
What are you expecting to get versus what are you actually getting?
04-28-2009 11:03 AM
I convert the float numbers to 2 byte integer.
The minimum (-1.293) and maximum (1.688V) are -32768 and +32767 respectively.
The application shows the image rightly, but the Z scale -1.09 and +1.67 for min and max.
In the manual of application said "The data is read as a matrix Number of columns x Number of rows two-bytes data"
Does this mean the application can accept only 2 byte integer? or what else?
04-28-2009 11:10 AM
That's what it sounds like to me. An I16.
What is this application and where is its manual?
04-28-2009 12:29 PM - edited 04-28-2009 12:29 PM
Thank you for the reply.
The application is used to see an image.
The manual is in http://www.nanotec.es/products/wsxm/file_structure.php.
Or you can see the expression in C++ in http://www.nanotec.es/products/wsxm/file_format_examples.php
I confirmed the header of image was correct.
I would like to know the 2bytes binary format clearly.
04-28-2009 01:06 PM
labmaster wrote:I would like to know the 2bytes binary format clearly.
According to the C code it's a 2D array of "double"s, which are 8 bytes each. The LabVIEW DBL is the same. However, according to the C code, it's column, row. In LabVIEW, 2D arrays are row, column. So, try transposing the array.
Also, there is no need to use 2 loops to write the 2D array. Just wire the 2D array directly to the data input of the Write Binary File function.
04-29-2009 03:18 PM
Thank you for the reply.
You and I was right.