Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 4 Expressions

4.3 The Command Line Interface

Scroll Prev Top Next More

 

commandAlert

The Command / Alert serves two purposes.  It displays DAQFactory messages known as alerts, and it allows you to enter commands and expressions.  The use of the command line interface is not required to use DAQFactory, but is very useful.  If you cannot see the Command / Alert window, go to View - Command/Alert in the main menu.  

Most of this docking window contains a read-only area that displays DAQFactory alerts, commands you have typed in and the results of those commands if any.  At the bottom is a single line editing area where you can type in commands.  Commands can be any sequence script command that runs in one line.  For example:

 

global y = 4

 

MyChannel.read()

 

Execute(strMyFunc)  

It cannot be script flow functions like while or for.  

When you hit Enter, the command is executed and added at the bottom of the display area.  None of these commands will display anything else unless there is an error, in which case it will be displayed below the command.

If instead of a command, you wish to see the result of an expression or function call, you can use the print command, denoted by the question mark.  The print command can also be used in sequence script as described later.  By putting a question mark first, the result of the expression after the question mark is displayed.  This means what is after the question mark must be an expression and not a command.  So, you can do:

 

? MyFunction()

 

? 5 + 3

 

etc.

but you cannot do:

 

? global y = 4

 

etc.

A few points:

1) you can use the up and down arrow keys to scroll through a history of the last 100 commands you've executed.

2) if you are debugging a sequence, the command line interface runs in the scope of the sequence being debugged to allow you to view private variables.  The watch works the same way.  As a bonus you can actually change private variables in functions from the command line interface when a sequence is being debugged.  The watch only allows you to view values.

3) when you print a large array, the entire array is actually displayed in the display area.  So:

 

? MyChannel

will actually display the entire history of MyChannel (at least the part in memory, see Persistence for more detail on that...) up to 10,000 values in each dimension.  With variable value components, the watch, and big expression window only the first 20 values in each dimension are displayed.  This is actually done so you don't hang your computer trying to print a million points of history every 1/2 second as the watch refreshes.

4) you can use the F2 key to quickly put your cursor in the command line from most views, even if the command/alert window is hidden.

5) each line is limited to 16000 characters.