12-27-2021 07:58 AM
The format for calling third-party library functions in C++ is:
short mc;
short timeout = 500; /*ms,
char *ip = “192.168.100.1”;
short rtn = 0;
rtn = ZT_Open(ip, &mc, timeout);
How to set the types of parameters mc and ip when calling ZT_Open by using the Call Library Function Node in LabVIEW
Solved! Go to Solution.
12-27-2021 11:43 AM - edited 12-27-2021 11:49 AM
ip is a String, C string pointer, (This is simply a pointer and is not considered a reference really)
mc is a int16, pass: pointer to value (this is the same as a value reference really)
The difference about what a pointer and reference means is mostly really just semantics. In C there is no real difference at all between the two . In C++ a reference parameter is one which is explicitly passed to the function in a way that can have direct effects on the location where the variable is stored. A non reference parameter is valid to be assumed by the compiler as not being modified by a function call. But that is all stuff you do not want to know if you don't program in C(++).
As far as the LabVIEW Call Library Node is concerned the most important point to take away is that a variable reference is equivalent to the pointer to that variable.