Personal tools
You are here: Home P200 Echelle ECHELLE Software User Manual SYNC command reference
Document Actions

SYNC command reference

by Marco Bonati last modified 2005-10-17 05:08 PM

SYNC module command reference

Quick Usage of SYNC module

The following list describes briefly the command and parameters available for the SYNC Module.
The SYNC module is used to connect more than one ArcVIEW toguether. When two ArcVIEWs ar synced, you send a command
The meaning of the simbology is:
< > : holds a parameter which is necesarry (mandatory)
[ ] : holds a parameter which is optional
|    : separates possible values for an enumerated type.

The SYNC module has three tcp/ip ports:

"Non-blocking" port: is a command/response channel, normally used by clients capable of handling a second channel for the async. messages. For short commands, it will receive the command and send the response, but for long commands (like "expose"), it will send back only an "OK", meaning that the action is "in progress". Later on, when the action is actually done, a completion/failure message will be returned theough the

"async. msgs." port:, used to return callbacks from previous commands or truly async. messages (like "temperature too high". The client has to connect to this channel in order to receive these messages.

"blocking" port: This port will hold the response untill the action is done, even for a long command. If an "expose" is sent through this port, the port will be blocked untill the exposure is really done. This means that by using this port is not possible to perform more than one action at a time.

The advantage of the blocking port is that it is much easier for scripting.

Specific command to the SYNC module


complete command
description example
GET <systems | system <name>                     get the systmes defined on the config file. If "systems" it will bring the list of all available systems and its current conection status sync get systems                                        
CONNECT <name | -all> connects all the systems ("-all") or the one specified by name sync connect DBSPRED
DISCONNECT <name | -all> disconnect the systems ("-all") ot the one specified by name sync disconnect DBSPRED


Examples:


> SYNC GET systems

> Name=DBSPBLUE, localid=LOCALSERVER, connected=TRUE
   Name=DBSPRED, localid=DBSPRED, connected=FALSE

/*Two systems defined, but the only connected is the localserver. The "localid" is the name defined on the local config*/

> SYNC CONNECT DBSPRED
> DBSPRED DBSPRED
 /*the connected system responds with its own name, and the response is "localid <system_name>". Now DBSPRED is connected also*/

/*Now, for sending a command to one system or the other, the name of that system should be placed in front of the command. For example*/

> DBSPRED DHE get exptime
> DBSPRED 12000 [ms]

/*the answer has the system name in the front of it. For sending a command for all the connected systems, the prefix "BROADCAST" is used*/

> BROADCAST DHE get exptime
> DBSPBLUE 5000 [ms]
   DBSPRED 12000 [ms]

The general sintx is then

[BROADCAST | <name>] <command to arcview>

The command to arcview can be any valid arcview command, directed to the specified systems or system.



Using the "arcsync" wrapper

The "arcsync" csh is just a wrapper provided in order to facilitate scripts. The "arcsync" program just connects to a port, sends a command and waits there for the response. If the port is the blocking one defined for a SYNC module, it acts as an interface for all the connected system. This measn that any of the above stated commands (to SYNC module itself or to any other module, on any other ArcVIEW) can be sent using a standard unix terminal, like:

> arcsync BROADCAST DHE get exptime
> DBSPBLUE 5000 [ms]
   DBSPRED 12000 [ms]

> arcsync DBSPBLUE DHE get exptime
   DBSPBLUE 5000 [ms]



Module Configuration file

[COMMS]
port=<uint>        /*non-blocking port*/
asyncport=<uint>  /*async. messsages port*/
blockport=<uint>  /*blocking port*/
maxcmdsvr=<uint>   /*max. command servers that can run at a time. This limits the amount of non-blocking clients that can be connected at a time*/
maxasyncsvr=<uint>  /*max. async. servers that can run at a time. This limits the amount of clients listening to the async. chanel.*/

[LOG]
log=<yes | no>
file=<path>        /*the path can have an absolute path or a path defined by the ArcVIEW global variable _LOGPATH_*/

[MODE]
system_default=<BROADCAST | name>     /*what system to assume if a command has no prefix*/
multiresponses=<yes | no>                            /*one response per system?*/

[LOCALSERVER]
address=localhost                  /*very important if we want to send commands to the local ArcVIEW also*/

[name1]                                 /*local name for remote system. This is what appears as "localid" in the SYNC GET command*/
address=<host1>                   /*address or name of host holding system called name1*/
port=<nbport>                      /*port of non-blocking port of SYNC module on system name1*/
local_server=<uint>             /*port of async. messages channel of SYNC module on system name1 */

.....
[nameN]
...