Statements, Conditions & Expressions - Maple Systems Silver Plus Series Installation And Operation Manual

Hide thumbs Also See for Silver Plus Series:
Table of Contents

Advertisement

250
Statements, Conditions & Expressions
An expression combines constants, variables, arrays, functions, and operators under certain rules. Expressions can
be logical or mathematical equations.
Below are listed some of the different styles of statements:
• A declaration (definition) statement is constructed like the following:
Format
type name
type name
[constant]
• An assignment statement will transfer (assign) an expression to a variable. The form is:
Format
variable = expression
logic or conditional statement processes a logic expression and branches depending on the
result. This assigns the result of the expression to a variable. The ending statement 'End If' is
written as two words, not one word. Note that there is a difference between the conditional equality
noted by two equal signs '= =' (read as: 'is equal to') and the assignment equality noted by only one
equal sign '='.
1010-1007, Rev 05
SetData(Section,
"Local
for
Address =
0
to
29999
// increment the address
SetData(Address,
"Local
// write a
0
to
the current address
SetData(Initial,
"Local
next
address
// do the second half
Section =
2
SetData(Section,
"Local
// adjust actual address by using LW9000
for
Address =
0
to
29999
// increment address
SetData(Address,
"Local
// write a
0
to
the current address
SetData(Initial,
"Local
next
address
// turn off macro trigger, LB2
SetData(Initial,
"Local
end macro_command
Examples
short
MyVar
Short
MyVars[10]
Examples
MyVar = 10
MyVar = x + y
Sil ver Plus Se ries In stal la tion & Op er a tion Man ual
HMI", LW_BIN, 2, 1)
HMI", LW_BIN, 9000, 1)
HMI", RWI_BIN, 0, 1)
HMI", LW_BIN, 2, 1)
HMI", LW_BIN, 9000, 1)
HMI", RWI_BIN, 30000, 1)
HMI", LB_BIN, 2, 1)
Explanation
This defines the name of the variable
register and its type
This defines an array name and the
[constant] is the number of 'type elements'
in the array
Explanation
This assigns the result of the expression to
a variable

Advertisement

Table of Contents
loading

Table of Contents