Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Pausing and Resuming Programs

You can pause and resume programs from the Configuration Editor or DPL Editor.

Note:

On SM-Applications and SM-Applications Lite it is only possible to pause or resume a program if the node properties have requested that debug information is embedded in the program.

To pause or resume a program from within the Configuration Editor

In the Hardware Architecture view, select the node for which to stop or start the program and do one of the following:

  • From the Run menu, choose Pause/Resume Program.

  • On the main toolbar press

To pause or resume a program from within the DPL Editor

Do one of the following:

  • From the Run menu, choose Pause/ Resume Program.

  • On the main toolbar press

To pause or resume a node DPL program from the task manager within the DPL editor

  • In the task manager, press

See Also

  • Controlling Program Execution

  • Debugging Applications

  • Editing the Properties of Nodes

________________________________________________________________________________

Stopping and Stepping Tasks

Stepping a task means executing a single line of code in the task at a time. However, before stepping a task, you need to pause execution of the task. When execution of a task has been paused you can choose to continue normal execution of the task.

To stop or step a task from the DPL editor

1. In the main DPL view, place the cursor in the task to stop.

2. From the Run menu, choose Stop/Step Task.

To stop or step a task from the task manager within the DPL editor

  • In the task manager, select the task to stop or step, then press

When a task is running, it stops (or sleeps). When a task is stepped, the next line in the program is executed, then the task stops again.

The following picture shows a Background task stopped in the DPL editor. The status of the task is shown as Sleeping in the Task Manager and a yellow arrow is shown in the left column of the DPL showing the line which will be executed next if the task is stepped or resumed.

If the task is stepped once as described above by selecting Stop/ Step Task from the Run menu, the line a% = a% + 1will be executed and the DPL editor will look like:

See Also

  • Running Tasks

  • Controlling Program Execution

  • Debugging Applications

  • Using Breakpoints

  • Tasks

________________________________________________________________________________

Running Tasks

Within active programs, you can run specific tasks after having stopped them. You run tasks from within an active program in the DPL Editor or the Task Manager.

To run a stopped task from the DPL editor

1. In the program, place the cursor in the task to run.

2. From the Run menu, choose Run Task.

To run a stopped task from the task manager

  • In the task manager, select the task to run, then press

The task resumes execution. Execution will continue until either a breakpoint is hit or the task is stopped.

See Also

  • Stopping and Stepping Tasks

  • Controlling Program Execution

  • Debugging Applications

  • Using Breakpoints

  • Tasks

Using Breakpoints

While in on-line mode, breakpoints enable you to interrupt, i.e. stop, the execution of a task in a program prior to execution of a specific line of code. Breakpoints can only be set in tasks and only one breakpoint can be set per task.

Once a breakpoint is reached, you can choose to perform many operations:

  • Resume program flow

  • Execute the code in single steps (single lines)

  • Run the task

  • Go to the next breakpoint

Note:

You can execute all DPL tasks in single steps except for event tasks, user-defined tasks and function blocks.

You set breakpoints throughout a DPL program as required. However, these must be placed on lines of code, not on comments or blank lines. You can only set one breakpoint in a DPL task at any one time. Breakpoints cannot be used in sub-routines. QLD and LD/FBD diagrams are considered as a single line and as such are completely executed in a single step. In addition, breakpoints are cleared when target drives are switched off or reset.

Breakpoints are drawn in the left-hand margin of a DPL program. In the following example, a breakpoint is set on the line of code b% = a% * 100. The Background task will pause execution when it hits the breakpoint prior to executing the line of code.

Note:

Breakpoints are only visible while in on-line mode and are not stored with the DPL program. Breakpoints information is stored on the target drive and is uploaded by the DPL Editor when switching to on-line mode. Breakpoints are lost when the target drive is reset or powered off.

The following shows how the DPL editor looks when a breakpoint has been hit, i.e. the task has been paused prior to the line on which the breapoint is set. Note that only the task containing the breakpoint has been paused - any other tasks will continue to run.

To set or clear a breakpoint

Place the cursor at the line of code where you want to set or clear a breakpoint and do one of the following:

  • Press F2.

  • From the Run menu, choose Toggle Breakpoint.

  • On the main toolbar press

Alternatively,

  • Double-click the grey column on the lefthand side of the DPL view on the line where you want to set a breakpoint.

To remove all breakpoints set in a program

  • From the Run menu, choose Remove all Breakpoints.

To go to the next breakpoint

  • From the Run menu, choose Go to Next Breakpoint.

See Also

  • Controlling Program Execution

  • Debugging Applications

  • Tasks

________________________________________________________________________________