NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically turning on and off the database logging

I am using Database Logging on the Fly model, and I would like to be able to disable database logging at the start of the PreUUTLoop callback, and then enable Database Logging at the start of the main sequence.
 
Unfortunately the Parameters.DatabaseOptions.DisableDatabaseLogging is not valid in the PreUUTLoop or PreUUT Callbacks. How do i accomplish this?
 
I am calling sequences from the PreUUTLoop and PreUUT Callbacks, which also get called from the Main Sequence, in the Main Sequence I want some of the subsequent sub-sequences steps to be logged, whereas in the PreUUTLoop and PreUUT I don't want any of the steps logged.
0 Kudos
Message 1 of 4
(3,226 Views)

ADL -

The entry point sequences in the default process models have SequenceCall steps to call the Configure Post Result Callbacks sequence in the model file. One step is called Setup Post Result Callbacks and the other is called Cleanup Post Result Callbacks. Looking at the sequence they call it has steps to enable or disable the model callbacks that the on-the-fly feature. The steps for enabling or disabling of the callbacks could be moved to right before and right after the MainSequence call.

Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 4
(3,214 Views)

Scott,

I'm not sure whether you're suggesting I move inside the Sequential model the Sequence Call:

"Setup Post Results Callback" to the line before "Main Sequence Callback", within the Test UUTs.

Or should I just be moving some portion of the "Setup Post Results Callback" as before.

A.

 

0 Kudos
Message 3 of 4
(3,198 Views)
Hey ADL,

I believe what Scott was referring to is inside the Test UUTs or Single pass execution entry point there is a step called Setup Post Results Callback.  If you right click on this sequence and open the sequence it is calling, you will see this is where on the fly database logging is setup.  You could copy the steps to set up on the fly database logging right before your mainsequence callback in the process model. 

From your post, I believe you initially have on the fly logging turned on, and you want it to just log for the mainsequence.  I believe this could be accomplished by setting RunState.Root.Locals.DatabaseOptions.UseOnTheFlyReporting to true or false whether you would like it on or off.  The only danger in setting this is that you will need to originally on the fly logging on for it to work properly.  This is because the logging object is being created in the sequence I mentioned originally whether your initial settings have on the fly logging on or off.   Hope this helps!
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,174 Views)