meubanks Posted 9 minutes ago Report Posted 9 minutes ago (edited) I don't think I can attach the .dll itself since it isn't my code, but I think I can reasonably share the relevant snippets. First, I'd like to clarify that the manufacturer provided example code in Python, which works fine. I've tried this both using the wizard, and Call Library Function Nodes. I must say, I don't really understand the wizard at all, as it seems to make no attempt to actually parse the provided .h file (it complains about missing preprocessor definitions, which as far as I can tell are already in the .h file, and it complains about e.g. windows.h not being found, even when I explicitly add its complete path to the "Include Paths" section). Tbh I'm not remotely sure what, if anything, I need to add to includes and preprocessor definitions. Using the Function Node, LabVIEW immediately crashes, despite my attempt to follow the examples (see my .vi). Here's the key call which works in Python: pcproxlib.usbConnect.restype = ctypes.c_short rc = pcproxlib.usbConnect() if rc == 1: rawData = "" buffer_size = ctypes.c_short(32) pcproxlib.GetActiveID32.restype = ctypes.c_short # create a buffer of given size to pass it # to get the raw data. raw_data_tmp = (ctypes.c_ubyte * buffer_size.value)() #as per documentation 250 millisecond sleep is required # to get the raw data. time.sleep(250/1000.0) nbBits = pcproxlib.GetActiveID32(raw_data_tmp , buffer_size) pcproxlib.USBDisconnect.restype = ctypes.c_short pcproxlib.USBDisconnect() I've attached the .h file, and the .vi file of my failed attempt at using the Function Node. How on earth is one supposed to figure all this out de novo? pcProxAPI.h pcProxAPI test.vi Edited 8 minutes ago by meubanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.