Issuing Commands to the RMC

The commands are the building blocks of RMC programming. Commands tell the RMC what to do. For a list of commands, see the Command List topic. There are several methods of sending commands to the RMC:

Issuing Commands from RMCTools

When you are setting up, tuning, programming and troubleshooting the RMC, use the Command Tool in RMCTools to issue commands to the RMC. See the Command Tool topic for details on issuing commands from RMCTools.

For Shortcut commands, see the Shortcut Commands topic.

Issuing Commands from within a User Program

User Programs carry out complex sequences of commands on the RMC without requiring intervention from a PLC or other controller.

See the User Programs topic for details on how to create and run user programs to issue to commands to the RMC.

Issuing Commands from a Host Controller, such as a PLC or HMI

You can issue commands directly to the RMC from a host controller, such as a PLC or HMI. It is possible to issue commands to multiple axes simultaneously.

Via PROFIBUS

See the PROFIBUS Overview topic and read the topic of the mode you are using.

Via PROFINET IO

See the Using a PROFINET I/O Connection topic.

Via EtherNet/IP I/O

See the Using an EtherNet/IP I/O Connection topic.

Via Ethernet (Modbus/TCP, FINS/UDP, CSP or DF1 over Ethernet, Mitsubishi Procedure Exist)
or Serial RS-232/485 (Modbus RTU, DF1,Mitsubishi Bidirectional Protocol)

Use the following procedure to issue a command:

  1. Determine which Axes
    Determine which axis or axes you are going to issue the command to.

  2. Find the Address
    Use the following topics to locate the addresses of the Command Registers for the communication protocol and RMC you are using:
    DF1 Addressing
    Modbus Addressing
    FINS Addressing

  3. Write to the Command Registers
    Write values to the Command Registers of the axis or axes you wish to issue the command to. You need only write to as many Command Parameters as are used by the command you will issue.

    Note:
    The RMC will process the command as soon as a write is made to the Command register. Most PLCs or HMIs can write to the these in one write, such as a block write.
    If your host controller can only write to one register at a time, it is important that you write to the Command register last. If your system can write to multiple registers at a time, you can write to all the Command Area registers at once.

    Note:
    If you are using a 16-bit addressing protocol, such as Modbus, you must write 2 words for each register you wish to write to in the RMC. All command registers are 32-bit floating-point values.

    Caution: For each command you wish to issue, write it only once so that it is issued only once. If you issue the same motion command multiple times, it can cause the target position to overshoot the requested position.

     

  4. Optional: Use the Command Request and Acknowledge Bits
    If your system requires tight synchronization, you should use the Command Request and Acknowledge bits. These bits indicate that the RMC has received the command. Typically, these bits are only needed when using a PLC or other highly capable host controller. See the Command Request and Acknowledge bits topic for details.
    For example, if you issue a Move command and then wait for the In Position Status bit to be set, it is important that you do not start checking the In Position status bit until the RMC has received the command. The Command Request and Acknowledge bits tell you when there RMC has received  command.

Examples

  1. ClosedRMC75: Move Absolute Command to Axis 1

    The user wishes to issue the following move absolute command to Axis 1 of the RMC75:

    Move Absolute(20):

    • Command Parameter 1: Position = 5.2 in.

    • Command Parameter 2: Speed = 14 in./sec

    • Command Parameter 3: Acceleration = 100

    • Command Parameter 4: Deceleration = 100

    • Command Parameter 5: Direction = 0

    With Allen-Bradley DF1 Addresses:

    From the RMC75 Register Map - File 25 Commands, we see that the addresses for the Axis 1 command registers are F25:10-19. To issue this command to the RMC75 via DF1, CSP, or EtherNet/IP, do the following:

    1. Write 20 to F25:10

    2. Write 5.2 to F25:11

    3. Write 14 to F25:12

    4. Write 100 to F25:13

    5. Write 100 to F25:14

    6. Write 0 to F25:15

    With Modbus/RTU or Modbus/TCP Addresses:

    From the RMC75 Register Map - File 25 Commands, we see that the addresses for the Axis 1 command registers start at register offset 12821. The offsets must be prefixed with a 4. To issue this command to the RMC75 via Modbus/RTU or Modbus/TCP, do the following:

    1. Write 20 to 412821

    2. Write 5.2 to 412823

    3. Write 14 to 412825

    4. Write 100 to 412827

    5. Write 100 to 412829

    6. Write 0 to 412831

     

  1. ClosedRMC150: Start User Program 8

    To start user program 8, the user decides to issue the following command to Axis 0 of the RMC150:

    Start Task (90):

    • Command Parameter 1: Task = 0

    • Command Parameter 2: Program = 8

    With Allen-Bradley DF1 Addresses:

    From the RMC150 Register Map - File 40 Commands, we see that the addresses for the Axis 0 command registers are F40:0-9. To issue this command to the RMC75 via DF1, CSP, or EtherNet/IP, do the following:

    1. Write 90 to F40:0

    2. Write 0 to F40:1

    3. Write 8 to F40:2

    With Modbus/RTU or Modbus/TCP Addresses:

    From the RMC150 Register Map - File 40 Commands, we see that the addresses for the Axis 0 command registers start at register offset 20481. The offsets must be prefixed with a 4. To issue this command to the RMC75 via Modbus/RTU or Modbus/TCP, do the following:

    1. Write 90 to 420481

    2. Write 0 to 420483

    3. Write 8 to 420485

     

  2. ClosedRMC200: Start User Program 2
     

    To start user program 2, the user decides to issue the following command to Axis 0 of the RMC200:

    Start Task (90):

    • Command Parameter 1: Task = 0

    • Command Parameter 2: Program = 8

    With Allen-Bradley DF1 Addresses:

    From the DF1 Addressing topic, we see that the RMC200 addresses for the Axis 0 command registers are F12:0-9. To issue this command to the RMC200 via DF1, CSP, or EtherNet/IP, do the following:

    1. Write 90 to F12:0

    2. Write 0 to F12:1

    3. Write 8 to F12:2

    With Modbus/RTU or Modbus/TCP Addresses:

    From the Modbus Addressing, we see that the RMC200 addresses for the Axis 0 command registers start at register offset 20481. The offsets must be prefixed with a 4. To issue this command to the RMC75 via Modbus/RTU or Modbus/TCP, do the following:

    1. Write 90 to 42049

    2. Write 0 to 42051

    3. Write 8 to 42053

     

Command Format

Each RMC command consists of a command number and command parameters.

Notice that the Command Number and Command Parameters are all floating point numbers, as seen from the PLC or HMI issuing the command. However, the command number must be a whole number (e.g. 20, or 20.0, not 20.1)), and certain command parameters must be integers or are limited to a certain range, depending on the command.

 

For more details on commands, see the Commands Overview topic.

Advanced Details

Immediate Commands

Certain commands in the RMC are immediate commands. There is no limit to the number of immediate commands that can be issued to an axis per loop time, whereas a maximum of one non-immediate command per loop time can be issued to each axis.

Immediate commands are usually not motion commands. The ability to issue multiple immediate commands in one loop time affects primarily the user programs, since it is difficult to issue many simultaneous commands via the external communications.

Commands Issued Simultaneously

Commands sent simultaneously to the RMC in the same communication block will always be issued simultaneously. For all communications methods, the RMC waits until the entire communication block is received before issuing any of the commands in the block. The commands received in this block are referred to as a command set. Such a command set can contain at most one command per axis, with the exception of immediate commands in user programs, which are unlimited.

Command Queue

As command sets are received from various sources, they are placed in a command queue. Each control loop, the controller processes command sets from the queue on a first-in first-out basis, stopping when it reaches a command set that would issue a non-immediate command to an axis that has already processed a non-immediate command this control loop. Command sets remaining in the command queue will be processed in subsequent control loops. Notice that commands issued as part of the same command set will never be split between different control loops. That is, either all of the commands in the command set will be processed in the control loop, or none of them will be and the entire command set will be deferred to the next control loop.

The command queue has a finite length. The RMC75 command queue allows up to 6 command sets, each set with up to one command per axis. The RMC150 allows up to 12 command sets. If the command queue is full when a new command set is received, the command set will be discarded, and Runtime Error 201 (Command block dropped) will be logged in the Event Log. This condition can only practically occur in cases where non-immediate commands are being issued continuously from a user program. Notice that Expression commands are immediate commands and are therefore safe to issue continuously from user programs.

 

See Also

Command Request and Acknowledge Bits | Communications Overview


Send comments on this topic.

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