Professional Documents
Culture Documents
Understanding Use of The Ampersand (&) Character in FactoryTalk View SE Commands
Understanding Use of The Ampersand (&) Character in FactoryTalk View SE Commands
Question
How does the ampersand character in a command affects command processing and execution?
Environment
FactoryTalk View SE - all versions
Overview
A service in charge of processing FactoryTalk View SE commands is CommandCliSvr.exe. This process serves as
a command interpreter responsible for deciding where the commands should be executed and by which process.
CommandCliSvr.exe process runs on both the HMI server and the client (View SE client or View Studio).
Commands issued on the client and destined for local execution (client-side commands) are routed to a client-side
process DisplayClientCCmdfrnt.exe.
Commands that must be executed on the server (server-side commands) are routed to their respective HMI
servers and then, depending on their type, dispatched for execution to an appropriate server-side process, such as
CommandCliPrintHMIService.exe, for example.
Adding the ampersand character in front of commands (e.g. &Set, &Print, &Display, etc.) tells CommandCliSvr.exe
to execute commands in the queue asynchronously. This means that a command that follows the one with '&' as a
prefix, will start processing immediately, without waiting for the previous one to complete. For example, let's
analyze a simple scenario with two commands in a sequence:
&Set MyTag1 1
DataLogOn MyDLG
In this scenario the DataLogOn command will not wait for the completion of the &Set command, which would have
been the case if the Set command haven't had the ampersand as a prefix.
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/819855/page/1 1/4
13/1/2019 819855 - Understanding use of the ampersand (&) character in FactoryTalk View SE commands
As any other command, these commands are also processed by CommandCliSvr.exe but are dispatched to and
executed by a different server-side process called CommandCliTagHMIService.exe. Unlike CommandCliSvr.exe,
this process always queues the commands and executes them synchronously regardless of whether they have the
ampersand prefix or not.
Let's add a few commands to the above example and analyze the following scenario:
&Set MyTag1 1
DataLogOn MyDLG
&Set MyTag2 1
&Set MyTag3 1
&Set MyTag4 1
In the above scenario CommandCliSvr.exe will first process the first &Set command and dispatch it to
CommandCliTagHMIService.exe. Without waiting for its completion, CommandCliSvr.exe will next execute
DataLogOn command. Upon completion of DataLogOn command it will dispatch the bottom three &Set commands
to CommandCliTagHMIService.exe. Inside CommandCliTagHMIService.exe, the ampersand prefix ('&') will be
ignored and all the Set commands will be executed synchronously - the next one will start only upon completion of
the preceding Set command.
CommandCliSvr.exe - Ampersand prefix ('&') is recognized as part of the command, so when it is used the
command executes asynchronously.
CommandCliTagHMIService.exe - Ampersand prefix ('&') will be ignored, so commands are always executed
synchronously.
Macro
Event file
Object key
Command editor (in View Studio)
Button object
Client key
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/819855/page/1 2/4
13/1/2019 819855 - Understanding use of the ampersand (&) character in FactoryTalk View SE commands
Touch animation
VBA (when executing multiple commands using ExecuteCommand method)
To simplify design of asynchronous commands in a project and avoid a need to refer back to the above list, we
strongly recommend that all commands intended for asynchronous execution are placed in macros. Macros
themselves can be executed using any of the listed methods. This way you will ensure that the commands with the
ampersand character will be honored and executed as expected regardless of the object or the method used to
trigger the macro.
Summary
Here is the summary of the key points to take from this article:
Asynchronous command feature is meant for the scenarios involving sequential or simultaneous execution
of 2 or more commands or macros in which some commands take longer to complete than others. The
ampersand used in a slower command will allow the next command to start executing before the slower one
completes.
The ampersand character in a command does not speed up execution of that individual command (e.g. &Set
is not faster than Set).
If executing only one command (and no other commands or macros in the same sequence or at the same
time using other command execution methods), it does not make sense to use the ampersand character.
If executing only tag write commands (e.g. multiple Set, =, Toggle, Ramp commands or their
combination) and no other commands or macros in the same sequence or at the same time using other
command execution methods, it does not make sense to use the ampersand character in these commands.
The best way to ensure asynchronous execution of desired commands is to put such commands in macros.
Attachments
DISCLAIMER
This knowledge base web site is intended to provide general technical information on a particular subject or
subjects and is not an exhaustive treatment of such subjects. Accordingly, the information in this web site is not
intended to constitute application, design, software or other professional engineering advice or services. Before
making any decision or taking any action, which might affect your equipment, you should consult a qualified
professional advisor.
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/819855/page/1 3/4
13/1/2019 819855 - Understanding use of the ampersand (&) character in FactoryTalk View SE commands
This page is best viewed in Internet Explorer 11, Edge, Firefox 41, Chrome 46, Safari 9 or newer.
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/819855/page/1 4/4