Niagara Command Line
Niagara Command Line
This article describes how to use Niagara's cmdline-only mode. This mode allows Niagara users to load and run basic Niagara operations from a
Windows Command Prompt or Linux Terminal. Additionally, cmdline mode allows users to execute a Tcl script and then exit back to the
command prompt. This functionality is available in all editions of Niagara starting with version 3.3.7.
To open Niagara in cmdline mode, navigate to the Niagara folder. Then run the appropriate command for the OS being used:
All parameters are optional and may be issued in any order. For example:
Niagara_Cmdline.bat -h
bash Niagara_Cmdline.sh -h
Starting in version 3.3.8, users can enter "ncli" (Niagara Command Line Interface) instead of "Niagara_Cmdline" in both Windows and Linux. The
"ncli" command is simply a wrapper for the Niagara_Cmdline files.
Legacy Arguments:
To open Niagara in cmdline mode, navigate to the Niagara folder. Then run the appropriate command for the OS being used:
If <driver> is not specified, Windows will default to using WinCIL and Linux will default to using SG.
If <script> is not specified, Niagara will load and then prompt the user for commands. Users can enter "exit" to return to the Command Prompt.
If <script> is specified, Niagara will load, attempt to run the Tcl script provided, and then automatically exit back to the Command Prompt. A driver
must be specified in order to run a script. Also note that forward slashes must be used to specify a file path and that spaces in the file path are
not allowed. Valid: C:/temp/test.tcl. Not valid: C:\temp\test.tcl. Not valid: C:/my temp/test.tcl.
If <dev_id> is specified, then the variable ::env(dev_id) will be set to that value. If not specified, ::env(dev_id) will be set to 0. This variable can
then be used in Tcl scripts to specify a specific device for Niagara to select. For an example of how this can be used, see this Tcl file: cmdline_ex
ample.tcl
If <directory> is specified, Niagara will attempt to run in that directory. Any files that Niagara writes will be stored there including the user_prefs.tcl
file. This is useful when the install directory cannot be written to for one reason or another.
Please note that while all parameters are optional, if you specify one you must also give all earlier parameters. For example to specify the the
dev_id you must also give the driver and script.
Not every Niagara tool can run in cmdline mode just yet. Enter "help" while in cmdline mode to see a list of some of the supported commands.
All "uil", "device", "buff", and drive commands are supported, along with the commands that run the tools in this table:
Tool Command
BitFlip ::bitflip::plot
Enter <command> -help to learn more about how to use the commands in this table.