NI TestStand Idea Exchange

Showing results for 
Search instead for 
Did you mean: 

TestStand Expression Macros

Status: Duplicate

I'm closing this and adding a link to this description in the other post.

Let's say I'm building a fairly long compound expression that has some repeated parameters - I would like a way to specify (without creating additional locals) a variable/macro for use just within that expression.


For example, instead of:

Locals.CommandLine = "cmd /c C:\some path\that\is\reused"
Locals.CommandLine += " /path C:\some path\that\is\reused"



I could specify:

#pathmacro "C:\some path\that\is\reused"
Locals.CommandLine = "cmd /c " + pathmacro
Locals.CommandLine += " /path " + pathmacro



The idea being that with this I only need to update the macros in one place in a long expression.


This is a simple example, but hopefully you can see why this would be useful and why I wouldn't want to create lots of locals when the values are required only within the expression.

LabVIEW Champion, CLA, CLED, CTD
Active Participant

I believe that I suggested that TestStand use macros many years ago.

Or it may have been to define constants that could be used for things like hardware addresses


I think a define statement would be great.


instead of:

Locals.UUT = RunState.TestSockets.MyIndex+1


have something like this in a special macro sequence (or anywhere for that matter)

#DEFINE UUT = RunState.TestSockets.MyIndex+1


Even if you need to prefix with a special character like ~

~UUT = RunState.TestSockets.MyIndex+1


then you could just use ~UUT for RunState.TestSockets.MyIndex+1


I dislike having to use variables for data that doesn't change


Perhaps it is just beyond the capabilities of TestStand







Active Participant
Status changed to: Duplicate

I'm closing this and adding a link to this description in the other post.