02-04-2008 08:37 AM
02-04-2008 04:03 PM
02-05-2008 04:36 AM
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
02-05-2008 11:40 AM
02-05-2008 03:29 PM
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
02-05-2008 04:00 PM
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,
02-06-2008 05:08 AM
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