# 12.4. Running ticcmd with Windows shortcuts

This section explains how to control the Tic with Windows shortcuts. A folder of shortcuts can serve as a simple GUI for controlling the Tic and requires no programming experience to make. This section focuses on shortcuts in Windows, but you should be able to do something similar in Linux or macOS.

The Tic Command-line Utility (ticcmd) provides many commands for controlling the Tic, and gets installed along with the rest of the Tic software and drivers. After installing ticcmd as described in Section 3.1, you can follow these instructions to make a shortcut to it:

1. Right-click on the blank area of your desktop or any other folder, open the “New” menu, and select “Shortcut”.
2. Windows will open a “Create Shortcut” wizard and prompt you for the location of the item you want to make a shortcut to. Type ticcmd --resume --position 200 --pause-on-error or any other command you want to run.
3. Click “Next”. If Windows says “The file ticcmd cannot be found.”, it either means you have not installed the Tic software, or the folder containing ticcmd.exe is not listed in your PATH environment variable (maybe you unchecked the checkbox that adds it your PATH when installing the software). As a solution, you could replace ticcmd in the input box with the full path to ticcmd.exe in double quotes. However, the easiest solution is probably to reinstall the Tic software, making sure to leave the “Add the bin directory to the PATH environment variable.” checkbox checked this time. You might also need to restart your computer.
4. Type an appropriate name for your shortcut and click “Finish”.

Now you should be able to double-click on your shortcut to run the command you entered. You will probably see a black window briefly flash on the screen run the command runs.

At this point, you might get an error message that says:

Error: Failed to open generic handle. Access is denied. Try closing all other programs that are using the device. Windows error code 0x5.

It is best to follow the advice in the error message and close the Tic Control Center and any other programs that might be using the Tic. In Windows, only one program can use the Tic’s USB interface at a time.

Another issue you might notice is that the Tic only performs the desired movement for about a second before it stops moving and the red LED turns on, indicating an error. This is because of the Tic’s command timeout feature: by default, the Tic’s “Command timeout” error will happen if it does not receive certain commands periodically (see Section 5.4 for details), causing the motor to stop. You can disable the command timeout feature using the Tic Control Center: uncheck the “Enable command timeout” checkbox in the “Serial” box.

#### Example commands

Here are some example commands you might want to put into a shortcut, along with information about how the command works:

ticcmd --resume --position 200 --pause-on-error

The command above will send the “Energize” and “Exit safe start” commands and set the Tic’s target position 200. The Tic’s input mode should be set to “Serial / I²C / USB” for this command to work. The --pause-on-error option means that if there are any errors communicating with the Tic, then ticcmd will keep running until you press Enter or close the window. This prevents the ticcmd output window from closing immediately and allows you to read the error message. However, if there are some errors that are still happening on the Tic that prevent the motor from moving, there will be no notification.

ticcmd --resume --velocity 1000000 --pause-on-error

The command above will send the “Energize” and “Exit safe start” commands and set the Tic’s target velocity to 1000000 (100 pulses per second). You can set the velocity to 0 if you want the Tic to decelerate to a stop, or set it to a negative number to make it turn the other way. As in the previous command, --pause-on-error gives you a chance to see error messages if there is any problem communicating with the Tic.

ticcmd --deenergize --pause-on-error

The command above will send the “De-energize” command, causing the Tic to de-energize its stepper motor coils by disabling its stepper motor driver. You can find more details about this command in Section 8. As in the previous command, --pause-on-error gives you a chance to see error messages if there is any problem communicating with the Tic.

ticcmd --status --pause

The command above shows status information from the Tic. You can add the --full option to see more information. The --pause option tells ticcmd to always wait for you to press Enter or close the window before terminating, which gives you a chance to see the output. By default, the ticcmd console window will not have enough lines to show the full status output all at once. To fix this, you can modify the shortcut to make the console have more lines: right-click on the shortcut, select “Properties”, select the “Layout” tab, and then in the “Window Size” box change the “Height”.

#### Multiple Tic devices

If you have multiple Tic devices connected to the computer via USB, you will need to add the -d option to each shortcut in order to specify the serial number of the device you want to use. For example, a shortcut that gets the status of the Tic with serial number 12345678 would have a command like ticcmd -d 12345678 --status --pause. You can see your Tic’s serial number in the Tic Control Center or by running ticcmd --list.

#### Multiple commands in one shortcut

You can specify multiple commands to the Tic in one shortcut by just adding more options. For example, you could temporarily change the current limit and set the target position at the same time with a command like ticcmd --current 500 --position 1234 --pause-on-error. The order of the options does not matter; the utility performs the commands in a predetermined order. If you need something a bit more complicated, you might consider writing a Batch or PowerShell script.

#### Shortcut customizations

In the Properties dialog for a shortcut, you can change its icon or assign a shortcut key. You can add shortcuts to your Start Menu or make a toolbar of shortcuts inside the taskbar for quick access.

(702) 262-6648
Same-day shipping, worldwide