Controller Image Upload/Download

The controller image refers to the entire RMC project as it is stored in RAM memory in the RMC. Only RMCTools can create the controller project (image) and download it to the RMC. However, other devices such as a PLC or PC, or the RMC itself, can read the RMC image via Ethernet or USB, store it, and later download it to the RMC. For the RMC200, the image can also be stored on the SD card.

The Image Upload/Download feature is supported only on the RMC75E, RMC150E, and RMC200. The controller image upload/download is an advanced feature and is not necessary in most applications.

The controller image can only be downloaded to an RMC that matches the hardware configuration of the image. Downloading and applying a controller image typically takes between 3 and 20 seconds, depending on the options selected.

Uses for storing and downloading the controller image include:

  1. Know the exact contents of the RMC
    Allowing the PLC to control the contents of the RMC removes any problems due to tampering with an RMC. For example, when a machine starts up, the PLC may write the image to the RMC so that it knows the RMC has the correct project.
     

  2. Replace an RMC without using RMCTools
    If an RMC needs to be replaced, RMCTools is not needed if the PLC or RMCLink will download the controller image, or if the image is stored on the RMC200 SD card. This may simplify machine repair when an experienced RMC user may not be available.

  3. Make more user programs available to the user
    If an application requires more user programs than will fit in the RMC, and only a few user programs are used at any given time, this feature allows splitting up the user programs between several images. When a certain user program is required, the respective image is downloaded to the RMC, then the user program can be run.

Image Size

The size of the image varies based on the specific configuration, especially the amount of user programming and curves included. The Image Upload/Download supports the sizes listed below. Typically, the image size is much smaller, unless the controller includes large curves, in which case the image may exceed the maximum image size, which is not supported by the Image Upload/Download.

 

RMC

Max Image Size
(32-bit registers)

Typical Image Size
(varies greatly, and can be much larger with curves)

RMC75E

65,000

4,000

RMC150E

65,000

4,000

RMC200

1,575,949

11,000

 

Uploading an Image into a PLC

Refer to the Image Area section below for the registers referred to by this procedure.

  1. Preparation

  2. Request the RMC to Build the Configuration Image
    The PLC must first request the RMC to construct an image that can be uploaded into the PLC. This is done by writing Build Upload Image (1) to the Image Area Command (%MDx.0) register.

  3. Wait for the Image to be Built
    The RMC may take several seconds to build the requested image. During this time, the PLC should repeatedly read the Image Area State (%MDx.1) register and wait for the state to be Upload Image Built (2).

  4. Determine the Length of the Image
    The length of the image, in 32-bit registers, can now be read from the Image Size (%MDx.2) register. The PLC can use the contents of this register either to control the length of the image upload, or to simply verify that the image will fit in the space provided on the PLC.

  5. Read the Image from the RMC Controller
    Read the image from the RMC Controller by repeatedly reading from the Image Data (%MDx.4-…) registers until the entire image has been transferred.

For example, to read a 8000-register image, the PLC could read 4000 registers twice, starting each read at %MDx.4. Or, if the PLC is limited to 1000 registers per read, then the PLC could read 1000 registers eight times, again starting each read at %MDx.4. Both will result in loading the same 8000-register image. The PLC is responsible for assembling the results from each read into a single image in its storage area.

The PLC may choose to include the Current Index (%MDx.3) register in each read. This value can be used to verify that the PLC and RMC agree on the index for the current block of data.

Downloading an Image from a PLC

Refer to the Image Area section below for the registers referred to by this procedure.

  1. Preparation

  2. Reset the Image Area.
    Write Reset Image Area (3) to the Image Area Command (%MDx.0) register.

  3. Write the Image to the RMC Controller
    Write the image to the RMC Controller by repeatedly writing to the Image Data (%MDx.4-…) registers until the entire image has been transferred. Each subsequent write must begin at the start of the Image Data array. The RMC will reassemble the data from each write into a single image.

    The PLC may choose to include the Current Index (%MDx.3) register in each write. The RMC will verify that the index value written matches the next expected image index. If the index value is incorrect, then the Image Area State (%MDx.1) will change to Download Sequence Error (22).

    The PLC can choose to write a fixed-length image to the RMC—as long as the image is known to fit within that size—or it can adjust the length of the image it writes based on the actual length of the image, which is found in the first register of the stored image.

  4. Trigger the RMC to Apply the Image
    The PLC must then instruct the RMC to apply the newly-downloaded image. To do so, write Apply Download Image (2) to the Image Area Command (%MDx.0) register.

  5. Wait for the Apply to Complete
    Applying the image takes between 10-20 seconds (to shorten this time, see Do Not Restart Controller Option below). The controller will verify the integrity of the downloaded image, save a copy of the image in the controller’s flash memory, and then automatically restart to apply the new image.

    The PLC should monitor the progress of the apply process using the Image Area State (%MDx.1) register. If the image is successfully verified and saved to flash, then the state will transition from Applying Image (4) to Controller Restart Pending (5). The controller holds this state for two (2) seconds before restarting. When the PLC sees that the controller is in the Controller Restart Pending (5) state, it should stop communicating with the RMC for approximately 10 seconds to allow the controller to restart without triggering unnecessary communication errors. After restarting, the Image Area State (%MDx.1) register will read Idle (0).

Do Not Restart Controller Option

This option is not supported by the RMC200.

The Do Not Restart Controller (+16) option can be used if the downloaded image does not change the axis definitions or loop time. This option will speed up the process, as the RMC does not need to restart. The image will be saved to Flash and all the settings will be available for use immediately. Downloading using this option typically takes less than 5 seconds.

If the Do Not Restart Controller (+16) option is used, then you should instead wait for the Image Area State (%MDx.1) register to become Image Applied (10). There is no need to stop communicating with the RMC when this option is used. The RMC must be in PROGRAM mode when the image is applied.

Save/Restore Image Using the RMC200 SD Card

The RMC200 controller image can be saved to the SD card and restored from the SD card. For details, see the Using the SD Card topic.

Using RMCLink to Store and Download Images

The Controller Image Upload/Download feature can also be accessed from a Windows-based PC using the RMCLink component. This component contains methods that make it easy to upload and download configurations in custom applications using a variety of programming languages. RMCLink can be downloaded from Delta’s website. Review the RMCLink documentation for details, particularly the topics relating to the ReadImageToFile and WriteImageFromFile methods.

Image Area

The Image Area is located in file 30 on the RMC75, and in file 94 on the RMC150. This file has the following structure.

 

RMC75
Address

RMC150
Address

RMC200
Address

Type

Access

Description

%MD30.0

%MD94.0

%MD23.0

DINT

Write Only

Image Area Command

One of the following:

0=No Command

1=Build Upload Image

2=Apply Download Image

3=Reset Image Area

Options for Apply Download Image (2):

+16=Do not restart controller

%MD30.1

%MD94.1

%MD23.1

DINT

Read Only

Image Area State

One of the following:

0=Idle

1=Building Upload Image

2=Upload Image Built

3=Download in Progress

4=Applying Image

5=Controller Restart Pending

10=Image Applied

20=Image Build Error

21=Upload Sequence Error

22=Download Sequence Error

23=Invalid Download Image

24=Cannot Apply without Restart

25=Failure writing to Flash

26=Must be in PROGRAM mode to apply without restart

27=Image supports a different hardware configuration

28=Controller unable to build upload image because copy protection is enabled

%MD30.2

%MD94.2

%MD23.2

DINT

Read Only

Image Size

Provides the size of the Upload Image, in 32-bit registers.

%MD30.3

%MD94.3

%MD23.3

DINT

Read/Write

Current Index

Provides the current index, in registers, in a multi-part image upload or download.

%MD30.4

:

%MD30.4095

%MD94.4

:

%MD94.4095

%MD23.4

:

%MD23.4095

DINT[4092]

Read/Write

Image Data

Used to upload or download the next block of the controller image.

 

See Also

RMC75 Register Map - File 30 Image Area | RMC150 Register Map - File 94 Image Area | RMC200 Register Map - File 23 Image Area | Save Controller Image (120) | Restore Controller Image (121)


Send comments on this topic.

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