Per-Site Inputs Tab
The figure below shows the Per-Site Inputs tab from the Test step, configured in TestStand to send values from the TestValues array local variable on a per-site basis, using the TestSockets.MyIndex property in the Data Source expression. In this case, an array with 4 values is specified as the data source on a 4 sites system. The same data is written using the Pin and input Data Id methods just to confirm the outcome is the same.
The image below shows the Get Input Data VI with both the Pin and Input Data Id methods, either will render the same result. The ID Data Out will have one value per site in the Semiconductor Module Context.
If the code module executes once per site, you will only have one value, but if it executes on a subsystem composed by two sites, it will have two values, one for each site.
TSM Per-Site Data
The figure below shows how to use the Set Site Data VI to write a scalar value to the arbitrary PerSiteParam Data Id. If you wire a 2D array instead, the Set Site Data VI writes one row per site.
The figure below shows the Get Site Data VI along with the PerSiteParam Data Id being used to retrieve the data.
If the code is executed in a step that runs independently on each site, the Site Data array on each instance of the code module will have a single value corresponding to the data for the corresponding site. If it is executed in a code module from a subsystem composed by two sites, the Site Data array will have two values, once for each site.
If you don't know the number of sites, you can use the Get Site Numbers VI to retrieve the number of sites in the system and the site numbers on the executing thread.