From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Output Variable for a Real Time Sequence

Solved!
Go to solution

In VS 2011, I have a Step Voltage real time sequence that sets one AO to a given voltage for a given amount of time, then resets the output to 0.

 

Just before setting the output back to 0, I want to read my system's response to this stimulus from one an AI I call StepResponse. To do so I place this into FinalValue that I defined as a Variable in my sequence. That is, it is neither a Parameters nor a Local Variable. 

 

Now, how can I get this FinalValue out ?? I don't see any way on how to "plumb" this variable to one of my user variable... I was able to do that in VS2010 with  the legacy stimulus editor. Now I am stumped.

 

Here is the sequence:

 

sequence.jpg 

and here is the stimulus profile and the parameters below it. I can Set the parameters fine via the LV API, or run from the Stimulus Editor. But I fail to get this FinalValue out... Smiley Mad

  

stimulus.jpg

 

Thx.

L.

0 Kudos
Message 1 of 6
(6,638 Views)
Solution
Accepted by topic author LDBM

The return variable for a sequence (FinalValue in your case) is returned to the caller once the sequence completes as the result of that sequence. In your example the caller is the stimulus profile you have configured. In a stimulus profile, two relevant things will happend based on the return variable value of a sequence that is called:

 

  1. The return variable value will get logged in the ATML test result file for the stimulus profile
  2. You can set up an Output Evaluation for the sequence call to test do a basic test on the return variable to determine a Pass/Fail result. For a numeric return variable such as FinalValue, you can do a Numeric Bounds Check to test whether the value is in or out of some specified limits. For a Boolean return value, you can translate that either directly into a Pass/Fail result, or you can invert the logic so that False implies Pass.

Also, from the LabVIEW API there is a function you can call after the sequence completes to programmatically grab the return value.

 

However, in your sequence after you store the StepResponse value in the return variable, you reset it to zero before the sequence completes. So your sequence will always return zero. I think you would want to delete that line and leave FinalValue as it is so that you will get the latched StepResponse value back instead of zero.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 6
(6,633 Views)

Return variable values can also be used when you create sequences to be called as subsequences. Suppose I have the sequence listed below. I can call this as a subsequence as follows: z = sum(10, 20). z will get the value 30.

 

  • Sum.nivsseq
    • Variables
      • Return Variable: (double) Output
      • Parameters
        • (double) x
        • (double) y
    • Code
      • Setup
      • Main
        • Output = x+y
      • CleanUp
Jarrod S.
National Instruments
0 Kudos
Message 3 of 6
(6,632 Views)

Ok, I am going to try from LV, as we don't want to be closed in the ATML for now.

Thx!

L

0 Kudos
Message 4 of 6
(6,630 Views)

You wrote:

"Also, from the LabVIEW API there is a function you can call after the sequence completes to programmatically grab the return value."

 

Is it the NI_VS Sequence Execution Interface.lvlib:Get Sequence Return Value.vi?

 

L

 

==> Answering my own question: YES! Smiley Very Happy

Message 5 of 6
(6,629 Views)

I know this is old but how can I get the return value from the waituntilsettled sequence that's built into VeriStand when it's called within a sequence file?

I would like to use it to trigger other events if the function times out.

 

Thanks!


@Jarrod_S. wrote:

Return variable values can also be used when you create sequences to be called as subsequences. Suppose I have the sequence listed below. I can call this as a subsequence as follows: z = sum(10, 20). z will get the value 30.

 

  • Sum.nivsseq
    • Variables
      • Return Variable: (double) Output
      • Parameters
        • (double) x
        • (double) y
    • Code
      • Setup
      • Main
        • Output = x+y
      • CleanUp

 

0 Kudos
Message 6 of 6
(5,318 Views)