NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access a Station variable using Local Variable value

Solved!
Go to solution

Hello,

I'm trying to access the value of an Station Global depending on the value from a Local variable that will populate at runtime.

Eg. Instead of pointing to my Station Global in the following way: StationGlobals.Instrument1.Test

CesM_0-1645217284150.png

 


I want to use the value from a Local variable (Locals.Instrument) that will populate with the values 'Instrument1', Instrument2' or 'Instrument3' depending on the test.

Something like this:

StationGlobals.'Locals.Instrument'.Test

Is that something possible?

I hope my explanation is clear.
Thank you.

0 Kudos
Message 1 of 3
(866 Views)
Solution
Accepted by topic author CesM

You can do it in many ways. See attached example.

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
Message 2 of 3
(831 Views)

I really appreciate your help!

0 Kudos
Message 3 of 3
(821 Views)