NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read TestStand Variable value in LabVIEW

Solved!
Go to solution

Hi All,

 

I am trying to read the teststand variable(local/fileglobal) value in my LabVIEW VI.

Howerver when I am trying to run the VI I am facing an error saying "Error -17306 occurred at Unknown variable or property name 'Locals'."

I have attached my VI here for reference.

Any help is appreciated.

 

 

 

0 Kudos
Message 1 of 10
(6,099 Views)

Hi,

 

Could you attach the TestStand sequence as well?

 

Thanks,

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 2 of 10
(6,098 Views)

Hi LV_user1,

 

Are you trying to get the variable while the sequence is executing, or just pull the default value for the variable?

 

Sequence Context is only used for current executions. The code you attached never actually executes a test sequence, so you don't have a valid Sequence Context to reference. The NewEditContext Method you are using creates an approximation of what the actual runtime Sequence Context would be. This is also a context of the SequenceFile propertyobject rather than the Sequence propertyobject where the Locals variables container exist. (Sequence is a subproperty of SequenceFile)

 

If you are just looking to get the default value of the variable (as it is stored on disk), then the TestStand - Get Property Value function will not work for you (as it requires a valid Sequence Context). You can instead use the TestStand API to acquire a reference to the Sequence and then the Locals variable container, and finally the variable itself. Here's an example:

GetLocalString.PNG

 

FileGlobals are stored as subproperties of the SequenceFile propertyobject, so you don't need a reference to the Sequence to get them. Here's an example:

GetGlobalString.PNG

Steven Gloor
Staff Customer Engineer - CTA, CLD
Message 3 of 10
(6,081 Views)

I am trying to read the value of the executing sequence.

The seuqence starts its execution by the seperate VI . This VI is called once the teststand sequence starts executing.

I am able to read the value of variable of TestStand which is of String type.

However when I am trying to read the value of Boolean type variable , its not giving me the current value.

Its always give me the default value.

 

 

0 Kudos
Message 4 of 10
(6,015 Views)

have you got an example of how you are doing this?

 

Ray

0 Kudos
Message 5 of 10
(6,005 Views)

I have TS_OPInterface.vi wherein I am launching the TS and getting the reference of the Seq file which I want to execute.

This Seq file ref is then passed as an input to Read_TSParam.vi wherein I am trying to read the fileglobals values of TestStand in LabVIEW.

However I am able to get only the default values of these varaibles and not the run time values.

I have attached both VIs here for reference.

How can I ensure that the sequence file reference which I am passing is a valid one?

 

Download All
0 Kudos
Message 6 of 10
(5,980 Views)

Hi,

It's difficuilt to tell whether your sequencefile is running or not and where Read_TSParam.vi fits into the overall picture because it doesn't seem to be called directly from TS_OPInterface.vi. Maybe its called in Custom - Open Sequence Files.vi.

 

If all you have done is load the sequence file then you will not see the runtime version of the Fileglobals yet this is only available during the execution of the sequence. Also you should be using Property FileGlobalsDefaultValues.

 

 

0 Kudos
Message 7 of 10
(5,932 Views)

Hi, plz help me pecause i have some probleme, in my code i want to the uut serialnumber teststand to showlike a sting in labview ,ot e message popap

Download All
0 Kudos
Message 8 of 10
(4,901 Views)
Solution
Accepted by LV_user1

Are you trying to write the Serial Number to a Custom UI?

 

If so why don't you use the UIMessage to post the value and have an Event callback pick up the value to write to your indicator.

 

Regards
Ray Farmer
Message 9 of 10
(4,891 Views)

Thanks for all your replies. 🙂

As suggested by Ray , I am using custom UI messages now to communicate data between LV and TS. 

0 Kudos
Message 10 of 10
(4,428 Views)