09-12-2013 04:55 PM
Hi all,
I have a problem regarding to the use of handle and pointer. I am trying to use an external DLL library in Labview. In this DLL library, there are two functions, one is like:
int32_t xChannelOpen( CIFXHANDLE hDriver, char* szBoard, uint32_t ulChannel, CIFXHANDLE* phChannel),
and the other one is
int32_t xChannelClose( CIFXHANDLE hChannel),
where this 'phChannel' is a pointer to a CIFXhandle 'hChannel'. Now I would like to get this handle 'hChannel' value from 'phChannel'. I think it's not difficult to be done in C, but how could I do that in Labview? Is there any method that can access the handle from its pointer? I appreciate it so much for any advice.
Thank you very much.
Best regards,
Sun
Solved! Go to Solution.
09-12-2013 05:20 PM
You don't need any special function to do this. You need to configure the calls to Call Library Function Node properly. When you call xChannelOpen, you should configure the phChannel parameter as a pointer-sized integer value passed by pointer. The value that will be returned from that parameter is the hChannel value. When you call xChannelClose, pass the same value (the same wire), but this time configure it as a pointer-sized integer passed by value.
09-13-2013 03:36 AM
Hi nathand,
Thank you so much for your help.
I was really confused by this handle and pointer stuff. Now I follow your suggestions and it works.
Best regards,
Sun