NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access the ProcessModelClient FileGlobals from the Process Model?

How can I access the FileGlobals int he client from the process model?

0 Kudos
Message 1 of 6
(113 Views)

Eventually found this: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YH6dCAG&l=en-US

 

Apparently to edit the runtime ProcessModelClient from the ProcessModel you need to use the activeX API.

 

EDIT:  This example may be wrong.  It passes the argument runState.SequenceFile to the API Call (sequenceFileParam in the module parameters), but that will reference the file you are running from.  If you are running from the process model, I think you need to use RunState.Root.RunState.ProcessModelClient to access your sequence.

 

I also had to store the Object Reference returned in the Get FileGlobals() call to a new local, and passed that to subsequence API calls to modify it.  You can't pass the object reference out to "FileGlobals", this makes no sense.

 

 

0 Kudos
Message 2 of 6
(88 Views)

@Jed_Davidow wrote:

How can I access the FileGlobals int he client from the process model?


But that means, you are directly coupling your ProcessModel to your sequence file.... i that a good idea?

0 Kudos
Message 3 of 6
(73 Views)

@Oli_Wachno wrote:


But that means, you are directly coupling your ProcessModel to your sequence file.... i that a good idea?


Basically what I am doing is generating a path that is used throughout our code, in both the Client and in shared sub-sequences called by the Client.  This is a universal path for all our tests, conforming to a design/engineering decision.

 

All our tests use this process model (or it's equivalent parallel version).

 

So now this path is calculated in the processModel and pushed into the clients automatically; and it's available in a convenient location (Client FileGlobals, rather than Engine.TemporaryGlobals or something like that).  I am running it in ProcessSetup, so it can be over-written.

 

I suppose I could override ProcessSetup with a shared sequence utility too; but if I am going to require it in every sequence we run, why not embed it in our custom process model?

0 Kudos
Message 4 of 6
(64 Views)

I am avoiding cyclic dependencies whereever I can....  that's why I am asking

 

The issue I am seeing with your approach is "pushing" the data to the client sequence...

Since you are modifying the ProcessModel anyway, why don't you save that path as a local in your entry point(s)? Thus it would be accessible in any client sequence file via RunState.Root.Locals like the socket information.

 

 

 

0 Kudos
Message 5 of 6
(50 Views)

@Oli_Wachno wrote:

 

Since you are modifying the ProcessModel anyway, why don't you save that path as a local in your entry point(s)? Thus it would be accessible in any client sequence file via RunState.Root.Locals like the socket information.

 

That is actually a fantastic idea.

0 Kudos
Message 6 of 6
(39 Views)