Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
5 ratings:
 4.40 out of 5   

How Can I Access Properties of the Process Model from my Client Sequence?



Primary Software:
Primary Software Version: 4.2
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I would like to access properties such as socket information or the UUT serial number from the process model within my client sequence file.  How can I access these properties?

Solution:
The Runstate.Root object gives access to all properties of the process model being used.  From this object, you can access all variables and other properties associated with the model. For example, you can obtain the UUT serial number (Figure 1) and Batch serial number by calling the following expressions, respectively:

Runstate.Root.Locals.UUT.SerialNumber
Runstate.Root.Parameters.TestSocket.UUT.BatchSerialNumber


Figure 1. Using a Message Popup to view the serial number

The UUT and Batch serial numbers, along with many other process model properties, are dynamic variables which load at runtime. For this reason, they will not appear when editing the sequence.  When using these variables while editing your sequence, TestStand may give you an error:

Evaluation Error: Unknown Variable or Property Name.

This error can be ignored, since the property name will become valid once the sequence is executed.

Note: To view dynamic properties, set a breakpoint in your sequence and use the variables pane.

The Runstate.Root property can also be used to access socket information when using the batch or parallel models through the ModelData parameter.  The following example shows how to access whether the current socket is enabled:

RunState.Root.Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].Disabled

Keep in mind that the available properties will change depending on the entry point used.

Related Links:
Developer Zone Tutorial: Why Can't I View some Properties at Edit Time?
Developer Zone Tutorial: How do I Access the UUT Serial Number in My Sequence or Test Code?

Attachments:





Report Date: 03/22/2007
Last Updated: 02/19/2010
Document ID: 47LFSHAC

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit