The Semiconductor Multi Test and the Semiconductor Action steps call a single code module for all the sites that synchronize at a certain location, which means the code module executes on multiple sites at the same time. The Semiconductor Multi Test or Semiconductor Action step creates a SemiconductorModuleContext object that contains the information about the sites on which the code module executes. Pass the Step.SemiconductorModuleContext property to the code module to use the TSM Code Module API.

Code Module Development Guidance

As you develop each part of the test program, consider the functionality that belongs in code modules and the functionality that belongs in test sequences. In general, use the following guidelines:

  • Code Modules—Use code modules written in LabVIEW or in .NET for instrument driver calls to configure instruments and acquire data. Additionally, use code modules for other code necessary to perform a specific DUT test or other specific actions so you can reuse the code modules in other test programs.
  • Test Sequences—Use test sequences to call code modules and evaluate results the code modules generate.

Use Test Sequence for Test Flow

Use the TSM test sequence instead of code modules to determine test flow. For example, if the test program requires you to execute a certain test only if a previous test fails, ensure that the test sequence contains the logic for executing tests in a specific order. Use this development strategy to make the flow of the test program more apparent to other test engineers and to help generalize code modules for potential reuse in other test programs.

Evaluate Results in TSM

Use code modules to execute specific tests, but do not use code modules to evaluate numeric results of tests. Use the Publish Data TSM Code Module API to transfer test measurement data to the Semiconductor Multi Test step. Configure the Semiconductor Multi Test step to evaluate the measurement against a set of limits or a specific value. Because test limits might change throughout the life cycle of a DUT, evaluating the measurements in TSM rather than in code modules enables you to more easily adjust the test limits as needed. Additionally, using this technique helps to generalize code modules for potential reuse in other test programs.

You might need to perform calculations on the test measurements before evaluating the data because TSM does not offer the functionality you need or because you need to attain maximum performance for a processor-intensive calculation. For example, use a code module to calculate the FFT of a waveform, and use a Semiconductor Multi Test step in TSM to perform the final test evaluation.

Implement Loops in Code Modules for High Performance

Implement loops in code modules when execution speed is critical. For example, if a test needs to sweep an instrument parameter over a range of values as quickly as possible, use a For loop in a code module rather than executing the loop in TSM. Additionally, using parallel For Loops in LabVIEW code modules to apply the same settings to multiple instruments at once is much faster than implementing loops in TSM.

Use Per-Site Data to Store Data within Code Modules

Use the Set Site Data VI or SetSiteData .NET method and the Get Site Data VI or GetSiteData .NET method in the TSM Code Module API to store data that you need to access in another code module later. Using this development strategy provides an advantage over storing data in TSM variables because the API maintains unique data for each site. Additionally, you can access the data directly within code modules instead of passing the data from TSM as a parameter.

Specify Pin Names as Parameters to Code Modules

Use parameters to pass pin names into code modules from TSM instead of hard coding pin names within the code modules. Using this technique improves the readability of the test program by making the use of each pin in the code module more apparent to test engineers. It also generalizes code modules for potential reuse in other test programs.

Other Suggestions

Additionally, consider the following issues during code module development:

  • Querying pins and sessions
  • Using parallel For Loops
  • Grouping Instruments or Channels
  • Specifying input parameters
  • Obtaining values from specifications files
  • Sharing data between code modules
  • Publishing results
  • Sharing instrument sessions between LabVIEW and .NET code modules
  • Using LabVIEW VI Analyzer
  • Using LabVIEW Classes