NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically change Results Active Configuration

I'm using TestStand 2012 SP1.  I'd like to be able to configure the Active Configuration for results in the process model.  A station running our sequential model would set the Sequential Reporting configuration as the active configuaration while a station running a Batch Model would set the Batch Reporting as the active configuration.  Furthermore, if a station can do both, the application run would select the proper process model and it would then select the proper reporting configuration.

 

I've got configurations setup but need to know how to set the active configuration.  I don't want this on a  per sequence basis, but rather at the process model level so it is run once and done.  This would allow for developers to modify their configuration but still have the Batch or Sequential Reporting selected depending on what they are working on.

 

Thanks.

0 Kudos
Message 1 of 4
(4,328 Views)

I think you can override the ModelOptions callback sequence and set Parameters.ModelPluginConfigurationToLoad to the name of the configuration to load. If this works, you can move the override to StationCallbacks.seq, or modify the ModelOptions sequence in each model.

0 Kudos
Message 2 of 4
(4,325 Views)

Thanks James.  If I put into the test sequence, it works as you said.  But I can't put into the process model because it looks like this configuration is done in ModelSupport.seq and it's callback is used, not the process model.  I played around with the stationcallbacks.seq a bit but that didn't seem to do any good.  But I would rather have it in the Process Model anyway.  

 

I'm not sure if the process model callback of ModelOptions would ever get used?  Or how to set it up to make sure it is used?  I've only been able to get the client sequence or the modelsupport.seq sequence to work.  Any thoughts on getting this into the process model?

 

Thanks again!

0 Kudos
Message 3 of 4
(4,314 Views)

You are right about the ModelSupport.seq version of the callback being used. You could:

 

1. Modify the callback in ModelSupport.seq (or the call to it). You could determine what model you are being called from with something like:

     Find(RunState.Execution.GetModelSequenceFile().Path, "SequentialModel.seq", 0, True) != -1

 

2. Use StationCallbacks.seq. When I tested this, I was having trouble getting it to call the callback, but when I restarted the editor, it started working. Not sure if you need to restart after editing the stationcallbacks file (you shouldn't need to), but try that if you have trouble and please let me know if that was the issue.

 

3. As the first step in each model, you could load the configuration file, change the activeConfiguration, and resave the file, but (1) or (2) seem a bit less heavy handed to me.

0 Kudos
Message 4 of 4
(4,311 Views)