Download Title page

Transcript
Appendix B. RTUBASIC for RTU Local Logic
Month () As Integer
Returns the month of the current year (1 to 12).
Mday () As Integer
Returns the day of the current month (1 to 31).
Year () As Integer
Returns the current calendar year (1990 to 2058).
Wday () As Integer
Returns the day of the current week (1, Sunday to 7, Saturday).
SAMPLE PROGRAMS
Example 1:
'***************************************************************************
'* Simple local control only during communications failure.
*
'*
*
'* A single tank has two level sensor switches. There is one pump with
*
‘* on/off control.
*
'*
*
'* Normal operation uses ULTRAc to control the pump. When
*
‘* communication with ULTRAc fails, local control simply tries to
*
‘* keep the tank filled.
*
'***************************************************************************
Dim LevelTurnOn As Dio:0,1
'Digital input (module 0, i/o 1)
Dim LevelTurnOff As Dio:0,2
'Digital input (module 0, i/o 2)
Dim Pump As Rout:0,3
'Relay output (module 0, relay 3)
Startup
Pump = OFF
End Startup
Task
If (CommFail) Then
'***********************************
'* Turn on pump when tank not full *
'***********************************
If (LevelTurnOn) Then
Pump = ON
End If
'***********************************
'* Turn off pump when tank is full *
'***********************************
If (LevelTurnOff) Then
Pump = OFF
End If
End If
End Task
B-17