Getting the Event Code of RegisterUIMessage Method in Callback VI or Function

Updated Nov 19, 2019

Reported In

Software

  • TestStand

Programming Language

  • C# .NET
  • Visual Basic .NET
  • LabVIEW G

Issue Details

I want to use the RegisterUIMessage method in the TestStand API to ensure my UI Message event code does not conflict with event codes from other TestStand components. However, in the callback VI or function I can only access the event code. How can I figure out the event code that was provided by the RegisterUIMessage method?

Solution

Call the RegisterUIMessage method again. As mentioned in the help of the function it is keeping track of all UI Message event codes of the current execution. Calling the method with a new UI Message name will return a new event code that is not already in use. Passing an already existing UI Message name will return the event code that already exists for this UI Message. In conclusion both, TestStand UI and callback VI or function only need to know the UI Message name.