Callback VI Not Triggering on .NET Events

Updated May 16, 2018

Reported In

Software

  • LabVIEW

Programming Language

  • C# .NET

Issue Details

I have a .NET assembly that I have been building and am trying to raise an event in the assembly to be handled in LabVIEW. LabVIEW is able to recognize the .NET assembly and LabVIEW fully executes when run however no events are ever triggered in LabVIEW. 

Solution

The callback VI must be registered in the right order compared to the rest of the code. Ensure the callback VI is registered before whatever is firing the event calling the callback, often times this is an invoke node.

A few other factors that would prevent this from working:

  • Make sure your .NET framework is installed and up to date
  • Ensure the program is not creating events with type NULL which LabVIEW is unable to see.
    • Use Windows Events Viewer to view information about your events.
    • If these are NULL events, create a wrapper dll to change the events from NULL to a type LabVIEW can accept. 

Additional Information

If the callback VI is not registered when the event is fired, it will result in a null pointer exception as there would be no subscribers to the event. 

WAS THIS ARTICLE HELPFUL?

Not Helpful