LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fprint in labview

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 07:44 PM
에 labmaster에 의해 편집되었음
0 Kudos
Message 1 of 7
(3,624 Views)

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?

0 Kudos
Message 2 of 7
(3,600 Views)

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?

0 Kudos
Message 3 of 7
(3,572 Views)

That's what it sounds like to me. An I16.

 

What is this application and where is its manual?

0 Kudos
Message 4 of 7
(3,569 Views)

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 12:29 PM
에 labmaster에 의해 편집되었음
0 Kudos
Message 5 of 7
(3,558 Views)

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.

Message 6 of 7
(3,546 Views)

Thank you for the reply.

You and I was right.

0 Kudos
Message 7 of 7
(3,521 Views)