NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass results string back to calling sequence

I inserted a sequence call (Firmware Version below)
then made it a string value test
 
the original goal was to put data in the fields of the report (Measurement,Low Limit)
 

Begin Sequence: MainSequence
(C:\RPDA_TEST_V2_0\RPDA_TEST V3_0.seq)
Step Status Measurement Units Limits
Low Limit High Limit Comparison Type
Check Main Battery Passed          
Check Expansion Battery Passed          
Idle Current Test Skipped          
Firmware Version Passed 12345_67   12345_67   IgnoreCase
Built-In Test Skipped          
Secure Data Disk Passed          
USB Test Passed          

What I did was use a station global as the data source
What I want to do is use the  Step.Result.String (the default source)

how do I return a result string to a sequnce call?

I would also like to know how to supply data for the other items in the report (such as units)
I did find that the property browser was the way to get info in there, only with the string value test type

 

 

 

 

0 Kudos
Message 1 of 7
(4,299 Views)
Hi,
 
Why not use the Parameters of the Sequence or I have mis-read your question?
 
Parameters.ResultStr = Step.Result.String
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 7
(4,268 Views)
it seems to me that parameters are inputs to the sequence
and I want to:
 
go into a subsequnce
get a string with one step (labview) 
process it (use a couple of other steps)
then pass the string back out of the sequence as the result of the subsequence
 
 
But I don't know how to assign my string as the result of the sequnce
step.result    seems to mean the current step not the overall subsequnce step
0 Kudos
Message 3 of 7
(4,258 Views)

Hi,

No parameters can be both.

By default a parameter is set to "Pass By Reference". This is a bit like the C function argument i.e. MyFunc(char *arg). Which means you can pass a value into the Sequence, modify it and have it return the modified value back to the caller.

If the parameter is set to "Pass By Value". This means you can not return the modified value back to the caller.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 7
(4,254 Views)

Hi,

Here is a small example (its a TS4.1 version and TS3.5 version)

Regards

Ray Farmer

Regards
Ray Farmer
Download All
0 Kudos
Message 5 of 7
(4,252 Views)

Thanks Ray that helped a lot

the thing to do is assign   Step.Result.String  to the parameter that I use to pass the results back

then the string value test can work with the default source

I think the reason it was such a struggle for me is that the labview steps automatically give me parameters to assign stuff to
and the sequence step does not

 

 

 

0 Kudos
Message 6 of 7
(4,249 Views)

Hello Rusty Strings,

Thank you for posting on the NI Discussion Forums.  You could also do a couple of different things to pass a string parameter back to a calling sequence.  One method is to pass the input parameter by reference.  To pass a value by reference, you can simply go to the parameter in the Variables pane of the sub-sequence, right-click on it, and click on “Pass by Reference” so that it is checked.  When this is enabled, the value of the parameter that the calling sequence passes will change according to the subsequence’s own parameter value.  For example, if CallingSequence1 passes string parameter string1 with value “one” to string parameter stringA in SubSequenceA , stringA will take on the value “one”.  If stringA is then re-assigned the value “two” during the execution of SubSequenceA, string1 will also have the value “two” in CallingSequence1.

You could also use RunState.CallingStep.Sequence.Parameters to pass a value directly to an existing parameter in the calling sequence.  Passing by reference is the preferred method for its modularity, since it does not write back to an existing parameter by calling its name.

Examine and run the attached sequence file to observe both of these methods.  SeqA passes the value using “Pass by Reference”, and SeqB passes the value using the property listed above.

As far as supplying data to the items in your report, this is all done automatically when you run any kind of test.  For example, the String Value Test automatically fills in the results of your test, the string being tested, and string being compared to in the report, as seen in your report in the first post.  The other values are not filled in because they are not applicable to the String Value Test.  A Numeric Limit Test would automatically fill in the other fields seen in the report, according to how you set up the test’s Limits tab.  These values can also be accessed/changed by accessing Locals.ResultList[x], where x is the number of the step that you are trying to access the results of.



Message Edited by Chris_G. on 07-14-2008 05:52 PM
Chris_G
Sr Test Engineer
Medtronic, Inc.
0 Kudos
Message 7 of 7
(4,244 Views)