LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Implement Callback function using LabVIEW

The IEC61850_Associate_Req function has a callback fuction Confirmation as one of its parameters. How do I implement the  callback using the Call Library Function node

 

int_stdcall Confirmation(LPCTSTR Msg)

{

  printf("\n***Confirmation (callback)***\n%s\n", Msg);

  return 0;

}

 

result= IEC61850_Associate_Req(request.c_str(), Confirmation, confirmation, 1024);

if(result)

{

 return result;

}

 

Thanks in advance.

 

Regards,

Vivek

 

0 Kudos
Message 1 of 2
(2,798 Views)

Basically you can't. LabVIEW does not allow to use pointers, much less function pointers. The only feasable solution IMHO is to write a wrapper DLL in C/C++ that translates the Callback function into a LabVIEW user event or similar. Search for PostLVUserEvent() here in the forum for many discussions and possible solutions to the callback function problem.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(2,775 Views)