NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

executing locked sequence file

Solved!
Go to solution

Having some trouble getting a locked (password protected, not viewable) sequence file to execute (TS2012):

Saved sequence file as password protected / locked / not viewable.

it appears properly as not viewable in the sequence editor and any UIs.

I can start an execution through my custom process model, but partway through the execution the process model references "

RunState.ProcessModelClient.Data.FileGlobalDefaults.***", and I get an error specifying that

"The lookup string RunState.ProcessModelClient.Data.FileGlobalDefaults.*** references a protected object that is locked."

http://zone.ni.com/reference/en-XX/help/370052M-01/tsref/infotopics/db_seq_file_prop_adv_tab/ suggests that the API is not supposed to be limited to access during execution.

 

Any recomendations as to how to allow the process model access to Client Sequence File information during execution when the client sequence file is locked as not viewable?

 

 

 

 

0 Kudos
Message 1 of 5
(4,652 Views)

What exactly is the code doing that gives you this error? What API call is giving the error?

 

-Doug

0 Kudos
Message 2 of 5
(4,609 Views)

Code is a statement step in the process model

(Post)Expression for statement is

Locals.FileGlobals.VariableName=#NoValidation(RunState.ProcessModelClient.Data.FileGlobalDefaults.VariableName)

 (replace "VariableName" with actual name of variable)  "VariableName" is instance of a type-def'd container (contains 2 booleans and a typedef'd container that itself contains 3 booleans)

(Yes we do have a locals.* container named "FileGlobals").

 

The goal here is we have some configuration settings stored as FileGlobals.* in the client sequence file (I realize there are some other ways we could do this, but we're kinda stuck with this architecture for now) and we are copying those values to locations in the process model so we don't need to keep referencing the client sequence FileGlobals.

 

0 Kudos
Message 3 of 5
(4,603 Views)
Solution
Accepted by topic author warren_scott

The edit time copy of the file globals are protected (even at runtime), however you can access the runtime copy of the file globals programmatically as follows:

 

#NoValidation(Locals.FileGlobals.VariableName = *RunState.Execution.GetFileGlobals(RunState.ProcessModelClient).GetPropertyObject("VariableName", 0))

 

Another option is to use the parameters of a sequence instead. Those are unprotected by default, even at edit time. For example:

 

#NoValidation(Locals.FileGlobals.VariableName = RunState.ProcessModelClient.Data.Seq["MainSequence"].Parameters.VariableName)

 

Hope this helps. Let me know if you have any questions related to this.

-Doug

0 Kudos
Message 4 of 5
(4,580 Views)

Doug --

 

Thanks -- your suggestion worked just right.

Things are working well now.

Warren

0 Kudos
Message 5 of 5
(4,561 Views)