NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing measured data from further steps

Solved!
Go to solution

Hi,

 

Somewhere in the sequence I'm doing three tests by looping a group of steps using ForEach/End statement. One of these steps is a numeric limit test which measured data I'd like to check/get later on. If it had been a step without looping I'd have used the code like that:

 

RunState.SequenceFile.Data.Seq["TX Gain"].Main["ID#:V+IpmxTrKEKtowTTfXED+C"/* Unique Id of 'TX Gain' */].Result.Measurement["Measurement 0"].Data

 

 

However, how can distinquish the command above to query the data collected by first, second and third loop? I need to access all three results and, I don't want to create another variables.

0 Kudos
Message 1 of 12
(5,631 Views)
If you look in Locals.ResultList (at runtime) you will be able to . If you're always going to have a consistent number of results, you can look up your data by index (assuming it is, in fact, reported). If you want to be really sure, you could write a subroutine to search the ResultList array for results with the step name 'TX Gain'.
0 Kudos
Message 2 of 12
(5,626 Views)

Unfortunatelly it doesn't work.

 

Executing the code below:

 

RunState.SequenceFile.Data.Seq["TX Gain"].Main["ID#:V+IpmxTrKEKtowTTfXED+C"/* Unique Id of 'TX Gain' */].Locals.ResultList

I realised that the ResultList array is empty 😞

 

Does it matter that I'm calling it from another subsequence?

0 Kudos
Message 3 of 12
(5,588 Views)
Solution
Accepted by topic author MimiKLM
You would need to use RunState.Caller.RunState.SequenceFile...... Regards Ray Farmer
Regards
Ray Farmer
Message 4 of 12
(5,581 Views)

hi,

 

Do you need only measured value ?

 

Why not using a variable ?

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 12
(5,577 Views)

j_dodek wrote:

 

Why not using a variable ?

 


Because data is already in memory. You have just grab it. Why duplicate the same data?

0 Kudos
Message 6 of 12
(5,567 Views)

Ray,

 

Any word of explanation why I have to that this way? Why I need to add 'RunState.Caller.' prefix?

Message Edited by MimiKLM on 06-10-2010 06:58 AM
0 Kudos
Message 7 of 12
(5,565 Views)

.. To keep it simple !

 

there are often more than 1 GB of RAM

doest  it not make sense to spare some bytes for a variable for a few more readability ?

 

And for your task you need only one variable or best for saving RAM 

i would use a reference to the stuff in memory.

 

Juergen 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 8 of 12
(5,559 Views)

Like j_dodek says, unless the data you're dealing with is to the tune of a hundreds of megabytes, I wouldn't sweat duplicating it. KISS, as they say.

 

That said, to query the ResultList you're interested in, you can either pass the ResultList into your subsequence as a parameter or you can do as Ray suggested and use RunState.Caller. To get the ResultList, you would use RunState.Caller.Locals.ResultList.

0 Kudos
Message 9 of 12
(5,552 Views)

Hi,

 

 

When you use "Runstate....." this is for the Sequence that is currently executing. when you make a SequenceCall (ie call a sequence) the RunState.DepthLevel increasing and the RunState.Caller.RunState is now the properties for the Caller Sequence and RunState becomes the properties for the called Sequence.

 

eg if a sequence called SequenceA is running which was called from MainSequence which was launched for the ProcessModel entry level Single Pass

RunState.SequenceFile.... is for the currently executing "Sequence A"

RunState.Caller.RunState.SequenceFile.. would be for "MainSequence"

RunState.Caller.RunState.Caller.RunState.SequenceFile.... would be for "Single Pass "

 

 

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 10 of 12
(5,548 Views)