LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

read from binary files borlandc

Hello,

 

I have an application written in CVI and runs with CVI 8.5 in Borlandc compatibility mode. I recently upgraded my CVI to 2010 where Borlandc compatibility mode is no longer supported.

 

Under CVI 8.5 my application opens binary files, read data (text, unsigned long, chars, etc..) and disply the results. compiling the application in CVI 2010, my application reads the same binary files but the output does not make sense. Is the byte order in binary files, when using the read function, different between Borlandc and microsoft C? how can I use my application to be able to read the binary files generated by another application??

 

Regards,

 

Maroun Elias

elias@asiiweb.com

0 Kudos
Message 1 of 2
(2,922 Views)

I do not think the change in compatibility mode affects byte alignment: as far as I can remember it is defined at processor level, not at compiler one. Are CVI 8.5 and 2010 installed on the same machine?

 

On the other hand, a change in CVI version could affect structure packing (I seem to remember to have found such an issue when porting some applications from CVI 6 to 7): if you are reading your binary files through a struct you may want to investigate on default structure packing between the two systems and add the appropriate #pragma pack preprocessor clause to guarantee compatibility between them.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,910 Views)