LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple c files

Hi,

 

Hopefully I can phrase this with out too much confusion!!

 

Can I do the following and if so how?

 

I have two projects in CVI and I would like to put them into one as the functionally and UIR’s in both I need to use.

 

The two were developed at different times but I now need to rolled both into one application.

 

Each project has a single UIR and a single c file.

 

Project 1 is the main project, which will be calling, via a command button (I hope), project 2.

 

This, as you can see, is a new departure for me as I normally write one big c file doing all the work and I have never ventured into multiple c files with just one master!!!

 

Thanks for the help

 

Simon

Still learning!!

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

CVI can manage projects that include several source files as well as several UIR and include files: the Edit >> Project menu item can help you in adding all the files you want.

Some hints on managing such projects:

  • You must have only one main () function in the project
  • Similarly, it's better that you call RunUserInterface only once
  • Every source file must include the necessary files to run (toolbox, analysis, instruments...) and the include file(s) of the UIR(s) that the module needs to operate on
  • Global variables and function definitions other than those associated to UIR controls can be defined in a separate include file to #include in every source file

This means that merging two projects should not be a complicated matter: you must decide which is the master application and call the "slave" from this one; in the called app the main routine is replaced from the calling routine from the master app; next you will need to handle the interactions between the two projects merged, if any.



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,975 Views)