Emerson P/N 400361-00 Program Code Window, Program Multi-tasking, Program View, Typing Method

Models: P/N 400361-00

1 152
Download 152 pages 17.97 Kb
Page 88
Image 88
8.6 Program Code Window

PowerTools Pro into "Red Dot Help Mode". While in this mode, the mouse pointer should have a red and yellow question mark next to it. After going into Red Dot Help Mode, simply click on the line of the program that has a red dot next to it. Some description of the error should appear that helps indicate what the error is, or how to fix it. When finished checking Red Dot Errors, once again click the Red Dot Help icon on the Program Toolbar to exit Red Dot Help Mode.

A user program that has a red dot on an empty line often indicates that the second part of a two-part instruction is missing (i.e Do While with a missing Loop, If with a missing EndIf, etc.).

If a variable or parameter name is spelled incorrectly, the Red Dot Help message will indicate ""XXXX" Error - Couldn't find Variable named from Text" (where XXXX is the parameter name typed by the user). If this message is displayed, make sure that the parameter names on the specific line are spelled correctly.

8.6 Program Code Window

The Program Code Window is where the program instructions are inserted to create the user program.

Program instructions can be inserted into the Program Code Window using either of two methods. The two methods available are to drag & drop or to type the instructions into the window.

Drag & Drop Method

The most popular method for inserting program instructions is to drag the instruction from the instruction list and drop it into the program window. To drag& drop an instruction, position the mouse pointer over the instruction to be inserted. Press and hold the left mouse button. While holding the left button, place the mouse pointer on the line of the program that the instruction is to be inserted on. Release the left button to insert the instruction.

Typing Method

Once users become more familiar with the syntax of the SM-EZMotion programming language, they often prefer to type instructions in. To do this, simply click the left mouse button on the line of the program where instruction is to be inserted. Then simply type the instruction on that line, being sure to use proper syntax.

The user can enter program code using both methods interchangeably.

8.7 Program Multi-tasking

Many applications require the operation of a background task that operates outside of the main program loop, but must be consistently processed. For instance, a background task that performs calculations for values sent to an operator interface or a background task that monitors

parameters for fault detection.

The SM-EZMotion processor has the ability to execute multiple tasks. Because only one task can be processed at a time, a process called time slicing must be used. Time Slicing is simply splitting the total processing time between multiple tasks. The SM-EZMotion processor generates an interrupt that causes any task to stop, and the control loop to update. The timing of the interrupt is dependent on the Trajectory Update Rate parameter configured by the user on the Setup view (default update rate is 1 msec). Within the control loop update, the SM-EZMotion updates the motion trajectory, captured data, SM-EZMotion digital inputs and outputs, and other control parameters. Between each control loop update, the SM-EZMotion processes messages (i.e. Modbus, Errors, etc.) and then runs as much of the user program as possible until the next interrupt begins. Each update, a different task is processed. Therefore, the time it takes a given user program to complete depends how many tasks are being processed.

The task assignment is performed on the Program view. Figure 106 shows the Program view with the Task Number parameter. Use the up and down arrows next to the Task Number to change the task number. To create a new Task, simply click on the up arrow until PowerTools Pro asks if you wish to create a new Task.

Figure 106: Program View

The SM-EZMotion module allows up to four different tasks in a single application.

If the user wishes to operate two programs simultaneously, the two programs must be assigned to two different tasks. Multiple programs can be assigned to the same task if desired, but that means that the two programs can not be run at the same time. If a given program calls another program, then calling and the called programs must be on the same task. All programs default to task zero and therefore will not run simultaneously unless specified to do so.

74

www.emersonct.com

SM-EZMotion Module User Guide

Page 88
Image 88
Emerson P/N 400361-00 manual Program Code Window, Program Multi-tasking, Program View, Drag & Drop Method, Typing Method