LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Integrate Python modules in LabWindows CVI 8

Hi,
has anyone done this?
I am trying it using the
Python/C API but including the header Python.h doesn't work, LabWindows asks for a lot of other files to include (for instance io.h, crtdefs.h). It then does not compile prompting a variety of error messages, redeclarations and so on.
Does anyone where my error is?
thanks!
0 Kudos
Message 1 of 14
(8,294 Views)
DocEye  

Are you using Python.h before any header files that are bringing in standard headers?

Try using Python.h as the first included file and see if that cuts down on the errors. 

Menchar


0 Kudos
Message 2 of 14
(8,280 Views)
A quick test showed the same errors you saw. After a brief perusal, I believe the default configuration is for Microsoft Visual C++.

I was able to make a few quick changes to pyconfig.h (which is used to tell python about your compile environment) and get everything working (at least with some quick and dirty tests). This was done on the newest 32-bit ActivePython release (2.5.1.1).

I am attaching the modified pyconfig.h. The changes may be a little rough, but they seem to work. If you are using a different version or release, you may have to modify your own pyconfig.h. I can give you some pointers if you go that route.

Best of luck.

Regards,

-alex
Message 3 of 14
(8,270 Views)
DocEye,

I think a little more description of what you're doing is needed. What kind of errors are you getting? Where did you get the Python/C API (did you download it from another site)? What all files are being asked for?

After posting this I see that Alex posted some information on this, if this was not able to resolve the issues please let me know.

Message Edited by Brandon V on 05-08-2007 05:30 PM


Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 4 of 14
(8,272 Views)
Thank YOU very much!!!!!

It works perfect, I can implement any python script into my C code now.
I really appreciate your help!
Thanks!

0 Kudos
Message 5 of 14
(8,255 Views)

Hi everyone!!

 

could you exmplain,  how to do it? I mean, I have problems to use the Python.h from lab windows CVI  I have those erros: io.h was not found, sys\stat.h, was not found and wchar.h was not found, do you know how to fix it?  Im using labwindows CVI 2012 and python 3.4.. all under Windows 7

 

 

0 Kudos
Message 6 of 14
(6,967 Views)

Please post your question in a new thread, it's more likely that it will be noticed there. You can reference this thread in your new one.

 

Regards,

 

Brandon V.

Applications Engineer

National Instruments 

0 Kudos
Message 7 of 14
(6,950 Views)

I have copied the file provided by Alex'D but I have some errors,  (the scenario is I have tried with activepython 2.7.7 under Windows and labwindows CVI 2012)

 

 

Error.png

0 Kudos
Message 8 of 14
(6,906 Views)

I have used the file provided by Alex D's and also I have added the python27.lib and the it seems fixed thanks!! I will try to execute some different statements in python from CVI... (sorry I have committed a mistake with this two last answers those are part of the main thread of my question) 

0 Kudos
Message 9 of 14
(6,904 Views)

Hi,

Did you got a solution for your issue? 

Now I am facing the same issue... can you please share me your experience.

0 Kudos
Message 10 of 14
(4,667 Views)