NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access/dereference a variable whose path is updated in running mode?

Solved!
Go to solution

Good afternoon,

I have a TS sequence where the user can select the destination storage path of a variable (array of numbers dynamically created) and that path will be stored into another variable (string).

 

I need to access the array of numbers (whose path is dynamic) to determine its number of elements, get its numeric values, but i couldn´t make it.

 

E.g.: FileGlobals.DUT.MPI_storagePath = "FileGlobals.Product.MPI" (string with destination path)

        FileGlobals.Product.MPI[0...3]   (array of numbers)

 

Thanks in advance!

Regards.

 

0 Kudos
Message 1 of 4
(2,386 Views)

Trying to wrap my head around what you are trying to do here as it is not very clear.  Do you want to convert the array of numbers to a string?  or do you want to just get one element from the array and put it to a string?

 

The Str() function allows any datatype to become a string.  So FileGlobals.DUT.MPI_storagePath = Str(FileGlobals.Product.MPI) which will be something like {0, 1, 5, 8 , 2, etc...}.

 

Or if you are trying to store the lookup string (I think that's what you mean by address) then you can use the evaluate function.

Example: Evaluate(FileGlobals.DUT.MPI_storagePath)[0] to get element 0 or Evaluate(FileGlobals.DUT.MPI_storagePath).GetNumElements() to get the number of elements.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(2,343 Views)
Solution
Accepted by AlePinto

Sorry I meant GetNumElements(Evaluate(FileGlobals.DUT.MPI_storagePath))

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 3 of 4
(2,337 Views)

Thanks Jigg!

I didn´t realize that with such a simple expression it can be solved.

Alejandro

0 Kudos
Message 4 of 4
(2,199 Views)