02-08-2011 12:10 PM - edited 02-08-2011 12:11 PM
I initialized the server as follows:
It was made as a separate VI, and I ran it before opening any other VI's.
The server initializes, but I am unable to obtain variables from the code being computed. Below is a very simple program, along with its error code.
I was able to run such code previously. The variable for the Get Data VI is identified as an integer.
Attached is the VI shown above
Solved! Go to Solution.
02-09-2011 05:10 AM
08-04-2012 05:44 PM
LabPython version 4.0.0.4 seems only to work with Python2.7.3/32bit, on Win7/64bit and LabVIEW2011 32bit.
and not with Python3.2.3/32bit. Those are the most recent releases. The 64 bit versions of Python does not work with labVIEW32bit.
The error code is the 1046 "LabVIEW cannot initialize the script server. Ensure the server software is installed."
And a few comments on the vi "PYTHON set Server Path_ogtk.vi": It has a string input which according to the front panel (its missing a help string!) is
possible values : PythonServer ArrayModule
Why use a string to select between two possible values? A properly crafted enum would be much simpler and less error prone for the user.
The quick help window labels the values for this input as "token (empty: PythonServer)". This is non standard and consequently - misleading syntax. The Empty keeword is implicty (default), so a standard syntax would be
token ("PythonServer")
By the way, the standard python27.dll location seems to be "C:\Windows\SysWOW64\python27.dll" and not C:\Windows\System32\python27.dll. At least in my installation.
08-07-2012 01:45 PM - edited 08-07-2012 01:53 PM
LabPython was developed more than 10 years ago by me and has not received any significant work anymore. I have moved on to other things and do not intend to work on LabPython. It's all on sourceforge so you are very free to work through all the details and adapt it to the newest Python version, improve the documentation and what else. Just be aware that Python upgrades rather frequently and always uses a different DLL name with each new version. That is why there is a function like PYTHON set Server Path function to point the library to the actual Python DLL implementation. But LapPython uses a pure 32 bit interface DLL and you would have to port it all to 64 Bit in order to interface to 64 Bit Python. A 32 Bit application can only load 32 Bit DLLs and that DLL can again only load 32 Bit DLLs. Same for 64 Bit applications which only can load 64 Bit DLLs and so on.
Also LabPython interfaces directly to the Python C API. While it seemed to have worked for all major 2.x releases Python specifically reserves the right to change the API between every version and makes no guarantee that it stays compatible, or doesn't drop entire functions between versions. So I would be a little careful about trying to point LabPython to a 3.x version of Python, as according to the Python developer page, they don't even guaranteed compatibility between the various 2.x versions.
Also the path Python gets installed changes between versions too and is also dependant on your OS version.
When you point LabPython to a 64 Bit Python installation, the 32 BIt LabPython DLL tries to load that DLL, but Windwos refuses that as it is not compatible to the environment of the calling process.
Also it's not clear if NI didn't change the script server interface. I know they use internally a newer version for their latest script servers but kept support for the older interface that LabPython uses, but that support may have been axed in the 64 Bit version of LabVIEW.
06-18-2013 06:13 AM
Hi Rolf,
I have similar problem. Do not know how to fix it as i'm a beginner to Lab python.
I have installed Python 2.7.3 w64 bit in my PC and have been using that for my software test development.
now i was asked to provide a GUI for the test script that i had already created with python. Thought Labphython would be a good option.
unfortunetely i got struck with some problem after the installation of labpython, i didnt have any problem during the installation though.
but when i tred to run one of the example PYTHON+Test+Script+Node.vi , it says "LabVIEW: LabVIEW cannot initialize the script server. Ensure the server software is installed. in PYTHON+Test+Script+Node.vi"
I tried updating the server but as you mentioned since its 64 bit, though its there in "C:\Windows\System32\python27.dll" , it is not displaying when i tred to choose the dll from that specific folder.But it has updated the *.ini file.
did check the Labview.ini and its updated with the right value "PythonServer=python27.dll"
Could you please help me to make it work or if you have any other suggestions to use the labview with python script?
06-18-2013 04:06 PM
LabPython is compiled as 32 Bit DLL. It can only load the 32 Bit version of Python. In order for LabPython to be able to use 64 Bit Python you would have to recompile the LapPython DLL as 64 Bit version and also use 64 Bit LabVIEW. The entire chain of calling application, and all called DLLs needs to be the same bitness.
06-18-2013 04:13 PM
LabPython was compiled as 32 Bit DLL and as such can only connect to 32 Bit Python. If you want to use 64 Bit Python you have to recompile the LabPython DLL as 64 Bit DLL and also use 64 Bit LabVIEW.
06-19-2013 02:54 AM
Thankyou for your information. the problem is fixed after i installed the 32 bit version of python 2.7.5 version.
Regards,
Nancy
08-22-2014 05:46 AM
Hi,
I'm having the same problem with labpython. I'm probably just missing a step in one of the solutions already posted, but I need help seeing what it is, exactly. As far as I can tell, the structure of my .vi already looks identical to the accepted solution and I have got the python27.dll in C:\Python27\, running 32-bit python with 32-bit LabVIEW 2013.
After reading through an earlier thread I have also separated out the python server configuration into a separate VI which executes before everything else. The whole VI initialises, but then fails with an error 1048 at PYTHON Get Float Data_ogtk.vi : "LabVIEW failed to get variable from the script server".
So what am I doing wrong?
08-22-2014 06:46 AM - edited 08-22-2014 06:46 AM
Did you read the second post in this thread? Look at the red circle in that image!