LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Compile old C code using Labwindows/CVI Version 9.1.0

Hello,

 

I am trying to compile the old C code and .UIR code using Labwindow/CVI evaluation Version 9.1.0 to get the header .h file from UIR file, and EXE file. After the UIR changed the font because UIR file has been coded with LABwindows 8.1.0, and the following errors are displayed. Any help is appreciated.

 

 ATHOS47.C - 20 errors
 "ATHOS47.h"(689,45)   Redefinition of macro 'menubar_panel_SEPARATOR'.
 320, 1   Missing prototype. (Require function prototypes build option is enabled.)
 322, 9   Missing prototype. (Require function prototypes build option is enabled.)
 323, 9   Missing prototype. (Require function prototypes build option is enabled.)
 324, 9   Missing prototype. (Require function prototypes build option is enabled.)
 325, 9   Missing prototype. (Require function prototypes build option is enabled.)
 326, 9   Missing prototype. (Require function prototypes build option is enabled.)
 327, 9   Missing prototype. (Require function prototypes build option is enabled.)
 328, 9   Missing prototype. (Require function prototypes build option is enabled.)
 329, 9   Missing prototype. (Require function prototypes build option is enabled.)
 330, 9   Missing prototype. (Require function prototypes build option is enabled.)
 331, 9   Missing prototype. (Require function prototypes build option is enabled.)
 332, 9   Missing prototype. (Require function prototypes build option is enabled.)
 333, 9   Missing prototype. (Require function prototypes build option is enabled.)
 334, 9   Missing prototype. (Require function prototypes build option is enabled.)
 335, 9   Missing prototype. (Require function prototypes build option is enabled.)
 336, 30   Missing prototype. (Require function prototypes build option is enabled.)
 337, 9   Missing prototype. (Require function prototypes build option is enabled.)
 347, 9   Missing prototype. (Require function prototypes build option is enabled.)
 348, 9   Missing prototype. (Require function prototypes build option is enabled.)

 

Download All
0 Kudos
Message 1 of 9
(6,085 Views)

Hi, two minor comments:

 

- it's better to use relative path, i.e. #include <userint.h>

- furthermore, to my knowledge, there is no more a file such as 'lwsystem.h'

Message Edited by Wolfgang on 05-27-2010 07:44 AM
Message 2 of 9
(6,074 Views)

This code has old K&R-style function declarations, and the header files (especially lwsystem.h) indicate it was written in LabWindows for DOS, not LabWindows/CVI. It is clearly rather old!

 

If you want to try to get the code working as-is, you will at the very least need to turn off the 'Require function prototypes' option in the CVI Options|Build Options... panel, then start working through any other errors.

 

I note also that the compiler is not complaining about a missing lwsystem.h - have you copied this into the CVI include folder from somewhere else? You should not have done this. Functions previously covered by lwsystem.h are covered by different include files in CVI, and the compiler will normally prompt you when you try to compile if a standard header file is required. You should check carefully that the files in the ...\CVI2009\include folder are ONLY those installed with CVI2009.

--
Martin
Certified CVI Developer
0 Kudos
Message 3 of 9
(6,060 Views)

Thank for your inputs. Labwindows/CVI has the tool to translate this DOS programs so It can be run in LabWindows/CVI.

 

 

0 Kudos
Message 4 of 9
(6,042 Views)

That's true. But although CVI's translation tool helps a lot, it is by no means the whole answer. You still have work to do once it has been run over your code.

 

It does not appear to have been applied to the source code you posted, by the way.

--
Martin
Certified CVI Developer
0 Kudos
Message 5 of 9
(6,025 Views)

Hi,

 

We have used LabVIEW for other projects, so is it necessary to use LabWindows/CVI to modify the old  C code from Labwindows for DOS 4.6.1?.

If we select LabVIEW, so we will need to start over  from beginning to create vi programs to replace the old C codes, or may use some C old codes from old program Labwindow for DOS 4.6.1 to transfer to Labview. Please give us a recommendation for selection, and it seems to us LabVIEW will take a lot of work.  

 

Thank.

 

 

0 Kudos
Message 6 of 9
(5,932 Views)

Hi btran,

 

There is no automatic method for converting c code directly into LabVIEW code, so if you choose LabVIEW, you would need to write everything as LabVIEW code. However, if you can compile functions of your c code into a dll, you could call that dll from LabVIEW to access those particular functions. As an alternative, you could use the tool discussed above as a starting point for updating the code to be compatible with LabWindows CVI.

 

Have a great afternoon!

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 7 of 9
(5,884 Views)

Hi,

 

I'm new in this forum, bat I'm in a similar situation, having to perform some slight modifications to an old application realized with LabWindows for DOS.

The source code is available, but unfortunately I do not have any longer the legacy LabWindows compiler.

What do you suggest? Is it possible to find anywhere this program, or is it necessary to pass to LW CVI?

 

Thank you in advance

 

 

 

0 Kudos
Message 8 of 9
(4,794 Views)

Hi willkacka,

 

At this point the easiest procedure is going to be to convert your code to LabWindows/CVI and just create a new project and reincorperate all of your code to it and fix the errors as they come.

 

Regards,

James W.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(4,760 Views)