what's the default axis?

what’s the default axis in the command? how set default axis?

In the RMCTools help, on the Index tab, if you type ‘Default axis’, you will get to the Tasks topic that includes the section below. Notice that we typically do not recommend using the default axis unless you are very clear on how it works.

Default Axis

Each task has a Default Axis associated with it. The Default Axis is used in a User Program when a command’s Commanded Axes field is set to “Default Axis” or when an expression in a user program contains an axis register, but does not specify the axis (for example, _Axis[].StatusBits.InPos).

When a task is started using a Start Task (90) command, the Default Axis for the task will be automatically set to the axis that received the Start Task command.

When a task is started from the Program Triggers, the Default Axis for the task is left unchanged. On power-up, the Default Axis for task #n is Axis n, up to the number of available axes. For any additional tasks, the Default Axis is Axis 0 on power-up. However, the Default Axis for a task can change through Start Task commands (see above) or the Current Axis register (see below).

The Default Axis for a task can be changed at any time by changing the Current Axis register for the task (see _CurAxis below). For example, to restore the Default Axis for a task to its power-on default axes on an 8-axis controller, you could use the following expression:

_CurAxis := SEL(_CurTask < 8, _CurTask, 0);

The Default Axis is typically used only in advanced applications and is not recommended for new users.

Why Bother?

Consider a multi-axis application where each axis runs the exact same sequence. Instead of creating one user program for each axis, you can create a single user program that issues commands to the Default Axis, and does not specify an axis in the link condition. Simply issue the Start Task commands to each axis. The user program can run independently on separate tasks simultaneously.