NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify ModelSupport.Seq

Hi All,

 

Can anyone explain how I can modify the Model Support.Seq to include additional user defined callbacks?

 

One of my plugins requires an additional callback but I am having difficulty getting it to work.

 

Is this possible?, If so what are the steps to do this?

 

I tried to copy one of the other plugins and simply rename it but come to quickly realise there is more to it.ModelSupport.png

 

Thank You

0 Kudos
Message 1 of 12
(4,102 Views)

From within the ModelSupport.seq, go to the sequence pane and insert a new sequence. Right-click that sequence and select "Sequence properties". You will be present with a dialog with two tabs (there is only one tab in a regular sequence). Select the model tab and select the item "Callback" as shown below.

Clipboard01.png

 

Marc Dubois
0 Kudos
Message 2 of 12
(4,086 Views)

AndyTT,

 

Just so we are on the same page with terminology, because I'm very confused by your question.  In a plugin you have entry points, those are the light blue sequences that have "Model Plugins -" at the beginning of their name.  These entry points are called by the process model at different times (depends on which model). 

 

Callbacks are either purple (engine) or green (model) sequences.  Do you need to add an engine callback or a model callback?  If so what is the purpose of the callback?  This might give me more help in directing you toward a more elegant solution. 

 

From the looks of your image it doesn't really look like you are talking about callbacks but rather plugin entry points.  If my assumption is correct then I would pose the question: what are you trying to do with the entry point?  Or more direct- what do you need that the current entry points don't offer?  I've written hundreds of plugins and have not come accross the case where I've needed a different entry point.  Granted everyone has different needs and there could be a reason out there. 

 

Just know that if you want to go down the rabbit hole of adding an entry point you need to insert calls into the process model, similar to how current entry points are being called.  This will cause you to modify the process model/s if so.  Also, when you generate a plugin your entry point won't exist.  So whoever is writing a plugin will need to know how to manually add the entry point you need.  Another aspect of this you need to take into account is the parameters for the entry point.  I would highly recommend you follow the same feel as existing entry points. 

 

These links might help if you haven't seen them:

https://www.ni.com/docs/en-US/bundle/teststand/page/process-model-plug-in-architecture.html

https://www.ni.com/en/support/documentation/supplemental/08/teststand-process-model-development-and-...

https://www.ni.com/en/support/documentation/supplemental/06/report-generation-explained.html

 

Let me know if you have specific questions.

 

Cheers,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 12
(4,078 Views)

modelsupportHelp.pngHi Mark,

 

From your answer I've just realised I've got my wires crossed,  Its not a callback I want to insert at all. Its just another sequence, one that is called if my plugin chooses to call it.

 

I am still stuck as to how to create it though. Can you help?

 

If we look inside "Model Plugins - UUT" from within ModelSupport.seq as an example. 

I don't understand what is going on in here. It calls another sequence but it calls it by expression.

 

If I want to copy this and create my own, can it be done? So all plugins can use this if they choose.

 It doesn't seem to let me create another variable within runtime variables -> RunOrders.

 

Thanks

0 Kudos
Message 4 of 12
(4,075 Views)

Hi Jiggawax,

 

You are right, I got my terminology completely mixed up! Smiley Frustrated

 

I need an extra entry point for a plugin I am working on because it does not really belong anywhere else within my process model. I want to put this entry point inside a loop with my MainSequence. As it is inside a loop, it causes all sorts of unnecessary processing to repeat tasks that only need executing once.

 

If I use any of the other entry points available there is a good chance my other plugins are going to be repeating themselves unnecessarily. I wanted to avoid this by giving it its own entry point.

 

It will only ever be called by this one plugin.

 

Thanks

0 Kudos
Message 5 of 12
(4,070 Views)

I am a little bit confused by both of your previous answers.

 

The idea of an entry point is that it is a sequence part of the process model that you call, it executes some pre-test tasks (like setting up the report), calls your mainsequence, and then do some post-test stuff.

 

You cannot call an entry point from your mainsequence.

 

Also, concerning ModelSupport.seq, this sequence file is in support of the process model. It is a layer that calls the plugin functions, depending of which plugin is selected by the operator. This is why some calls are dynamic.

 

So if you have created a plugin, you might decide to call it explicitly from a new entry point that you created. This is one approach.

 

If you want to call it from your mainsequence, why don't you just do it as a regular sequence? You can then use it the way you want and maybe you can run your mainsequence without a process model at all. That would be another approach.

Marc Dubois
0 Kudos
Message 6 of 12
(4,068 Views)

Hi Mark,

 

Not looking to call it from Mainsequence. My process model is a modified version of the sequential model. I have a loop surrounding the Mainsequence. The entry point I want to add will go within this loop. I don't want to use any of the other entry points as they don't need to be repeated.

 

Thanks

0 Kudos
Message 7 of 12
(4,063 Views)

@MarcDub wrote:

I am a little bit confused by both of your previous answers.

 

The idea of an entry point is that it is a sequence part of the process model that you call, it executes some pre-test tasks (like setting up the report), calls your mainsequence, and then do some post-test stuff.

 


MarcDub- we are talking about Plugin Entry Points.  Not execution or configuration entry points (which are types of sequences.  You should read the links I posted about plugins to understand more about them.

 

AndyTT,

Just look at how the other plugin entry points are being called and try to follow them.  You don't need to go through the ModelSupport.seq layer if you don't want to.  It is there simply so that all of the process models can share code and to modularize functions.  Most plugin calls are made through the ModelSupport.seq layer so you should be able to look at them and see how to call the plugin.  They are called by expression and looped on so they can call all of the plugins you have turned on.  You'll want to do the same thing.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 12
(4,056 Views)

I've mocked up what I think it would look like if you were to do this.  Check out the attached image.

 

Notice that depending on your parameters to your entry point you need to pass the right things from the model.  Most likely changing a lot of the variables to locals instead of parameters.  Also, pay attention to the looping and precondition as those will need to be changed as well and possibly variables created for them.

 

Hope this helps,

 

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 12
(4,054 Views)

Ok so sorry for another post but I might have misguided you a little.  It won't be as easy as calling like I showed in my image.  You were onto something with the RunOrders.  The only way to modify that container is to modify the NI_ModelPluginConfiguration datatype.  I would recommend against this as changing it could cause other issues.  For example you might have to go through and re-save all of the native process models, etc...  Initialize Model Plugins, inside of ModelSupport.seq, is what is populating that container and it is using ManagedModelSupport.dll under the hood.  You have the code for that assembly and could dive down in there but that might be a bit cumbersome. 

 

Is your goal to allow the user to enable and disable through the result processing dialog?  You could somehow look to see if a certain plugin exists in the ModelPluginConfiguration.Plugins array and check if it is enabled.  Then only call the entry point.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 10 of 12
(4,051 Views)