Download Title page

Transcript
Appendix B. RTUBASIC for RTU Local Logic
Here are some example assignment statements:
Declaration
Assignment Statement
Dim Pump1Temp As Cin : 1
int _var = Pump1Temp
Dim Pump2Temp As Dio : 0, 2
Dim Relay1 As Rout : 5, 1
int_var = Pump2Temp
int_var = Relay1
Relay1 = ON
Dim Pump2FlowSet As Aout : 3, 1
real_var = Pump2FlowSet
Pump2FlowSet = real_var
Dim Acc_Total As AccumTotal : 1
real_var = Acc_Total
Dim Acc_Period As AccumPeriod : 2
int_var = Acc_Period
If Statements
If statements have the following forms:
If expression Then
optional_statements
End If
If expression Then
optional_statements
Else
optional_statements
End If
If expression Then
optional_statements
ElseIf expression
optional_statements
End If
If expression Then
optional_statements
ElseIf expression Then
optional_statements
Else
optional_statements
End If
If the expression following the If evaluates to TRUE, any statements following the Then
command will be executed. Then program execution will proceed with the next command
following the End If.
If the expression following the If evaluates to FALSE the expression following the ElseIf
will be evaluated. If this expression evaluates to TRUE any statements following the Then
associated with the ElseIf command will be executed. Then program execution will proceed
with the next command following the End If.
B-10