Program Edit in RUN Mode

Related Topics

Warning

When you download changes to a PLC in RUN mode, your changes immediately affect process operation. There is no margin for error; mistakes in your programming edits can cause death or serious injury to personnel, and /or damage to equipment. Only qualified personnel should perform a program edit in RUN mode.


The following subjects are discussed in this topic:

Overview

Prerequisites for Editing in RUN Mode

Possible Complications

Handling Positive or Negative Transitions (EU, ED Instructions)

Initiating a Program Edit in RUN Mode

Downloading Your Edits

Specifying CPU Allocation (Background Time)

Firmware/ Hardware Support for Program Edits in RUN Mode

Overview

Back to Top

The Program Edit in RUN Mode feature allows you to make changes to a program and download them to your PLC without switching to STOP mode.

·You can make minor changes to your current process without having to shut down.
Example: Change a parameter value.

·You can debug a program more quickly with this feature.
Example: Invert the logic for a normally open or normally closed switch.

If you download changes to a real process (as opposed to a simulated process, which you might do in the course of debugging a program), it is vital to think through the possible safety consequences to machines and machine operators before you download.

Prerequisites for Editing in RUN Mode

Back to Top

You cannot download your program edits to a PLC that is in RUN mode unless you have met these prerequisites:

·Your program must compile successfully.

·You must have successfully established communications between the personal computer where you are running STEP 7-Micro/WIN 32 and the PLC.

·The firmware of the target PLC must support the Program Edit in RUN Mode feature.

·The program that you are attempting to download must follow the order of POUs expected by STEP 7-Micro/WIN 32, Version 3.0 or higher. If you upload a project that was created by a lower version of STEP 7-Micro/WIN, your program may or may not follow the required order. If the elements of the program are out of order, STEP 7-Micro/WIN 32 requires you to switch the PLC to STOP mode before downloading the changes. When you download the program, STEP 7-Micro/WIN 32 automatically fixes the POU order. On subsequent downloads of the program, you can use the Program Edit in RUN Mode feature.

If the PLC is transitioned to STOP mode before the edits are completed and successfully downloaded, the editing session is aborted.

Possible Complications

Back to Top

To help you decide whether to download your program edits to the PLC in RUN mode or STOP mode, consider the following facts about RUN mode edits:

·If the control logic for an output is deleted in a RUN mode edit, the output maintains its last state until the next power cycle or transition to STOP mode.

·If HSC or PTO/PWM functions that were running are deleted in a RUN mode edit, then these functions continue to run until the next power cycle or transition to STOP mode.

·If ATCH instructions are deleted in a RUN mode edit but the interrupt routine itself is not deleted, then the interrupt routine continues to execute until the next power cycle or transition to STOP mode. Likewise, if DTCH instructions are deleted, the interrupt routines are not shut down until the next power cycle or transition to STOP mode.

·If ATCH instructions are added in a RUN mode edit and are conditional on the first scan flag, these events are not activated until the next power cycle or STOP-to-RUN mode transition.

·If an ENI instruction is deleted in a RUN mode edit, the interrupt routines continue to operate until the next power cycle or transition from RUN to STOP mode.

·If the table address of a receive box is modified in a RUN mode edit and the receive box is active at the time of the switchover from old program to new program, then the data received is written to the old table address. The new address is not used until the current receive request is completed (to the old address), but since you have edited your program, the program looks for the data in the new address (and it is not there). NETR and NETW instructions function similarly.

·Logic conditional on the first scan flag is not executed until RUN mode is entered as a result of a power cycle or a transition from STOP to RUN mode, because the first scan flag is not affected by a RUN mode edit.

Handling Positive or Negative Transitions (EU, ED Instructions)

Back to Top

So that you can make changes to networks that contain positive or negative transitions (EU or ED instructions) during a RUN mode edit, STEP 7-Micro/WIN 32 temporarily allocates a number to each EU/ ED instruction in your program. When you activate the Program Edit in RUN Mode feature, an element usage tab on the Cross Reference window lists all EU/ ED instructions that are currently assigned. Duplicate EU/ ED instructions are forbidden. Use this list to guide you in making changes to your program.

Initiating a Program Edit in RUN Mode

Back to Top

To initiate a program edit in RUN mode, choose the menu command Debug > Program Edit in RUN.

Note:

If there is any unsaved material in the program that you have in STEP 7-Micro/WIN 32, you are prompted to save your program to the hard drive of your programming device. You can use the same name as the name of the project that is in the PLC, or you can change the name: for example, to BACKUP.MWP.

A warning dialog box appears. Choose the "Continue" button to confirm that you want to proceed with the program edit in RUN mode. This causes the program from the PLC to be uploaded to STEP 7-Micro/WIN 32, where you can make the desired editing changes.

After you make the desired editing changes, you need to download them before they can take effect in the PLC.

It is optional whether you save the results of your program edit to the hard drive of your programming device, and if so whether you save it with the same name as the previous version of the project. Using the same name would cause the previous version to be overwritten.

Downloading Your Edits

Back to Top

You can download only the Program Block (OB1) during a program edit in RUN mode. You cannot download the System Block or the Data Block during a program edit in RUN mode.

Once a download is initiated, you cannot perform other tasks in STEP 7-Micro/WIN 32 until the download is complete.

Examine the Output Window to see if there are any compile errors (for instance, duplicate EU or ED numbers). You can double-click on the error message to bring up the offending network in the STEP 7-Micro/WIN 32 Program Editor window.

Specifying CPU Allocation (Background Time)

Back to Top

When you initiate a download of a program edit in RUN mode, the PLC requires time to compile the modified program in the background (while it continues to execute the currently loaded program).

You can use the Background Time tab of the System Block to change how much time the PLC dedicates to compiling your modified program. The default value is 10% of scan time; you can assign up to 50%. A higher Background Time value causes the program you are downloading to be compiled more quickly, but it increases the overall scan time, which could have a negative impact on the performance of your currently executing program.

Firmware/ Hardware Support for Program Edits in RUN Mode

Back to Top

The following PLC models support the Program Edit in RUN Mode feature:

·CPU 224, Rel. 1.10 (or greater)

·CPU 226/226XM , Rel. 1.00 (or greater)

Back to Top

See Also:

PLC RUN/ STOP Mode

Writing and Forcing Outputs in STOP Mode

Overview of Debugging and Monitoring Features (GS 7.1)

Background Time

Download (File > Download)

How to Download a Program (GS 6.3)

Positive and Negative Transition