File Transfer with USB Memory Key

Introduction

The Modicon M258 Logic Controller allows file transfers with a USB memory key. Using this key, it is not necessary to use EcoStruxure Machine Expert or an FTP Server.

To upload or download files to the controller with a USB memory key, use one of the following methods:

oThe clone function (use of an empty USB memory key)

oA script stored in the USB memory key

When a USB memory key is inserted into the USB Data Port of the controller, the firmware searches and executes the script contained in the USB memory key (/sys/CMD/Script.cmd).

NOTE: The controller operation is not modified during file transfer.

The Mass Storage (USB or SDCard) editor lets you generate and copy the script and all necessary files into the USB memory key.

NOTE: The Modicon M258 Logic Controller accepts only USB key formatted in FAT or FAT32.

Warning_Color.gifWARNING

UNINTENDED EQUIPMENT OPERATION

oYou must have operational knowledge of your machine or process before connecting this device to your controller.

oEnsure that guards are in place so that any potential unintended equipment operation will not cause injury to personnel or damage to equipment.

Failure to follow these instructions can result in death, serious injury, or equipment damage.

If you remove power to the device, or there is a power outage or communication interruption during the transfer of the application, your device may become inoperative. If a communication interruption or a power outage occurs, reattempt the transfer. If there is a power outage or communication interruption during a firmware update, or if an invalid firmware is used, your device will become inoperative. In this case, use a valid firmware and reattempt the firmware update.

NOTICE

INOPERABLE EQUIPMENT

oDo not interrupt the transfer of the application program or a firmware change once the transfer has begun.

oRe-initiate the transfer if the transfer is interrupted for any reason.

oDo not attempt to place the device into service until the file transfer has completed successfully.

Failure to follow these instructions can result in equipment damage.

Clone Function

The clone function allows you to upload the application from one controller and to download it only to a same controller reference.

This function clones every parameter of the controller (for example applications, firmware, data file, post configuration). Refer to Memory Mapping.

NOTE: User access rights can only be copied if the Include User Rights button has been clicked in the Maintenance: User Management Submenu  > Clone management subpage of the Web server.

By default, cloning is allowed without using the function block FB_ControlClone. If you want to restrict access to the cloning feature, you can remove the access rights of the USBExecCommand object on Everyone group. As a result, cloning will be not allowed without using FB_ControlClone. For more details about this function block, refer to the M258 PLCSystem Library Guide. For more details about Access Rights, refer to the EcoStruxure Machine Expert Programming Guide.

To control access to the cloned application in the target controller, use the Include users rights button (in the Clone Management subpage of the Web Server) of the source controller before doing the clone operation. For more details about Access Rights, refer to the EcoStruxure Machine Expert Programming Guide.

The following procedure describes how to upload on your USB memory key the application stored in the controller:

Step

Action

1

Remove power from the controller.

2

Insert the USB memory key into the controller.

NOTE: The USB memory key must be empty to perform this procedure.

3

Restore power to the controller.

4

The clone operation is in progress.

NOTE: The USB LED is green and flashing during upload.

At the end of the upload the USB LED is fixed green, if an error was detected the LED is red.

5

Remove the USB memory key.

The following procedure describes how to download to your controller the application stored in the USB memory key:

Step

Action

1

Remove power from the controller.

2

Insert the USB memory key into the controller.

3

Restore power to the controller.

4

The clone operation is in progress.

NOTE: The USB LED is green and flashing during download.

At the end of the download the USB LED is fixed green, if an error was detected the LED is solid red.

5

Remove the USB memory key to reboot the controller.

NOTE: The controller reference must match the <HardwareRef>.srd file located on the USB memory key (Usr/dta) to restore retained and persistent data.

NOTE: If you wish to control access to the cloned application in the target controller, you will need to enable and establish user access-rights, and any Web Server/FTP passwords, which are controller-specific. For more details about Access Rights, refer to the EcoStruxure Machine Expert Programming Guide.

NOTE: Downloading a cloned application to the controller will first remove the existing application from controller memory, regardless of any user access-rights that may be enabled in the target controller.

Script and Files Generation with Mass Storage

Click Project > Mass Storage (USB or SDCard)... in the main menu:

G-SE-0002104.1.gif-high.gif

 

 

Element

Description

New

Create a new script.

Open

Open a script.

Macros

Insert a Macro.

Generate

Generate the script and all necessary files on the USB memory key.

Command

List of basic instructions.

Source

Source directory on the PC or the controller.

Destination

Destination directory on the PC or the controller.

Add New

Add a script command.

Move Up/Down

Change the script commands order.

Delete

Delete a script command.

Command descriptions:

Command

Description

Source

Destination

Syntax

Download

Download a file from the USB memory key to the controller.

Select the file to download.

Select the controller destination directory.

'Download "/usr/Cfg/*"'

SetNodeName

Sets the node name of the controller.

New node name.

Controller node name

'SetNodeName "Name_PLC"'

Upload

Upload files contained in a controller directory to the USB memory key.

Select the directory.

-

'Upload "/usr/*"'

Delete

Delete files contained in a controller directory.

NOTE: Delete "*" does not delete system files.

Select the directory and enter a specific file name. By default, all directory files are selected.

-

'Delete "/usr/SysLog/*"'

Removes the user access-rights from the controller

-

-

'Delete "/usr/*"'

Reboot

Reboot the controller (only available at the end of the script).

-

-

'Reboot'

NOTE: When Access Rights are activated on a controller and if the user is not allowed to read/write/delete file system, scripts used to Upload/Download/Delete files will be disabled (this includes the clone operation). For more details about Access Rights, refer to the EcoStruxure Machine Expert Programming Guide.

Macros description

Macros

Description

Directory/Files

Download App

Download the application from the USB memory key to the controller.

/usr/App/*.app

/usr/App/*.crc

/usr/App/*.map

Upload App

Upload the application from the controller to the USB memory key.

Download Sources

Download the project archive from the USB memory key to the controller.

/usr/App/*.prj

Upload Sources

Upload the project archive from the controller to the USB memory key.

Download Multi-files

Download multiple files from the USB memory key to a controller directory.

Defined by user

Upload Log

Upload the log files from the controller to the USB memory key.

/usr/Log/*.log

Transfer Procedure

Warning_Color.gifWARNING

UNINTENDED EQUIPMENT OPERATION

oYou must have operational knowledge of your machine or process before connecting the USB memory key to your controller.

oEnsure that safety guards and other safety equipment are operational and active prior to transferring data to the controller.

Failure to follow these instructions can result in death, serious injury, or equipment damage.

Step

Action

1

Create the script with the Mass Storage (USB or SDCard) editor.

2

Click Generate and select the USB memory key root directory.

Result: The script and files are transferred on the USB memory key.

3

Plug the USB memory key into the controller.

NOTE: The USB LED flashes green during transfer.

At the end of the transfer the USB LED is solid green. If an error was detected the LED is solid red.

When the controller has executed the script, the result is logged on the USB memory key (file /sys/CMD/Cmd.log).

4

Remove the USB memory key.

NOTE: A reboot is required to record the new application.

Warning_Color.gifWARNING

UNINTENDED EQUIPMENT OPERATION

Consult the controller state and behavior diagram to understand the state that will be assumed by the controller after you cycle power.

Failure to follow these instructions can result in death, serious injury, or equipment damage.