Sharing Data between Code Modules (TSM)

NI TestStand 2019 Semiconductor Module Help

Edition Date: August 2019

Part Number: 373892J-01

»View Product Info
Download Help (Windows Only)

Data can be stored in the SemiconductorModuleContext in one code module and retrieved later in another code module using an ID string. The data can be stored as a single data value available globally to all sites or as a data value per site. Use the Set Global Data VI or SetGlobalData .NET method and the Get Global Data VI or GetGlobalData .NET method to store and retrieve data shared by all sites. Or use the Set Site Data VI or SetSiteData .NET method and the Get Site Data VI or GetSiteData .NET method to store and retrieve site specific data.

Note Note  When setting site specific data with the Set Site Data VI or the SetSiteData .NET method, the data should be ordered to match the order of sites in the Semiconductor Module context. This order might not be sequential. If the data you are storing was acquired from instruments using a pin query, use the Extract Pin Data VI or the ExtractPinData method on the PinQueryContext .NET object to extract the data from the measurements array into the correct order for the Set Site Data VI or SetSiteData .NET method. Otherwise, use the Get Site Numbers VI or the SiteNumbers property on the SemiconductorModuleContext .NET object to determine the order of the sites in the Semiconductor Module context and arrange the data manually.

The following example shows how to store a per-site measurement data for comparison in a later test step:

LabVIEW

.NET (C#)

public static void FirstCodeModule(ISemiconductorModuleContext semiconductorModuleContext, string pin)
{

NIDCPower[] dcPowerSessions;
string[] channelStrings;
var pinQuery = semiconductorModuleContext.GetNIDCPowerSessions(pin, out dcPowerSessions, out channelStrings);
var results = PerformComparisonMeasurement(dcPowerSessions, channelStrings);
var perSiteData = pinQuery.ExtractPinData(results);
semiconductorModuleContext.SetSiteData("ComparisonData", perSiteData);

}
public static void SecondCodeModule(ISemiconductorModuleContext semiconductorModuleContext, string pin)
{

var siteDataObjects = semiconductorModuleContext.GetSiteData("ComparisonData");
var perSiteComparisonData = siteDataObjects.Cast<double>().ToArray();
NIDCPower[] dcPowerSessions;
string[] channelStrings;
var pinQuery = semiconductorModuleContext.GetNIDCPowerSessions(pin, out dcPowerSessions, out channelStrings);
var results = PerformComparisonMeasurement(dcPowerSessions, channelStrings);
var perSiteData = pinQuery.ExtractPinData(results);
double[] comparisonResult = new double[perSiteData.Length];
for (int dataIndex = 0; dataIndex < perSiteData.Length; dataIndex++)
{

comparisonResult[dataIndex] = perSiteData[dataIndex] - perSiteComparisonData[dataIndex];

}
semiconductorModuleContext.PublishPerSite(comparisonResult);

}

WAS THIS ARTICLE HELPFUL?

Not Helpful