08-01-2018 10:01 AM - edited 08-01-2018 10:03 AM
Hi All,
I have a vi that is called during PreUUT to acquire various pieces of user input. I want to have this information available to my results plugin. I am modifying the process model, not using callbacks.
The process model is based on the sequential process model. I am trying to pass information into the "Model Plugin - UUT Start" sequence but I have discovered it is a runtime call and the file path is only available at run time.
I am obviously going about this the wrong way. How should it be done?
Thanks
08-01-2018 10:36 AM
Presuming the information is per-socket, add a field to the <MyPlugin>PerSocketRuntimeVariables data type in your plugin. In PreUUT, iterate through Parameters.ModelPluginConfiguration.Plugins until you find the element with Parameters.ModelPluginConfiguration.Plugins[Locals.PluginIndex].Base.SequenceFileName == "YourPluginSequenceFileName.seq" (there could be more than one if you've configured more than one instance of your plugin)
Then set
Parameters.ModelPluginConfiguration.Plugins[Locals.PluginIndex].PluginSpecific.RuntimeVariables.PerSocket[RunState.TestSockets.MyIndex].YourNewProperty = DataYouDetermineInPreUUT
Now, you can get the data in your plugin entry points at Parameters.ModelPlugin.PluginSpecific.RuntimeVariables.PerSocket[RunState.TestSockets.MyIndex].YourNewProperty
08-02-2018 02:57 AM
Thank you for the detailed response James. I must admit I found it a little hard to understand. I am still fairly new to Teststand.
With your method, does that mean I have to modify "ModelSupport" sequence? Ideally I don't want to touch that sequence.
I have managed to programmatically add my data to the Additional Data container. This field is already included in all sequence files.
Thanks
08-06-2018 02:45 PM
You don't need to modify ModelSupport.seq
You should be able to set the data in the VI you mentioned or alternatively, in the PreUUT callback that calls it.
Now, if you were already calling your vi from ModelSupport, then it begs the question of why you don't just call it from your plugin to begin with instead. If the answer is that you want the data shared by multiple plugins and only computed once, you could either used some sort of global variable in your code module (at which point it is a LabVIEW question and out of my jurisdiction), or you could compute and set the data in an "add-on" plugin that always runs first. Most likely, this is not what you meant. In that case, just ignore what I said in this paragraph.