JimPanse Posted August 11, 2021 Report Posted August 11, 2021 Hello experts, I would like to use the two functions: int clSerialInit(unsigned long SerialIndex, void** SerialRefPtr); int clSerialClose(void* SerialRef); Execute via a Call Library Function Node. I have chosen the parameterisation shown. But it does not seem to work. The function prototype does not seem to be correct either. Can someone tell me how to parameterise the call library function Node in order to execute the two functions? Have a good time, Jim Quote
Rolf Kalbermatter Posted August 11, 2021 Report Posted August 11, 2021 5 minutes ago, JimPanse said: Hello experts, I would like to use the two functions: int clSerialInit(unsigned long SerialIndex, void** SerialRefPtr); int clSerialClose(void* SerialRef); Execute via a Call Library Function Node. I have chosen the parameterisation shown. But it does not seem to work. The function prototype does not seem to be correct either. Can someone tell me how to parameterise the call library function Node in order to execute the two functions? Have a good time, Jim For the clSerialInit you want that parameter to be a pointer sized integer, Pass: Pointer to Value. For the other function make it a Pointer sized Integer, Pass: Value. If you pass this value around through VI connector panes, always make it a (u)int64 bit integer. Don't forget to call the clSerialClose() function or whatever it is called. The clSerialInit() function allocates resources (and almost certainly opens the serial port underneath making it inaccessible for anyone else until it is closed properly). If you don't close this resource properly you would create a memory leak and likely make the port inaccessible when starting your program again. 1 Quote
JimPanse Posted August 11, 2021 Author Report Posted August 11, 2021 Hello Rolf, it looks like it's working. Thanks for your help, Jim 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.