Code Modules with Multiplexed Routes (TSM)
- 更新日2025-07-31
- 2分で読める
In a code module you call from a Semiconductor Multi Test step, you must connect DUT pins connected to multiplexers to the corresponding switch route before you can perform a test on that DUT pin. At the end of the test, disconnect the route. Refer to the Switching Example Test Code VI in the Switching example for an example of how to perform a measurement on multiplexed connections.
In the code module, pass NISimulatedMultiplexer for the Multiplexer Type ID parameter of the Pin to Switch Sessions VI to obtain an array of switch sessions, switch route names, and Semiconductor Module contexts for each site in the subsystem. Each element in the Semiconductor Module contexts array represents a single site on which the test code must execute serially. Use the Semiconductor Module context object to query the pin map and publish data for the site. In a For Loop, use the switch session and the corresponding route name to connect the switch route. Because the session data is an array of variant data types to allow for any session type, use the Variant To Data function inside the For Loop to convert the variant data type to the correct switch session type. Because auto-indexing is enabled on the For Loop, it ensures that the switch session, switch route name, and Semiconductor Module context correspond to each other for each iteration of the For Loop.
After you connect the route, call the Pin Query VI inside the For Loop to query the pin map for the instrument session. Each iteration of the For Loop uses a separate instance of the Semiconductor Module context from the array the Pin To Switch Sessions VI returns. Use the instrument session to perform the measurement on the pin. Use the Publish Data VI to publish the measurement by passing the Pin Query Context the Pin Query VI returns to the Publish Data VI. After you publish the measurement, you must close the Semiconductor Module context reference because the reference was generated in LabVIEW, and the code module must manage the reference. You do not need to close the reference for the Semiconductor Module context that you pass as a parameter from TestStand.
Before exiting the For Loop, use the same switch session and switch route name to disconnect the switch route.