Danfoss MCO 305 Design Manual page 164

Programmable motion controller
Hide thumbs Also See for MCO 305:
Table of Contents

Advertisement

MCO 305 Design Guide
Constants
Constants can be used anywhere where parameters or values are expected. Constants are usually entered
in integral numbers, for example: value = 5000
Constants ...
The advantage of constants is that they don't need own storage capacity.
Variables
Variables
Variable identification
names
Special variables
Arrays
Writing programs with dialog requires user input or positions to be stored for a longer period of time, for
example, even after the VLT has been turned off. Usually such input consists of several values which are
best stored in fields or arrays.
Arrays are stored in the memory area of the user program and are defined globally, that means they are
independent of the current program. The user can determine how many arrays are defined and how large
the individual arrays should be. This determination is made with the DIM statement and is then fixed and
cannot be changed (except by erasing memory). Each program that is intended to use arrays must contain
a corresponding DIM statement which corresponds to the original definition. Otherwise an error will be
indicated.
DIM Statement
The DIM statement has to be the first statement in the program and must appear before the subroutine
area.
164
__ How to Program __
– are integer number values between –2 to +2 billion,
– are valid within the entire program (they are global),
– can be entered as a decimal, hexadecimal (0x + hexadecimal number),
octal (0 + octal number) or in ASCII (between apostrophes), for example:
value = 5000
= decimal 5000
value = 0x7F
= decimal 127
value = 0100
= decimal 64
value = 'A'
= decimal 65
– Hexadecimal and ASCII entries, in particular, avoid many conversions and make
the program more readable, for example:
key = 'A'
– can only be used for intermediate data storage of inquiry and calculation results.
– occur via the allocation of a value.
– must not be defined separately.
– are valid within the whole program, (i.e. they are global)
– contain integer number values between –2 to +2 billion.
– can be used within commands, instead of constant values.
– must be allocated a value (4 Byte) before use in a command.
– can be of any length
– can consist of letters, numerals and underlines
– must not contain any country-specifics, such as "ä", "é"
– must begin with a letter
– can be written in small or capital letters (no difference!)
– may not be identical to a command name
ERRNO = A system variable, which contains the relevant error number
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents