Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

13/1/2019 819855 - Understanding use of the ampersand (&) character in FactoryTalk View SE commands

Understanding use of the ampersand (&) character in FactoryTalk View


SE commands
819855 | Date Created: 04/26/2016 | Last Updated: 01/12/2018
Print
Access Level: TechConnect

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.

Synchronous vs. asynchronous command execution


Generally, multiple commands (e.g. in a macro) are queued in order in which they are listed and executed
synchronously. This means that a preceding command in the queue needs to finish before the next one starts to
execute.

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

Tag write commands


There are four commands that can be used to write to tags:

Set, =, Toggle, and Ramp

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.

Command execution methods


In FactoryTalk View SE, commands can be executed using several methods. However, not all of these methods
support asynchronous execution enforced by the ampersand character ('&').

The following objects/methods support '&' in a command:

Macro
Event file
Object key
Command editor (in View Studio)

The following objects/methods ignore '&' in a command:

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.

ROCKWELL AUTOMATION DOES NOT WARRANT THE COMPLETENESS, TIMELINESS OR ACCURACY OF


ANY OF THE DATA CONTAINED IN THIS WEB SITE AND MAY MAKE CHANGES THERETO AT ANY TIME IN
ITS SOLE DISCRETION WITHOUT NOTICE. FURTHER, ALL INFORMATION CONVEYED HEREBY IS
PROVIDED TO USERS "AS IS." IN NO EVENT SHALL ROCKWELL BE LIABLE FOR ANY DAMAGES OF ANY
KIND INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS PROFIT OR DAMAGE, EVEN
IF ROCKWELL AUTOMATION HAVE BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGES.

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

ROCKWELL AUTOMATION DISCLAIMS ALL WARRANTIES WHETHER EXPRESSED OR IMPLIED IN


RESPECT OF THE INFORMATION (INCLUDING SOFTWARE) PROVIDED HEREBY, INCLUDING THE IMPLIED
WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, AND NON-
INFRINGEMENT. Note that certain jurisdictions do not countenance the exclusion of implied warranties; thus, this
disclaimer may not apply to you.

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

You might also like