Use a Server Command Line Tool Option and Command
The ClearSCADA Server Command Line Tool has several options that you may need to use before you can issue a ClearSCADA command (depending on the configuration of your system).
The options available are:
- -s server [:port]
This allows you to connect to a specific server via a specific port. The 'server' part of the entry is the name of the server PC or the IP address of the server PC.
- -u user
This allows you to log on to a system via a ClearSCADA user account (either one that is managed directly in ClearSCADA, or one that is associated with a Windows or LDAP User Profile). This option is required if access to the server features is restricted by user account permissions. The 'user' part of the entry is the name of the user account.
- -p password
Use this option to enter the password that is associated with the user account that you specified using the -u option, above. You need to include the password if access to server features is restricted by user account permissions. The 'password' part of the entry is the password that is required to gain access via the user account.
If the name of a value for an option includes a space, you have to enclose the value in double quotes. Remember that if the options need to be used, they have to be defined before you enter the command.
To run a command in the ClearSCADA Server Command Line Tool:
- Access the Server Command Line Tool
- Enter any required options to connect, and log on, to the server (as described above).
- Enter the required command and any required values, such as the name of a driver.
- Press the Enter key.
The command will run. If the command is successful, the expected result will occur (for example, a list of enabled logging options will be returned, or a driver will restart). If ClearSCADA detects that the command has failed or the syntax is invalid, a diagnostic message is displayed providing further information.Example:
SCXCmd -s ServerA:5481 -u "Engineer1" -p "ClearSCADA23" SHOWLOG DB
This command performs the following:
- Connects to the system via port 5481 on the server that is named ServerA
- Logs on to the server via the user account named Engineer1 using the password ClearSCADA23
- Performs the SHOWLOG command, which returns a list of the database (DB) logging options that are currently enabled. The logging options are displayed as acronyms in the Command Prompt window. (You can ascertain the meaning of the acronyms by looking at the Logging section of the ClearSCADA Server Status Tool (see Logging in the ClearSCADA Guide to the Server Status Tool).)
You can display a list of the commands that are available from the ClearSCADA Server Command Line Tool by entering SCXCmd -h
at the command prompt and pressing the Enter key. You can also display the list of commands by entering SCXCmd -?
and pressing the Enter key. When you display the command list, you will see that the keyword for each command is shown along with a description of the command's function.
The commands are in uppercase. Some commands have lower case components. The lower case indicates that you have to define a value for that part of the command.
Example:
The RESTART driver command requires that you enter the name of the driver to be restarted. So, to restart the simple Modbus driver, you would enter any options you require to connect and log on to the server (see above), followed by:
RESTART Modbus
To restart the Advanced Modbus driver, you would enter any options you require to connect and log on to the server (see above), followed by:
RESTART AdvancedModbus
For a list of the drivers that are installed on your system and to ascertain the driver names in the format that you can use with a driver command, access the Modules section of the ClearSCADA Server Status Tool (see Run the Server Status Tool in the ClearSCADA Guide to the Server Status Tool).
For the LOG commands, you can obtain or change the logging options for the database or a specified driver. To do this, you enter any options that are required to connect and log on to the server (see earlier in this topic), followed by the relevant LOG command and either DB (for the ClearSCADA database), or the name of the driver. With some LOG commands, you also need to specify the relevant logging option(s).
Example:
SCXCmd -s ServerA:5481 -u "Engineer1" -p "ClearSCADA23" SHOWLOG Modbus
This command performs the following:
- Connects to the system via port 5481 on the server that is named ServerA
- Logs on to the server via the user account named Engineer1 using the password ClearSCADA23
- Performs the SHOWLOG command, which displays the logging options that are enabled for the simple Modbus driver. In this particular case, the command returns the following logging options:
APP ERR SRC SVR
The acronyms are the same as those that are displayed in the Modules section of the ClearSCADA Server Status Tool. They indicate that the logging options that are enabled for the simple Modbus driver are: Application, Errors, Point Source, and Server. (For more information, see Define the Driver Logging Settings.)
To remove the Point Source logging option (SRC), the engineer specifies the command:
SCXCmd -s ServerA:5481 -u "Engineer1" -p "ClearSCADA23" REMLOG Modbus SRC
Later on, to reinstate the Point Source logging option, the engineer specifies the command:
SCXCmd -s ServerA:5481 -u "Engineer1" -p "ClearSCADA23" ADDLOG Modbus SRC
For the SHOWDIAG command, there is a built-in help display that provides a list of the classes of diagnostic information you can display. Run the SHOWDIAG HELP command to access the list, and then run the SHOWDIAG command followed by the keyword for the class of diagnostic information you require. For example SHOWDIAG DAITEM for diagnostic information about OPC DA items. (Remember to precede the command with the options that are required to enable you to connect and log on to the server (see earlier in this topic).)