09-16-2020 02:40 AM - edited 09-16-2020 02:48 AM
Hello everyone,
I am working on a framework for production where I will have multiple Process Model Plugins.
I am using Batch Process Model.
What is the advised method to share data between plugins? (One plugin will be response for MES and the other one for communicating with PLC that controls the production line).
Currently I plan to use StationGlobals variables but it is not the best method as it makes the data visible also in Client Sequence and is prone to be changed by Test Engineers.
Any advise on what would be a better method?
I have seen something that under Parameters.ModelPlugin.PluginSpecific.RunTimeVariables.PerSocket[]
I can add variables but are not visible on other plugins.
Thank you,
Just a TSUser
Solved! Go to Solution.
09-16-2020 03:48 PM
What kind of data do you need to share? Is the data generated during run time or is it more static data (i.e. could come from a shared file)?
There are many options out there depending on what you want to do.
You can use TestStand Queues. There are steps or the API. Take your pick.
You can also use temporary global variables. https://forums.ni.com/t5/Example-Code/Using-TestStand-Temporary-Globals-Engine-TemporaryGlobals/ta-p...
If the data is more static then you can use the options for the plugin.
Ultimately, you should make your plugins work independently of each other if needed. If you don't then there is no reason not to put them in the same plugin.
09-18-2020 01:27 PM
Hello Jigg,
Thank you for your suggestions!
I really like the idea of temporary variables !!!
Thank you!
Just a TSUser
09-18-2020 01:47 PM
Jigg's point about keeping plugins independent is a good one, but for the sake of completeness I should mention that each plug-in entry point is passed a ModelPlugin parameter, which is the instance data for your plug-in. You can add fields or attributes either by editing the data types for your plug-in, or dynamically using the PropertyObject api.
Each plug-in entry point is also passed a ModelPluginConfiguration parameter, which can also have field or attributes added dynamically. In addition the Plugins sub-property in the ModelPluginConfiguration parameter contains an array with the ModelPlugin instance data for every plug-in instance.
The ModelPlugIn.RuntimeVariables sub-property, or the ModelPlugIn.RuntimeVariables.PerSocket[socketIndex] property is the 'intended' location to store data that is run-time only and is not edited as part of the configuration