LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Integrate Python modules in LabWindows CVI 8

Hi Rahul, 

 

Thank you for posting here, what do you mean when you say that you are experiencing the same issue? Are you working with the same software versions and trying to integrate python modules in LabWindows/CVI 8?

What have you tried so far? Considering that this is an old thread it might be worth to try opening a new conversation detailing your current situation, that way we can all discuss and have a better context to help you.

Regards,

Sil.VI
0 Kudos
Message 11 of 14
(967 Views)

Hi Sil,

Thanks for your replay.

I am using Labwindows CVI2015.  Now I am in need of making use of Python in my application in CVI. I have installed Python version 2.7.

I have included the lib python27 in my project and python.h which includes most of other header too.  While executing the program am getting and error which says io.h is missing needs to added.  I have added pyconfig.h provided by Python.

The error looks similar to the issues which you faced earlier in your application.  Hence posted on that topic.

 

Regards,

Rahul.

0 Kudos
Message 12 of 14
(953 Views)

@Rahul_KL wrote:

 

I have included the lib python27 in my project and python.h which includes most of other header too.  While executing the program am getting and error which says io.h is missing needs to added.  I have added pyconfig.h provided by Python.

The error looks similar to the issues which you faced earlier in your application.  Hence posted on that topic.


And the solution is also similar to what was proposed in the post by AlexD. Python source code is a multi compiler project which means it can be compiled in several dozen more common and not so common compilers. The way to do this is by providing a config file that defines various identifiers that specifies what sort of includes to disable and also for some conditional compiling of functions that are not supported in all compilers. All these defines are collected in the pyconfig.h file.

 

The file that comes with your typical downloads is preconfigured for Visual C. On Linux and other gcc systems this file is autogenerated by executing the ./configure command which will do all kinds of environment detection and adapt the pyconfig.h template file to work for the current platform. For LabWindows/CVI which is for various reasons not the same as Visual C, you have to make these changes yourself to configure the Python source code to compile for your platform and compiler. (There is no bash shell on Windows that could execute the ./configure script, and even if there was it would detect wrong things as the Unix like environment it would run in surely won't provide the right answers that LabWindows CVI would need!)

 

I would start with the pyconfig.h that Alex created and go from there as a first attempt. It may be mostly enough though as long as you want to go with Python 2.7 sources. For newer Python 3.x sources the new pyconfig.h is very likely to different from the old one that you could simply drop in the one from Alex as is.

Rolf Kalbermatter
My Blog
Message 13 of 14
(933 Views)

Hi, Mr.Rolf,

Much thanks for the information.

Regards.

0 Kudos
Message 14 of 14
(909 Views)