Format
Examples
If
Condition
Then
[
Statements
]
Else
[
else statements
]
End If
If x == 1 Then
y = y * 5
z = z – 12
Else
y = y * 2
z=y-1
End If
If (x == 0 OR x == 1) AND y == 0 Then
z = 10
Else
z=5
End If
·
A
control
statement will branch the flow of the program expression. The [
TestExpression
] is required. A
‘Case’ statement will evaluate the ‘
TestExpression
’ and determine a numeric value. The program will then
test each ‘
case #
’ that matches and will perform all the statements within its block. If a ‘
Break
’ is reached,
the program flow will jump directly to the ‘End Select’ statement, bypassing all other Case conditions. not
one word.
Avoid using “Case” statements at this time, case logic is testing to be erratic
·
If no case #s match, the program branch will execute the ‘Case Else’ statement(s).
·
The ending statement ‘End Select’ is written as two words
Format
Examples
Select Case [TestExpression]
Case -
[statements-n] ...
[Case Else
[else statements] }
End Select
Select Case Status
Case 0
Return 1
Case 1
X=2
Break
Case 5
Case 7
Return 8
Case Else
Return 0
End Select
A l
ooping control
statement is used for looping a pre-determined number of times. For counting up, use the
keyword
To
. For counting down, use the keyword
Down
. Counter Necessary. The counter of looping control. It
can be integer o character.
Start
Necessary. The initial value of Counter.
End
Necessary. The end value of Counter.
Step
Options. The increment decrement step of Counter. It can be integer an can be omitted when value is 1.
Statements
·
Optional. Statement block between For and Next which will be executed.
1010-1001a, Rev 02
254
Sil ver Se ries In stal la tion & Op er a tion Man ual
Содержание Silver HMI504T
Страница 1: ...1010 1001A Rev 02...
Страница 20: ...1010 1001a Rev 02 16 Silver Series Installation Operation Manual OIT to PC Serial Port Pin Assignments...
Страница 32: ...1010 1001a Rev 02 28 Silver Series Installation Operation Manual...
Страница 128: ...1010 1001a Rev 01 124 Silver Series Installation Operation Manual...
Страница 156: ...1010 1001a Rev 02 152 Silver Series Installation Operation Manual...
Страница 166: ...1010 1001a Rev 02 162 Silver Series Installation Operation Manual...
Страница 216: ...1010 1001a Rev 01 212 Silver Series Installation Operation Manual...
Страница 251: ...1010 1001a Rev 02 Macros 247 Set Bit Objects Attributes Dialog Project Example of Add 2...
Страница 264: ...End Macro_Command 1010 1001a Rev 02 260 Silver Series Installation Operation Manual...
Страница 268: ...1010 1001a Rev 01 264 Silver Series Installation Operation Manual...