07-11-2011 04:27 PM
How can a value be saved to the field BATCH_SERIAL_NUMBER in table UUT_RESULT when using the sequential or parallel model? Can a "batch of one" be run with a default value set by the sequence (i.e. without user intervention)? Thanks.
Solved! Go to Solution.
07-11-2011 05:38 PM
Why yes there is a way.....
The trick is setting the value in your process model. In the TestUUTs sequence in your process model there is a Local called UUT which is a datatype with BatchSerialNumber in it. If you set that variable it will write to the DB.
The best way to set that variable is to override the PreUUT callback because then it comes to you as a parameter and you can just use a statement step to set it. Parameters.UUT.BatchSerialNumber = "Whatever you like".
The worst way, but also works, is to set it from within your MainSequence by using RunState.Root.Locals.UUT.BatchSerialNumber = "Whatever you like".
Hope this helps!
07-12-2011 11:45 AM
Thanks for the reply. I entered a value in the BatchSerialNumber variable but it didn't get written to the database. The first picture shows where I tried to add the value in both the PreUUT and PostUUT sequences, and the second picture shows that RunState.Root doesn't expand any further. Where exactly should this be done?
07-12-2011 12:29 PM
Option A: You have to put a step in that sequence that sets that variable. I just did it and it worked perfectly for me. So in the PreUUT callback place a statement step with the following in it: Parameters.UUT.BatchSerialNumber = "Whatever you like". Now you should see the table populate.
Option B: RunState doesn't show all the variables during edit time. That's because it doesn't know where to find stuff because it doesn't know what is in the process model or eve which process model you will be using. However, I promise that if you put this statement in your MainSequence it will work: RunState.Root.Locals.UUT.BatchSerialNumber = "Whatever you like" If you were to put a breakpoint and look for that variable you will find it. I also ran this and it worked for me.
Are you using the default database settings? Is that picture during execution? You won't see it populated except during execution. Is your table showing anything?
07-12-2011 12:31 PM
BTW- I think it's hilarious that you actually took a picture instead of a screen capture. Loved it!
07-12-2011 01:20 PM
BRILLIANT! THANK YOU!
07-12-2011 01:28 PM
Probably trying to get more dynamic range out of the screen with the camera. Extra pixel density and all that.