LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access the handle via its pointer

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(2,703 Views)
Solution
Accepted by topic author Sun87

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.

0 Kudos
Message 2 of 3
(2,699 Views)

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

0 Kudos
Message 3 of 3
(2,674 Views)