NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Add Data stored in locals to report with offline results processing

Solved!
Go to solution

Hi Forum

 

I am trying to extend the database scheme to save the relevant data in a flat structure in uut_result. For this purpose I save some data in locals during the test and try to add it to the table. Unfortunately this context local seems to be unavailable at processing time, I get the error message "Unknown variable or property name Locals.xyz".

 

Is there a way to access the content of the Locals.xyz during offline processing?

 

Thanks, Raphael

0 Kudos
Message 1 of 20
(3,449 Views)

Hi Raphael,

 

Well Locals are by nature... local to your test sequence...

Therefore if you build the report at the end of the test, well they are gone.

 

If the data you want to add are related to the UUT, the best way is to add your data into UUT.AdditionalData.

Otherwise, you can still use Additional Result step to feed your result list.

Then you'd have to dive into the result list at runtime (check for the accurate callback) to extract the data needed. And add them into a specific variable (can be local this time) that is linked to your DB schema.

 

Another way is to use persistant data accross executions : StationGlobals. I find this solution ugly, but hey what's in there will stay until overwritten... so it might work for your use case.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 2 of 20
(3,426 Views)

Hi CyGa

 

thanks for your explanation!

 

The issue with additional data is that I have to exclude it while processing the results into the database otherwise it fills my result database due to the database scheme. Can I still access data stored there even though I exclude it in the database options?

 

The station globals would work, but as you write it is ugly. And it would probably break the asynchronous nature of my results processing.

 

Thanks, Raphael

0 Kudos
Message 3 of 20
(3,421 Views)

Ok,

I see that you're using the parallel process model.

Something to test maybe is to us FileGlobals and to share them within your execution between sequence calls.

This way they would be available in your process model for your test socket entry point.

Then referring the file globals in your schema.

The other way would be to specialise your process model : you could add FileGlobals into your process model seq file, and write into it from your sequence file (RunState.Root.FileGlobals).

Then use the FG into your schema.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 4 of 20
(3,414 Views)

I tried adding the Data to the Additional Data with this Statement Step:

#NoValidation(Parameters.UUT.AdditionalData.SetValNumber("LimitCMUvoltageDelta",0,Locals.LimitCMUvoltageDelta))

unfortunately I get Error -17306. What is the correct path to add this item to?

2020-12-01_14-41-10.png

0 Kudos
Message 5 of 20
(3,366 Views)

I also tried another solution which seems to fit the parallel model, again no success and the same error as before:

 

#NoValidation(Parameters.ModelData.TestSockets[ThisContext.RunState.TestSockets.MyIndex].UUT.AdditionalData.SetValNumber("LimitCMUvoltageDelta",0,Locals.LimitCMUvoltageDelta))

 

https://forums.ni.com/t5/NI-TestStand/Additional-data-in-ModelData-Testsockets-0-UUT/td-p/3814747

0 Kudos
Message 6 of 20
(3,363 Views)

The problem with writing the values was the missing container Parameters.UUT.

Since I created this manually I can write. Unfortunately reading the data from Parameters.UUT still fails. Where is this content copied to?

0 Kudos
Message 7 of 20
(3,345 Views)

Where do you exactly store that variables ?

 

The parallel model has 2 entry points.

One for the 'controller' and one used by each test socket.

These are 'not' sharing their values.

 

From your test sequence, if you write into RunState.Root.Locals, you'll be able to write data into the Locals of your test socket entry point.

It'll then be available from all the callbacks related to that entry point using the same path (RunState.Root.Locals.xxx).

 

If you need to get your data into the controller entry point because you need them to be available from the callbacks trigger by this controller entry point, then you've got to go 1 step upper.

I can't try it myself now because I do not have access to TS right now, but If I remember well, if you attack RunState.Root.Root.Locals (some doubling the Root variable in your access path) you'll be able to write into the Locals of the controller entry point.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 8 of 20
(3,329 Views)

Hello CyGa

 

the RunState.Root.Root.Locals.xy seems to be available at the time I do the offline processing. Thanks!

 

However, there seems to be a problem with the database connection, I will have to check on monday if it runs through.

 

Raphael

0 Kudos
Message 9 of 20
(3,321 Views)

Hello CyGa

 

unfortunately this also doesn't work:

 

2020-12-07_09-56-45.png

Basically there are two problems masking the issue, if the database connection doesn't work the error reading the variable doesn't appear and the changes to the database scheme are not always applied before restarting the offline processing tool 2017 32bit.

 

Raphael

0 Kudos
Message 10 of 20
(3,269 Views)