NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Save value to BATCH_SERIAL_NUMBER without using batch model

Solved!
Go to solution

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.

 

0 Kudos
Message 1 of 7
(3,987 Views)

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!

 

 

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

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?

Download All
0 Kudos
Message 3 of 7
(3,955 Views)
Solution
Accepted by topic author EKL

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?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 7
(3,950 Views)

BTW- I think it's hilarious that you actually took a picture instead of a screen capture.  Loved it!

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

BRILLIANT!  THANK YOU!

0 Kudos
Message 6 of 7
(3,939 Views)

Probably trying to get more dynamic range out of the screen with the camera. Extra pixel density and all that.

CTA, CLA, MTFBWY
0 Kudos
Message 7 of 7
(3,932 Views)