NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set the Serial Number from a VB GUI?

Hi,

I have developed a VB GUI from the simple operator interface and it does all of things I need it to (run, abort, load, release, display results etc.) except one!

The user enters the serial number onto the VB panel and I need to store this into the sequence context so that my report gets named correctly and I can automatically create directories etc etc.

How do i store it? Help!

Marlon
0 Kudos
Message 1 of 2
(3,198 Views)
Marlon,

The serial number dialog by default is displayed by a DLL call within the PreUUT callback of the process model. This DLL call returns the string entered by the user and whether the user and chosen to stop.

In your case you would probably want the PreUUT callback to get the serial number from you VB panel instead of from the default serial number dialog box. There are different ways you could do this.

One way is to post a synchronous custom UIMessage from the PreUUT callback. Your OI interface would recieve the message and from it can obtain the sequence context reference (i.e. UIMessage.Thread.GetSequenceContext). Then you can write your serial number value to the sequence.

To post a custom UIMessage you can use an Action step with the Automatio
n adapter. Use Runstate.Thread as your ActiveX reference and then invoke the Thread.PostUIMessage method. events higher than 10000 are for custom UIMessages.

You would store the serial number in Locals.SerialNumber of the PreUUT callback using the SetValString method on the sequence context object. The last step in this callback then assigns it to Parameters.UUT.SerialNumber.
Message 2 of 2
(3,198 Views)