A Better Way to Manage Constants in PTEM Test Steps

In an earlier post, I explained how Expressions in PathWave Test Executive for Manufacturing (PTEM) help you construct dynamic command strings and keep your test plan compact and efficient. In this article, I will expand that by showing how MixIn parameters can be used inside those expressions to further streamline your test plan and significantly simplify long-term maintenance.

A typical test plan includes two types of data inputs:

  1. Dynamic parameters—values that change at runtime and are updated through variables.
  2. Constant parameters—fixed values that you manually enter into each test step (for example, a power supply voltage setting or a channel number).

Many test steps also require a composite string parameter that embeds both variables and constant values inside a single expression. As a result, developers often hardcode these constant values directly into expressions. This works, but it creates a long-term maintainability issue. Although these constants do not change at runtime, they do change during debug cycles or product revisions. When the same constant is hardcoded in many places across the test plan, tracking and updating all occurrences becomes tedious and error-prone.

The screenshot in Figure 1 illustrates this problem. The “Command” field holds an expression that builds a SCPI string using a variable OutV and two embedded constants: 1.2 (voltage protection margin) and 1 (power supply channel number). If either of these values needs adjustment, you must manually edit the expression—risking typos—and repeat the process for every similar step scattered throughout the test plan. This is precisely the scenario where MixIn parameters offer a cleaner, safer alternative.

Figure 1: Power Supply setup test step using Expression to build command string.

Mix‑In parameters are lightweight containers that hold a single value. When you add a Mix‑In to a test step, it appears as a new parameter field within that step—just like any native parameter the step already exposes. Because of this, you can insert Mix‑Ins directly into your expressions and update their values from the parameter field without ever changing the expression itself.

At first glance, variables might seem to serve the same purpose, since you can also reference variables inside expressions. However, creating a variable adds it to the global pool of variables in the test plan, increasing the number of runtime-managed objects you have to track. This becomes unnecessary overhead when the value you need is simply a constant and does not change during execution.

That is where MixIns offers a more efficient approach. Think of them as a “lighter” version of variables—ideal for static configuration values that you want to avoid hardcoding. A MixIn parameter stays local to the test step settings panel, making it easy to keep related values close to where they are used. And if you need centralized control, you can still consolidate these MixIns using Parameterization, which promotes them into the Test Plan Settings panel. This gives you a single point of access for all your configurable parameters, without cluttering the global variable space.

In short:

Figure 2: Adding new Mix-In parameter and inserting them to expressions.

Figure 2 illustrates the process of creating and adding a MixIn parameter to a test step. To create one, simply right click on any whitespace in the Test Step Settings panel and select Add MixIn. You can then choose the data type you need—Number, Text, or Boolean. After that, assign a name to the MixIn, and if it is a physical quantity, you can optionally attach a unit symbol.

In the example above, the MixIn is intended to hold the overvoltage protection margin, so I named it OVP and assigned the unit V for volts. Similarly, I created another MixIn to be the power supply channel number.

Once created, Mix‑In parameters appear as new entry fields at the top of the Test Step Settings panel. These fields behave just like native parameters. To use them inside your expression, simply reference them by name, enclosed in curly braces. For example:

{OVP}

{Channel}

This allows the expression to remain unchanged while the underlying values are easily updated from the Mix‑In fields themselves. By parameterizing them to the test plan setting panel, I can have multiple test steps throughout the testplan referencing to the same parameters and update all of them at one go.

MixIn parameters remove one of the biggest headaches in test plan maintenance: scattered constants buried inside expressions. With MixIns, every static value becomes visible, editable, and centrally managed—without adding complexity to the global variable space. Combined with PTEM’s Expressions and Parameterization features, you now have a clean, efficient way to structure test logic while keeping ongoing updates simple and error-free.

More useful PTEM features are coming—stay tuned!

If you have questions or comments, feel free to reach out.
Stay safe and be happy.

[email protected]

limit
3