问题
I am starting here with my question, but realize it might need to be answered on the Labview forums.
So, I have a DLL that was created in Labview, and I am accessing it via Python 3.3.3. I know that I am accessing it correctly, as I am able to access several of the functions already. However, I am having an issue when I try to pass a path to a file that I am running into issues.
Here is the function call details from the .h file, that was created when the DLL was created:
/*!
* ClockInit
*/
int32_t __cdecl ClockInit(uint32_t HandleIn, char fileUseDialog[]);
And here is the Python snippet that I use to call the function:
import os, sys, time
from ctypes import *
ftdi=cdll.LoadLibrary('C:\\Python33\\DLLs\\Savlo16FF_DLL_old\\Salvo16FF DLL\\Salvo16FF.dll')
FPGA_DeviceHandle=c_ulong(0)
Status=ftdi.FPGAInit(byref(FPGA_DeviceHandle))
path="C:/Python33/Scripts/RegisterMap_100M_1p8HCSL.txt"
ftdi.ClockInit(FPGA_DeviceHandle,path)
And here is the error that I get back from Labview:
http://i.stack.imgur.com/PTz61.png
The best that I can tell is that I am not passing the path correctly to the function. I have tried many different variations (changed '/' to '\', tried using create_string_buffer), but to no avail.
Thanks in advance for any help!
回答1:
Slashes go the other way in the path variable evaluate to LabVIEW "not a path" and as rightfully pointed out above, python3 requires to use the "b" prefix.
来源:https://stackoverflow.com/questions/28310902/passing-a-path-to-labview-dll-in-python