NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Callback confusion

I'm working on customizing the Full OI from TestStand 3.5.  I am confused in trying to use/create a callback in TestStand.  I recently implemented some code modified by Dennis K. that sent a PostUIMessage from within a LabVIEW VI back to TestStand.  It worked really nice, but I don't understand how TestStand knows how to write the ProgressPercent and ProgressText to the status bar in teststand. That's my first question.  Question 2 - How do I use UIMsg_UserMessageBase within my VIs to ask TestStand to update the text on a front panel control - a control that I added (boolean button), not one that came with the original TestStand Full OI.  Question 3 - Although I want to know how to handle unique (UIMsg_UserMessageBase + x) messages, I also want to know how to use the callbacks registered in the VI entitled  Full OI - Configure Event Callbacks.vi.  For example, I see the StartExecution from the Application Manager, but back at the Full OI - Top-Level VI.vi, I can't find an event handler.  I would like to set the text of one of my indicators based on the StartExecution and EndExecution happening.  Is that even what I want to be looking at to know that either the TestUUT or Single Pass (the two entry points) has been pressed? 
0 Kudos
Message 1 of 6
(3,668 Views)
mrbean,
Here is an example that I made up that will update a string on a modified Simple OI.  I added a sting control to the OI front panel and modifed the create callback example VI.  I then generated a VI to handle user based message as a callback.  It is called "untitled.vi".
Run the example Sequence in this OI to see string value change.
Download All
0 Kudos
Message 2 of 6
(3,650 Views)
As for the status bar, that is a built in ActivX control.  All of its parameters are set and when the teststand engine gets the UI message code that is associated with the status bar it will set the correct data that was passed with the UImessage.
Message 3 of 6
(3,648 Views)
Some lightbulbs are finally turning on.  Thanks for that great example.  I do (of course) have another question.  Since I have probably 4-6 indicators for which I want to do this sort of thing, would it be best to duplicate (in a new VI) the ConfigureEventCallbacks.vi and the surrounding code (as shown in the bitmap) so as to not clutter the original VI?
0 Kudos
Message 4 of 6
(3,621 Views)
When I made a modified OI I added my code to the existing ConfigureEventCallback.vi.  That doesn't mean you have to.  If you think it would be cleaner, you can make your own with similar functions.  The only caution that I can think of is to not duplicate an event callback.  If you work in the same VI you could spot the duplicate register event callback easier.  I don't know what would happen if you register two callbacks for the same event.
0 Kudos
Message 5 of 6
(3,614 Views)

Hi,

I think it can be cleaner to keep as much of the original  code supplied by NI, un-modified, obviously the top-level has to be modified. This will help when upgrades come along, they will be a clear divison of NI supplied code and your own code.

Regards

Ray Farmer

Regards
Ray Farmer
Message 6 of 6
(3,606 Views)