Creating and using macros, Macro syntax, Creating and using macros – 12 – Rockwell Automation FactoryTalk View Site Edition Users Guide User Manual
Page 640: Macro syntax – 12

F
ACTORY
T
ALK
V
IEW
S
ITE
E
DITION
U
SER
’
S
G
UIDE
24–12
• •
•
•
•
For the Shutdown command in the Display Settings Behavior tab, specify the
EventOff <component> command, or a macro that contains the command.
You can also stop events processing by stopping all HMI server components running on
the computer. For details, see “To stop HMI server components manually” on page 6-19.
Creating and using macros
A macro is a series of FactoryTalk View SE commands stored in a macro component.
You can use a macro component anywhere a command can be used. When the component
name is issued, the macro runs, carrying out all the commands in the component.
You can create macros to perform almost any action or series of actions. For example, use
a macro to:
Open a group of graphic displays, and define their initial positions.
Define temporary key definitions.
Close any open graphic displays.
Set tag values.
To create a new macro
In FactoryTalk View Studio, open the Logic and Control folder, right-click the
Macros icon, and then select New.
To open the Command Wizard, double-click anywhere in the Macros editor.
Macro syntax
When typing commands in macros, follow these guidelines:
Separate each identifier, specification, or string with a space or a tab.
Start each command on a new line, or separate commands on the same line with a
semicolon (;).
To insert a comment, type an exclamation mark (!) at the beginning of a new line or
immediately after a semicolon (;). Everything between the exclamation mark and the
end of the line, or the next semicolon, is treated as a comment.
To replace a tag name with its current value when a command is evaluated, enclose the
tag name in dollar signs ($) to create a tag placeholder in the command.
When a macro containing $tag$ run, the current tag value is substituted for the tag
placeholder, before commands in the macro are issued.