Command Request and Acknowledge Bits

The Command Request and Command Acknowledge bits provide synchronization of commands and status information between the PLC and RMC. Using these bits is optional.

These bits are available only when writing commands directly to the Command Area registers from an external host controller, such as a PLC.

For many PLC applications, they are very important. When reading status bits and status registers, these bits let the PLC know that the data being requested is valid. For example, after a Move command is issued, the In Position status bit is not valid until the RMC has informed the PLC that it received the command. The RMC does this by matching the Command Acknowledge bit to the Command Request bit.

Note:
The Command Request and Command Acknowledge bits are independent from the Sync Register that is used in EtherNet/IP and PROFINET cyclic I/O.

PROFIBUS

These bits are available only for the Basic/Enhanced modes. The PROFIBUS I/O mode does not use the command area, and instead uses a simple method to handshake data between the PLC and RMC.

For details on using the REQ and ACK bits with PROFIBUS Basic/Enhanced modes, see the Basic/Enhanced PROFIBUS Modes topics.

Ethernet and Serial (RS-232/485)

For Ethernet and serial (RS-232/485) communication, each axis has a Command Request and Command Acknowledge bit.

To set the Command Request bit, add 256.0 to the command. For example, writing 20.0 to the Command register would issue the Move Absolute command with the REQ bit cleared. Writing 276.0 to the Command register would issue the Move Absolute command with the REQ bit set.

The Command Acknowledge bit is bit 31 of the Status Bits register. When a command has been received by the RMC, it will update the ACK bit in the Status Bits register to match the REQ bit of the command.

The ACK bits of all axes whose Command registers are written to in a single transaction will be modified at the same time. This allows the user to take a shortcut and, if they are writing to all axes every time they issue a command to even a single axis, only check the ACK bit on axis 0 (compare examples 2 and 3 below).

The RMC keeps track of the REQ and ACK bits for each communication channel. The REQ and ACK bits of one communication channel will not interfere with the REQ and ACK bits of another channel. For example, if two PLCs are connected to an RMC75E via Ethernet, each can independently use the REQ and ACK bits. Likewise, the REQ and ACK bits of a PLC connected to the RMC75S serial port will not interfere with the REQ and ACK bits of another PLC connected to the Monitor port.

 

Note:
This means that the Ack bit will NOT be visible in RMCTools, since it uses a different communications channel!

The REQ and ACK bits will work correctly even if the Status Bits register is read via the Indirect Data Map.

The ACK bit defaults to 0 when the RMC powers up. When starting up a PLC program, the PLC can write zeros to all the Command registers, which will immediately set the ACK bit for each axis to zero, giving them a known state.

Examples

The examples below refer to several RMC registers. Their addresses in each RMC are given here for your convenience:

Register Name

RMC75 Address

RMC150 Address

RMC200 Address

Axis 0 Command register

%MD25.0

%MD40.0

%MD16.0

Axis 0 Command registers

%MD25.0-9

%MD40.0-9

%MD16.0-9

Axis 0 Status Bits register

%MD8.0

%MD8.0

%MD256.0

Axis 1 Command register

%MD25.10

%MD40.10

%MD16.10

Axis 1 Command registers

%MD25.10-19

%MD40.10-19

%MD16.10-19

Axis 1 Status Bits register

%MD9.0

%MD9.0

%MD257.0

Axis 0 ACK bit

bit 31 in %MD8.0

bit 31 in %MD8.0

bit 31 in %MD256.0

Axis 1 ACK bit

bit 31 in %MD9.0

bit 31 in %MD9.0

bit 31 in %MD257.0

Example 1: Commanding a Single Axis

  1. On startup, the user writes 0.0 to the Axis 0 Command register, and clears an internal coil in the PLC, which we'll call Axis0Req. Now the REQ and ACK bits are set to zero.

  2. When it is time to write a new command, the user compares the Axis 0 ACK bit (bit 31 of the Axis 0 Status Bits register) with Axis0Req.  If they are not equal, he will wait until they are before issuing the next command. Otherwise, a command is still being received, and the synchronization will be lost by not waiting.

  3. When the controller is ready (ACK = Axis0Req), the user will toggle Axis0Req, and write a single block of 10 registers to the Axis 0 Command registers, including the command, command parameters, and Axis0Req stuffed in at logical bit 8. Since this is typically a FLOAT write, the user will add 256.0 to the command if Axis0Req is set, or 0.0 if it is not set.

  4. Before looking at the Axis 0 Status Bits register or otherwise assuming that the command has been received, the user must ensure that the Axis 0 ACK bit is equal to Axis0Req again.

  5. Repeat steps 2-4 for issuing additional commands.

Example 2: Commanding Two Axes from the PLC (single ACK/REQ pair):

  1. On startup, the user writes 0.0 to the Axis 0 Command register, and clears an internal coil in the PLC, which we'll call AxisCmdReq. Now the REQ and ACK bits are set to zero.

  2. When it is time to write a new command to either axis, the user compares the Axis0 ACK bit with AxisCmdReq.  If they are not equal, he will wait until they are before issuing the next command. Otherwise, a command is still being received (on either axis), and the synchronization will be lost by not waiting.

  3. When the controller is ready (Axis0 ACK = AxisCmdReq), the user will toggle AxisCmdReq, and write two commands (10 regs each) to the Axis 0 and Axis 1 command registers, including the command, command parameters, and AxisCmdReq stuffed in at logical bit 8 of the Axis 0 command (regardless of which axis the command is to). It is important that all 20 registers be written regardless of which of the 2 axes is receiving a command (write zeros to any axis that is not to receive a command).

  4. Before looking at EITHER axis's Status Bits register or otherwise assuming that the command has been received, the user must ensure that the Axis0 ACK bit is equal to AxisCmdReq again.

  5. Repeat steps 2-4 for issuing additional commands.

Example 3: Commanding Two Axes from the PLC (one ACK/REQ per axis):

  1. On startup, the user writes 0.0 to the Axis 0 and Axis 1 command registers, and clears internal coils in the PLC called Axis0Req and Axis1Req. Now the REQ and ACK bits for each axis are set to zero.

  2. When it is time to write a new command to an axis, the user compares the ACK bit for the axis/axes to be commanded with the corresponding AxisnReq bit(s). If they are not equal, he will wait until they are before issuing the next command. Otherwise, a command is still being received, and the synchronization will be lost by not waiting. If commands need to be issued simultaneously to both axes, both axes' ACK/REQ bits should be required to be equal.

  3. When the controller is ready (ACK = REQ for the necessary axis/axes), the user will toggle AxisnReq for each axis receiving a new command, and write the command(s) (10 registers each) to the command register for that axis, including the command, command parameters, and AxisnReq stuffed in at logical bit 8 of each Command register.

  4. Before looking at any given axis's Status Bits register or otherwise assuming that a command on the axis has been received, the user must ensure that the ACK bit in the status register for that axis is equal to Axis0Req or Axis1Req.

  5. Repeat steps 2-4 for issuing additional commands.

 

See Also

Issuing Commands | Status Bits


Send comments on this topic.

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