NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way for Logging MainSequence local variables / parameters to a modified database schema without using station globals?

Hello!
 
I modified the standard database schema for logging additional information to the database. Because the database logging feature runs in the SequentialModel.seq, I have to use station globals variables to pass information to my database.
Is there a way to pass parameters and/or local variables by reference from/to SequentialModel <-> MainSequence?
 
Regards,
 
M. Brosig
0 Kudos
Message 1 of 6
(3,953 Views)
What you have to do is add the properties you want to log to the database to the ResultList object. There are various ways to add properties to the ResultList:
1. All elements in the Step.Result object are added to the result list.
2. You can use the AddExtraResult method at the beginning of your sequence to register a property XXX for Result Collection. Whenever a step contains a property XXX it will be added to the ResultList .
3. You can use API-Functions to manually add properties to the ResultList object (SetValString, SetValNumber etc.). This method would be good if you want to log local variables.

After you added the wanted property ("RMSValue" for example) to the ResultList, you can use the property Logging.RMSValue to access the value of this property in the database-options or in the Database sequence of the process model.

Hope this helps!
0 Kudos
Message 2 of 6
(3,943 Views)
Thanks for your reply.
First of all, I am not so familiar to the ResultList object.
But when I realize the solution you wrote (1. and 2.), I log my properties for every step, because for every executed step I get a new index for ResultList.
Maybe you can explain solution 3. more in detail. I did not understand what I have to do.
 
When I add a new property to the ResultList, can I really access it with Logging.XXX (I thought with Logging.Step.Result.XXX)?
Also with AddExtraResult method I think I can only create properties from existing step types. Maybe I am wrong because I do not completely understand the whole mechanism.  
 
I want to add special information (temperature, humidity) for every tested UUT, not for every step.
Maybe I have to customize my process-model.
 
Regards, M. Brosig
0 Kudos
Message 3 of 6
(3,931 Views)
What I did was to use the string value test and log the result. In the vi I would set the output string to the local variable that I wanted to log, and I would set the string.limit to the same value, so the test would always pass and the data gets logged to the database.
0 Kudos
Message 4 of 6
(3,923 Views)
For this special case this is a very good idea, that would make it quite simple.

Anyway I want to answer the question of Borsig:
>>Maybe you can explain solution 3. more in detail. I did not understand what I have to do.

Specially for your case, that you want to log this data only ones per UUT the thirs solution would be the best. You can add a property during runtime by calling a method of the TestStand API through the ActiveX-Adapter. The method you need is (Depending on the Datatype you want to pass, I take up your example of the humidity as a number) SetValNumber. This method belongs to the PropertyObject Class. As Object Reference you have to pass "ThisContext". The first parameter(lookupString) Should be something like "Locals.ResultList[5].Humidity", the second(options) MUST be 1 (means "InsertIfMissing"), the last parameter(new value) contains the variable where you store your humidity, Loclas.Humidity for example.



As a conclusion, for your case maybe the solution posted by Odd_modem is the better one, because it does what you want and is not so complicated 😉

Hope this helps.
0 Kudos
Message 5 of 6
(3,920 Views)
Thank you both for the solutions. I tried both and they work fine.
But both do not cover my requirements for 100 percent. The problem is, for every additional variable I need a step and I can not log the variables into the UUT_RESULT database table.
So I prefer the following workaround:
In SequentialModel.seq I configured the Step Type 'UUT'. I added all my additional variable into this step type.
Then I pass a reference to the variable 'Locals.UUT' to the MainSequence Callback step in the SequentialModel.seq.
Now I can access and assign my additional variables from MySequence.seq.
Also I can now log all this data to the UUT_RESULT database table with 'Logging.UUT.xyz'.
I tried this and it works fine.
The disadvantage of this solution, I have to customize the ProcessModel, and it is more complex.
But for me it covers my requirements.
 
Regards,
 
Matthias Brosig
0 Kudos
Message 6 of 6
(3,906 Views)