beautypg.com

Micromod Micro-DCI: 53MC5000 Training Manual User Manual

Page 163

background image

Training Manual

F-TRAN Programming Lab

10- 17

DVGEN

\ Deviation Generator Subroutine \

PID

\ PID Control Calculation Subroutine \

AMSW

\ Auto-Manual Selector Subroutine \

ANO0 = OUT

\ Copy Control Output to the hardware

Output \

DISPLAYS

\ Execute the Display Handler

Subroutine \

E \ End the program \

#

Look at the above program list: There are several new concepts in this program:

• First of all there is the comment line at the beginning and comment lines for

several of the program lines. Any ASCII text between backslashes is considered a
comment and is ignored by the compiler. In the above figure, the program code is
given

bold text where as the comments are in regular text. This only

done to identify the program from the comments. This is not normally done in the
program.

• It is a good programming practice to include the comments so that you can identify

what each line of code is for. It makes the program more interpretable.

• The second new concept is the #define command. The #define command allows

you to assign an acronym (name) to a particular database location. This will help
to make your programs more readable. The #define command must be written in
lower case characters. The names can be any length but the first eight characters
must be unique. The first character must also not be a numeric value.

• Separate the #define from the Name with at least a space. Also separate the Name

from the database location with a space.

• In the above program, there are 2 sections: one section with the #define statements

for assigning names for the data-points and the second section that contains the
program statements.

2.

Save and Compile the program – follow the same procedure as in Part I to save and
compile the program. Assign a Function Index number (FIX) of 2 for this program.