NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Expression Macros?

Does anyone know if it is possible to specify macros in expressions or is this something I should add to the ideas exchange?

 

Let's say I'm building a fairly long compound expression that has some repeated parameters - is there 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

 

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
(blog)
0 Kudos
Message 1 of 4
(3,320 Views)

There are no macros in the way you request them in TestStand... at least i am not aware of.

 

However, you can use FileGlobal variables (or other, more suitable access scopes) which use the "Not Editable" flag. Just configure the variable and finalize it with selecting Advanced >> Edit Flags  in the context menu. Not Editable should be the first in the list.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,308 Views)

@Norbert_B wrote:

However, you can use FileGlobal variables (or other, more suitable access scopes) which use the "Not Editable" flag. Just configure the variable and finalize it with selecting Advanced >> Edit Flags  in the context menu. Not Editable should be the first in the list.


Yes, I was aware of using variables in the expressions but the variables I am using here are specific to the particular expression I am editing.

 

I've posted it over on the ideas exchange here: http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/TestStand-Expression-Macros/idi-p/3326972


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(3,298 Views)

I would call that an "Expression Local (variable)"..... 😉

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(3,295 Views)