mrbean,
1) What do I pass into the User Parameter? I tried a CreateUserEvent (VI) thinking that I need to pass in (to the actual Callback VI) a number somehow (UIMsg_UserMessageBase + 0, 1, 2, etc).
User Parameters are used if you want to pass information from the operator itself to the Callback VI. For example, if you want to update an indicator on the operator interface based on some UIMessage, then you need to pass the reference to the indicator as an user parameter to the callback VI. If you are going to use any User Parameters, you need to create the Callback VI after you connect them. If you do it the other way, you would get a broken wire.
2) In the Callback VI, I thought I would use the UserParameter (assuming it was UIMsg_UserMessageBase + n) and wire that into a case statement, such that I could handle case UIMsg_UserMessageBase, UIMsg_UserMessageBase + 1, etc, as I added other custom events. Is this not how it works?
The actual UIMessage info should be retrieved from the Event Data terminal in the Callback VI. It's a cluster with one element called uiMsg. You can access it by using the unbundle by name node. uiMsg is an TestStand object of UIMessage class. Therefore, you can use a property node to access the "Event" property, which is the UIMessageCode associated with the UI Message.
In addition, you can get "Thread" as a property from uiMsg, which in turn will lead you to Sequence Context. For the relationship between different TestStand API objects, please refer to this Help document.
3) Should I instead be passing in a cluster (into UserParameter) containing references to the various Managers, and the various Custom controls I may want to monitor?
Yes. If you need to pass in more than one User Parameter, you need to bundle them into a cluster.
4) Assuming I get 1-3 figured out, I'm not sure how the actual event occurs. I know a PostUIMessage needs to occur somehow, but I'm not sure how to get that to happen when the user clicks the LaunchReport button.
Yes, you need to call Engine.PostUIMessage to fire the event. There're also the default ones that are fired by the TestStand engine. For this LaunchReport button, you need to place the PostUIMessage method inside the block of code that's responding to a button click. If it's a standard LabVIEW button control, then you put PostUIMessage in the event structure. If it's the activex button, then you put the method in the Callback VI. I'm refering to the Callback used to handle the button click, not the Callback for the UIMessage, of course.
Regards,
Song Du
Systems Software
National Instruments R&D