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.
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.
10-07-2011 04:40 PM - edited 10-07-2011 04:43 PM
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:
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...
Thx.
L.
Solved! Go to Solution.
10-07-2011 04:52 PM
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:
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.
10-07-2011 04:54 PM
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.
10-07-2011 05:01 PM
Ok, I am going to try from LV, as we don't want to be closed in the ATML for now.
Thx!
L
10-07-2011 05:07 PM - edited 10-07-2011 05:15 PM
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!
12-18-2014 10:32 AM
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