Immediate Commands

Use immediate commands to issue an AeroScript line to execute on a task. Immediate commands can execute at the same time as programs that are running on the same task. To issue immediate commands in Automation1 Studio, use the command bar in the Workspace toolbar. For more information, refer to Automation1 Studio. To issue commands in a MachineApp, use the Immediate Command Module.

You cannot issue an immediate command while a different immediate command is executing. To find the status of an immediate command, examine the ImmediateExecuting bit of the TaskStatus0 status item.

Tip: Immediate commands operate similarly to sync() statements. To find the status of a sync() statement, examine the SynchronizedFunctionExecuting bit of the TaskStatus0 status item.

Effects of Immediate Commands on Program Execution

To prevent changes in the execution of programs that are running, issue immediate commands on a task that is not running a program. The immediate command will execute the same as a program line in a program on the task.

If you issue an immediate command on a task that is running a program, the immediate command might change the execution of the program.

For some advanced motion features, the controller must execute the program before it causes the motion so that it can precalculate the moves and speeds. This operation is called lookahead. For more information, see Lookahead Synchronization.

Some functions are always synchronized with motion. A task error will occur if you issue an immediate command that contains one of these functions while the program is also running one of these functions. For a list of these functions, see AeroScript Functions Always Synchronized with Motion.

If you issue an immediate command while lookahead is active, lookahead stops temporarily if the immediate command contains a function that the controller cannot look through or if the immediate command contains an AeroScript function that must have more than one millisecond to complete, such as the Callback() function. If lookahead temporarily stops, the operation and timing of the Corner Rounding, Cutter Radius Compensation, or Velocity Blending features can change. For more information, see How To Prevent Problems During Lookahead.

If lookahead is not active and you issue an immediate command that contains an AeroScript function that must have more than one millisecond to complete, such as the Callback() function, the program pauses until the immediate command completes.

IMPORTANT: Immediate commands execute each line of AeroScript on a task. Thus when you use a relative path in an immediate command, it is always applied as an absolute path. To make sure that the path points to the correct file, Aerotech recommends that you use only absolute paths in any function that refers to a file on the controller file system.