From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-27-2012 10:39 PM
I used Labview "Call Library By Node" to link a function namely A function from a dll written in C language. The A function prototype as below:
I16 __stdcall A(U16 X1, UCHAR X2, UCHAR X3,BOOLEAN *X4, BOOLEAN *X5, U16 *X6, U32 *X7);
There's no boolean type for me to assign to X4 and X5 variable. Please help.
11-27-2012 10:57 PM - edited 11-27-2012 10:59 PM
Hi
you can use the 'Adatpt to Type' setting as current parameter type, in the dll function prototype and wire a boolean constant on the input of the terminal.
11-28-2012 12:11 AM
If I used "Adapt To Type", then what's the data format I should use? There are options "Handles by Value", "Pointer to Handles", "Array Data Pointer" and "Interface to Data".
11-28-2012 12:31 AM
Hi
I missed one thing in your original post, that the dll function has boolean pointers. since i have not worked with pointers as dll parameters, i cannot tell you which one is the correct option.
but, i would play around with the available options and see which one works.
11-28-2012 12:46 AM - edited 11-28-2012 12:47 AM
The "Adapt to Type" suggestion makes this more complicated than necessary. Just replace it with a byte (which happens to be how LabVIEW represents a boolean as well), per the Windows Data Types documentation. Note that in Windows, BOOL and BOOLEAN are different sizes (thanks, Microsoft!).
EDIT: in case it wasn't obvious, since your function parameters are pointers, the appropriate LabVIEW configuration is a U8 (or I8) passed by reference.