SEND_CMD_MULTI Function

SEND_CMD_MULTI (setOfAxes, cmd, param0, …)

Sends a command to all the specified axes.

Parameters

setOfAxes(DWORD or DINT or AXIS_SET)

Specifies the set of axes to send the command to. This may be specified using a simple DWORD or DINT to select a set of axes in the range of 0 to 31. Otherwise, for axes numbers 32 and beyond, the AXIS_SET function must be used to specify the set of axes to command.

The command will be issued to axes that exist. If any of the specified axes do not exist, the command will not be issued to those axes, with no notice provided.

Each bit in the DWORD or DINT corresponds to the axis with the same number as the bit. Bit 0 corresponds to axis 0, bit 1 corresponds to axis 1, bit 2 corresponds to axis 2, etc.

Axes are numbered beginning with zero. In a DWORD expressed in hexadecimal, the least significant bit (bit 0) of a hexadecimal value is on the right and the most significant bit (bit 31) is on the left. For example, in the hexadecimal value 16#80000000, the most significant bit, bit 31, is set.

cmd(DINT)

The command to send. Must be a literal value (such as 20) or a constant and cannot be a variable, an expression, or a floating point value (entering 20.0 is not accepted).

Named constants are available to use for the cmd parameter. For example, the constant CMD.MOVE_ABS is a value of 20 for the Move Absolute (20) command. To access the constants, in the Expression Editor, on the Tags tab, expand Expression Constants.

param0(REAL or DINT)

The parameters of the command, from param0 to param8. All parameters for the specified command must be entered. For example, the Move Absolute (20) command has 6 parameters, so all 6 parameters must be entered. The Clear Faults (4) command does not have any parameters, so no parameters should be entered.

The data type is internally converted to a REAL. Some parameters require a whole number, which may be entered as a REAL or a DINT. Expressions, literals, and variables are also supported. In addition, for the Set Discrete Output, Clear Discrete Output, and Toggle Discrete Output commands, the I/O Point command parameter may be the I/O point tag name.

Address parameters:

For command parameters that require an address, such as the Master Register parameter for gearing and curve commands, the address must be entered in the command parameter as a numerical address. Passing the tag itself, such as “_Time” or “_Axis[5].TarPos”, will cause the value held in the register to be interpreted as the address. Instead, the numerical address (N) of the register must be used:

N = file * 4096 + element,

where file and element are from the IEC address format of the RMC register, given as %MDfile.element.

Example:

Use SEND_CMD_MULTI to start curve 10 on axes 0 and 1 simultaneously for 1 cycle, geared to the _Time register. First, we must calculate the address of the _Time register, which is different for each controller family:

 

Controller

IEC Address

Numerical Address

RMC75

%MD20.10

20 * 4096 + 10 = 81930

RMC150

%MD44.10

44 * 4096 + 10 = 180234

RMC200

%MD18.10

18 * 4096 + 10 = 73738

For the RMC200, the following command will start the desired curve based on time:

SEND_CMD_MULTI(16#3, CMD.CURVE_START, 10, 18*4096+10, 1);

Notice that the following would be incorrect:

SEND_CMD_MULTI(16#3, CMD.CURVE_START, 10, _Time, 1);

Return Value

The SEND_CMD_MULTI function does not return a value.

Remarks

The SEND_CMD_MULTI function may only be used in the Expression (113) command. It may not be used in other expressions, such as in Link Types, Program Triggers, etc.

The SEND_CMD_MULTI function simultaneously sends identical commands to all the axes specified by the setOfAxes parameter. To simultaneously send different commands to multiple axes, use the SEND_CMD function, with one instance per axis.

Some commands are not necessary to send within an expression. For example, the Set Discrete Output, Clear Discrete Output, and Toggle Discrete Output commands are unnecessary because the discrete output tag can be directly written to.

The RUN Mode (98), Expression (113) and No-op (0) commands are not allowed to be used in the SEND_CMD_MULTI function.

Examples

SEND_CMD_MULTI(16#9, CMD.MOVE_ABS, 15, 10, 100, 100, 0);

Sends the Move Absolute (20) command to axis 0 and 3, with a position of 15, velocity of 10, acceleration and deceleration of 100, and direction of 0.

SEND_CMD_MULTI(16#3FF, CMD.CLEAR_FAULTS);

Sends the Clear Faults (4) command to axes 0-9.

SEND_CMD_MULTI(AXIS_SET(16#0, 16#F00), CMD.CURVE_START, 4, 73738, 1);

Send the Curve Start (86) command to axes 40-43, to run curve 4, using _Time as the master (the integer value for the RMC200 _Time register is 73738), with one cycle.

 

See Also

AXIS_SET Function | CMD Constants | SEND_CMD Function | Standard Functions


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion