Hello we have a labview Vi which tries to call a C function from a C/C++ dll. the function sets the python script paths and then calls Py_initialize.
Labview exits with no warning or error notification.
Windows error log shows the following.
3843485786 |
1 |
APPCRASH |
Not available |
0 |
LabVIEW.exe |
12.0.1.4008 |
51421a0a |
python27.dll |
2.7.3150.1013 |
4f84a6c7 |
40000015 |
0006016a |
C:\Users\fernav2\AppData\Local\Temp\WER5E2C.tmp.WERInternalMetadata.xml C:\Users\fernav2\AppData\Local\Temp\WER78DE.tmp.appcompat.txt C:\Users\fernav2\AppData\Local\Temp\WER8E62.tmp.hdmp C:\Users\fernav2\AppData\Local\Temp\WER90F2.tmp.mdmp |
C:\Users\fernav2\AppData\Local\Microsoft\Windows\WER\ReportQueue\AppCrash_LabVIEW.exe_7b2562e45cd521149b2c133520fac1153acca60_cab_1b7c918b |
0 |
60c5909a-2199-11e3-859b-005056c00008 |
8 |
The code to launch labview is as follows
/*Initializes the python script*/
DllExport
intStartPythonScript()
{
intindex =0;
Py_SetProgramName(
"PYTHON");
Py_SetPythonHome(s_py_path);
Py_Initialize();
if(s_py_path)
{
char* new_path= (char* )malloc(strlen(Py_GetPath())+1+strlen(s_py_path)+4);
memset(new_path,
'\0',strlen(Py_GetPath())+1+strlen(s_py_path)+4);
strcpy(new_path,Py_GetPath());
strcat(new_path,
";.;");
strcat(new_path,s_py_path);
PySys_SetPath(new_path);
printf(
"\r\n %s ",new_path);
free( new_path);
}
for(index =0;index<100;index++)
{
s_PyObjectInst[index] = NULL;
}
returnTRUE;
}
Would appriciate any help possible.
Regards