Automation1 Console
Automation1 Console can be used to configure, monitor, and troubleshoot your machine and motion control system. The application has a terminal interface where you can enter commands and see the results of the commands.
Tip: Although Automation1 Console is a good tool for advanced troubleshooting, when possible, you should use Automation1 Studio for most configuration, development, and troubleshooting.
Starting the Console
There is more than one way to start Automation1 Console:
-
From the desktop shortcut that was created when the Automation1 MDK was installed.
-
From an existing command prompt to run a single command.
-
From an existing command prompt in interactive mode.
If you use the desktop shortcut to open Automation1 Console, a new console window is opened in interactive mode.
Running a Single Command
You can use Automation1 Console to run a command as a command-line argument. When you do this, the command is executed immediately, and you do not have to enter more commands in the prompt window. The output of the command is returned to the same command prompt window. This lets the console to be used within shell scripts for your host system, such as a Windows batch file.
To execute a single command with Automation1 Console, type the Automation1 Console executable name with the console command after it. The example that follows shows how to run the --help
command from the console.
Automation1Console.exe --help
Starting Automation1 Console with the play
command is helpful when running script files on the console. See the Script Mode section for more information about script files.
Interactive Mode
In interactive mode, you must enter commands one at a time to Automation1 Console by typing a command after the prompt character > and pressing Enter on your keyboard.
You can start Automation1 Console in interactive mode by opening the desktop shortcut or by running the Automation1 Console executable with the -i
flag. To run Automation1 Console in interactive mode from a command prompt, open a new Windows Command Prompt or PowerShell window in the Automation1 installation folder, which is located at C:\Program Files\Aerotech\Automation1-MDK\Bin
. In the new window, enter the command that follows:
Automation1Console.exe -i
The command prompt window will print the prompt character > and wait for input. Refer to the Command Arguments section for more information about how to use available commands.
Script Mode
Automation1 Console can execute a series of commands from a script file. This uses the play
command, and an interactive session is not necessary.
Script files are UTF-8 text files that contain one Automation1 Console command per line of the file. The example that follows shows what the contents of a script file can look like. This script connects to a local controller, starts the controller, and then disconnects from the controller.
connect initialize full smc info disconnect
If the commands in the example were in a file named sample.script
and located in C:\Users\ExampleUser\Documents
, you would use the Automation1 Console command that follows to run the script.
play C:\Users\ExampleUser\Documents\sample.script
You can use the play
command from an interactive session or by running a single command as described in Running a Single Command.
Automation1Console.exe play C:\Users\ExampleUser\Documents\sample.script
When you play a script file from Automation1 Console, each command runs in the order they are specified in the file. The Automation1 Console window shows the result of each command in the window from which the play
command was issued. Before the output of each command, the console outputs a line stating that it is playing a script with the given name. For example, the output of the above command will start with the following.
Playing script C:\Users\ExampleUser\Documents\sample.script
Script files can include comments and blank lines between commands without having an effect on the output of the script. Comments are lines that start with the semicolon (;
) character. The sample script above could be written as follows without affecting the commands that are run or the output of the script.
; Connect to the local controller. connect ; Initialize the controller. initialize full ; Get information about the running controller. smc info ; Disconnect from the controller. disconnect
Command Arguments
Arguments to Automation1 Console commands are delimited by whitespace characters. When the console reads whitespace in a command, it reads the current argument as complete, and the text after the whitespace is read as a separate argument. If a single argument must have whitespace, put single or double quotation marks around the argument. The example that follows shows single quotation marks used around an argument that contains double quotation marks and whitespace. This command executes the line of AeroScript code that is inside the single quotation marks on task 1.
task commandexecute 1 'TaskSetError(TaskGetIndex(), "This is an example error.")'
Discovering and Connecting to Controllers
You can use Automation1 Console to discover and connect to Automation1 controllers on your local machine and network. To discover controllers that are available for connection, enter the discover
command. If there is one controller running on your local machine, the output of the discover
command will look something like this:
ExampleController (Sample-PC) @127.0.0.1:12200
The output lists all available controllers by their name, hostname, IP address, and port. In this example, the name of the controller is ExampleController, the hostname is Sample-PC, the IP address to connect to the controller is 127.0.0.1, and the port to connect to the controller is 12200. For PC-based controllers, the hostname of the controller will be the name of the PC on which the controller is running. For drive-based controllers, the hostname will be the controller board serial number of the drive.
To connect to a controller on your network, use the connect
command. If you want to connect to a controller on your local machine, use the connect
command without arguments.
connect
If the controller is on a remote machine, you must use the --ip
argument followed by the IP address of the remote machine on which the controller is running. For example, if the controller you want to connect to is running on the remote machine at IP address 192.168.1.2, you would issue the command that follows.
connect --ip 192.168.1.2
If you want to connect to a drive-based controller that is connected to your Windows host PC using a USB cable, you must use the --usb
argument.
connect --usb
If you are connected to a controller, you can see information about the current connection by using the connect --info
command.
connect --info
This command shows the controller type, the name of the controller, the hostname of the device on which the controller is running, the IP address of the controller, and the version of the Automation1 software that the controller is running. The output of this command is as follows:
Connected to PC-based controller "ExampleController" (Sample-PC) at 127.0.0.1, running version 2.7.1.2602.
To disconnect from a controller, issue the disconnect
command.
disconnect
Exiting the Console
If Automation1 Console was started to run a single command, including a script that uses the play
command, the console automatically exits after completing the given command. In interactive mode, you can exit the Automation1 Console session with the exit command.
exit
If you opened Automation1 Console with the desktop shortcut, the exit
command closes the window that was opened when the program was run. If the console was opened from an existing command prompt window, the exit
command returns control of the window to the command prompt from which Automation1 Console was launched.