NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Number info not updating in TestStand UI controls when set via PreUUT callback

Hi all,
I have a problem with Serial Numbers not being shown in UI controls (ListBar specifically) using TestStand 3.5, Batch Process Model, Single Pass entry point. I'm using a custom operator interface (C#).
 
I can add/override the PreUUT callback and programmatically set the serial numbers for each of my UUTs (Parameters.UUT.SerialNumber), and the report correctly picks up my s/n changes, however the UI controls do not show the updated serial numbers during or after executions - is there some caching going on or is there another property that needs setting?
 
Thanks.
0 Kudos
Message 1 of 7
(6,282 Views)
Hi,
 
By default the Serial number is not used with the Single Pass entry point. The PreUUT sequence is not called in the default process model for Single Pass  - Test Soceket Entry Point like it is in the Test UUTs version.
 
Therefore you will have to modify the proccess model.
 
Regards
Ray Farmer
Regards
Ray Farmer
Message 2 of 7
(6,248 Views)

Hi Ray, thanks

I had modified the default batch process model to include the PreUUT callback in the Single Pass entry point sequence (copied it from Test UUTs and placed it in the 'equivalent' position in single pass entry point sequence) and used this callback to change the socket serial numbers. As I say all is well with this, in that the serial numbers appear in the report once my batch sequence is run, so the model is picking them up from PreUUT. But the problem is that the UI controls do not honour the change in serial numbers. The listbar control I'm using does not display the serial numbers (display expression does include it) - seems it is getting its info from an earlier or cached version of the modeldata? Im looking for the info on how to get these controls to display the changes (the listbar contents are read only once data bound).

I have looked through the forums for a similar problem, nearest I could find was http://forums.ni.com/ni/board/message?board.id=330&message.id=11337&query.id=23024, where Srini could not get the changed serial numbers to display in an NI combobox either.

Any pointers would be greatly appreciated ..

Regards

Gary

0 Kudos
Message 3 of 7
(6,234 Views)
Hey Gary,
 
Why are you not using the TestUUTs execution? 
 
To me it seems that since the listbar is getting updated with UIMessages and since the TestUUTs execution is the only one that "technically" uses serial numbers then in that execution somewhere a UIMessage is being sent to update the listbar.  Since you aren't using that execution you are probably not sending the correct UIMessages to update the listbar.
 
This is just a hunch.   I will have to play around with it some to see for sure but that seems to me like what's happening.
 
Regards,
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 7
(6,210 Views)

Hi Gary,

As jigg mentioned, the Test UUTs -Test Socket Entry Point performs a Thread.PostUIMessage of UIMsg_ModelState_Identified which you should capture and grab the serial number sent your OI.

Hope this points you in the right directions.

Regards

Ray

Regards
Ray Farmer
Message 5 of 7
(6,206 Views)

Thanks Ray!  I couldn't find the UIMessage  🙂

Gary,

There is a function...er sorry method.. called ConnectListBarPages in your MainForm.cs file.  It looks like this:

  private void ConnectListBarPages()
  {
   // connect listbar page 0 to SequenceFileList
   this.axSequenceFileViewMgr.ConnectSequenceFileList(this.axListBar.Pages[0], false);

   // connect listbar page 1 to ExecutionList
   ExecutionListConnection connection = this.axExecutionViewMgr.ConnectExecutionList(this.axListBar.Pages[1]);
   // display the execution name on the first line, the serial number (if any) on the next line, the socket index (if any) on the next line, and the model execution state on the last line (the expression string looks complicated here because we have to escape the quotes the C# compiler.)
   connection.DisplayExpression = @"""%CurrentExecution%\n"" + (""%UUTSerialNumber%"" == """" ? """" : (ResStr(""TSUI_OI_MAIN_PANEL"", ""SERIAL_NUMBER"") + "" %UUTSerialNumber%\n"")) + (""%TestSocketIndex%"" == """" ? """" : ResStr(""TSUI_OI_MAIN_PANEL"", ""SOCKET_NUMBER"") + "" %TestSocketIndex%\n"") + ""%ModelState%""";
  }

 

You see that huge string witht the @ sign at the beginning.  That is using resource strings to pull the serial number from your execution.  If you look closely at this string you'll see the CurrentExecution, UUTSerialNumber, TestSocketIndex, and ModelState being pulled out to update the DisplayExpression.  Which is what you see in the listbar.  See attached image.  All these properties (except currentExecution) are part of your ModelData in your process model.  If those don't get updated then according to the logic in the string depends on what gets put in there. 

Hope this helps clarify a little.  It gets tricky when dealing with multithreading.

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 7
(6,201 Views)

Folks, thanks very much for your help.

Success! I've copied the Test UUTs step - Send Model State Message 'Identified' - which posts the UIMsg_ModelState_Identified message, into the Single Pass Test Socket Entry Point sequnce, just after the point where I programmatically set the serial numbers via my added PreUUT callback. Now the ListBar correctly displays the serial numbers! (I've also added 2 changes to programmatically set the test socket count and batch serial number)

The reason I am not using the Test UUTs entry point is because I only want 1 pass through the batch sequence. I also need to programmatically set serial numbers etc, and I don't want the batch serial number dialog appearing or re-appearing or any looping on the batch. The Single Pass seemed to be what I needed - a single pass through the test. I've seen other posts describing how to modify the TestUUTs sequence/override callbacks to supress/modify the serial number dialog, and to force it to exit the controlling sequence after one loop/test, but it seemed just as much work as changing the Single Pass entry point.

Thanks again,

Gary

0 Kudos
Message 7 of 7
(6,187 Views)