NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter Passing between TestStand and LabVIEW

I created a bogus VI so as to have something to experiment.  I'm trying to understand how to pass parameters between TestStand and LabVIEW.  In particular, I want to be able to write data within my VI to the report generated by TestStand.  The error I receive
 
Parameter 'Loop Info'
Type of argument expression "Step.Result.ReportText" is incompatible with parameter.
Expected Number, found String.
 
makes sense.  I'm just not sure what the best way is to write numeric data to the teststand report.
Download All
0 Kudos
Message 1 of 7
(5,940 Views)
If your VI is returning some string you want to use as the report text, you can easily append the number to that inside the VI. Or, write the number to a local (i.e. LoopCount) and as a post expression do something like

Step.Result.ReportText = Step.Result.ReportText + Str(Locals.LoopCount)

 

0 Kudos
Message 2 of 7
(5,934 Views)

Hi mrbean,

Just to add a little more information, there are two ways to pass data between an external code module (in this case LabVIEW) and TestStand:

1) Passing an arbitrary number of parameters using the LabVIEW Adapter - Pass TestStand data directy through the terminals on the VI connector pane.

2) Using the TestStand ActiveX Automation API - Sequence context object is passed to LabVIEW and then the TestStand ActiveX API VIs are used.

Hope this helps

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 3 of 7
(5,921 Views)

Using option (1) from the previous response, Is Step.Result.ReportText the only way into the TesStand report?  When you create the shell VI from TestStand, it creates the string indicator for the report text.  Is it common that you just use this one indicator (within each VI) to write out to the report, even if you have different information within the VI (text, data points, etc) that you may want to write to the report.

With option (2), I couldn't find a good example out on the link you provided.  I tried a few searches, but must not have entered the right key words.

Message 4 of 7
(5,916 Views)

Hi mrbean,

That Step.Result.ReportText property is a default property associated with our default step types.  Any property that is included in the ResultList container will be sent over to the report. For information on how reporting works, review the Understanding and Modifying Result Collection tutorial.  In this tutorial, you will see several ways of adding data to your report. 

The second method I mentioned in an earlier post simply uses the TestStand ActiveX API VIs shown in the attached image (its the LabVIEW TestStand palette). You will be sending in the sequence context and lookup strings to access variables and properties.  You can find us using these methods in our example programs. One specific example you can look at is the AccessingPropertiesAndVariables example located at C:\Program Files\National Instruments\TestStand 3.5\Examples\AccessingPropertiesAndVariables\UsingLabVIEW. If you open any of these VIs, you will us using these API VIs.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 5 of 7
(5,912 Views)
I'm wondering why In the report, I'm not seeing the string shown in the first stack sequence.  I only see the 334.  In general, is this a viable solution/approach to writing different data to the report?
0 Kudos
Message 6 of 7
(5,906 Views)

Hi mrbean,

Whatever value comes out of the connector pane is what value TestStand will read. In this case, 334 is the last value set for Report Text variable.  If you have multiple sets of data you need to send out, you can:

1) Create multiple terminals for your connector pane and then assign these output terminals in TestStand to TestStand variables. Then follow the tutorials I mentioned in my earlier posts to include this data in the reports.

2) Use the ActiveX TestStand VIs to set local variables in TestStand to whatever data you have in your LabVIEW VI.

Simply folow the tutorial and example I mentioned to clear things up.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 7 of 7
(5,900 Views)