ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Type void

cpsSend( const void* Message, Const int
BCount)

I have created the VI for the above function. I am having problem finding the right pallate that will make "Const Void* Message" when i am in the

-Build Application or shared library
- Define VI Prototype(function Prototype)

I have tried to use the variant function in my VI but i am not getting "const void". Also is there a way to have a parameter of type int instead of a long, short or etc. I change the properties to the controls/indicators to u32, I32 and etc. If you can direct me to a tutorial or the instruction on how to implement this i would really appreciate. Thanks for your time.
0 Kudos
Message 1 of 2
(3,439 Views)
The const keyword is only a hint to a C compiler that the function is not modifying the buffer past in in any way. This allows a C compiler to do some optimizations in certain circumstances when calling such a function and when compiling the function any well behaved compiler should complain if you modify this pointer inside the function or pass it to a function which is not itself declared to treat this pointer as const. For LabVIEWs Call Library Node you can fully ignore this keyword.

The void* pointer is a C syntax for a pointer which can potentially point to any datatype. In LabVIEW you will have to find out what the datatype is, this pointer should point at. It could be a byte, short, integer, long, or floating point value or an array of them or maybe also a string and configure the Call Library Node accordingly. LabVIEW is a strict datatype language and does not really allow for ambigues datatypes such as void* do present. This is no problem as the function in question will expect some specific datatype anyhow, possibly depending on a second parameter which defines what datatype the void* parameter should be treated as in this case.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 2
(3,401 Views)