beautypg.com

Syntax checking, Saving your program, Running your program – Sensaphone SCADA 3000 Users manual User Manual

Page 236

background image

22-4

SCADA 3000 User’s Manual

A distributed control program is running which will turn on the pump if the level falls below

10 feet. The pump will be turned off when the level reaches 35 feet. A listing is shown below:

'''''''''''''''''''''''

' Begin User Program

'''''''''''''''''''''''

' In the following program, DataPointValue1 is the tanklevel and

' DataPointValue2 is the Pump On/Off status. The program will turn on

' the pump if the level drops below 10 feet. The pump will stay on

' until the level is above 35 feet. A static label is used to display

' the On/Off status of the pump on the Realtime screen.
dim tanklevel,pumpcontrol 'Declare variables

tanklevel=DataPointValue1.Value 'Assign datapoint component value from -

'realtime screen to tanklevel variable

if tanklevel<10 then 'Perform logic

pumpcontrol=1

' .

end if

' .

if tanklevel>35 then ' .

pumpcontrol=0

' .

end if

DataPointValue2.Value=pumpcontrol

'Assign pumpcontrol value to datapoint -

'component on realtime screen

if DataPointValue2.Value=0 then

'Check if pump is on or off and print -

Label5.Caption="Off"

'status on realtime screen

else Label5.Caption="On"

end if

'''''''''''''''''''''''

' End User Program

'''''''''''''''''''''''

Syntax Checking

Once you have finished writing your Distributed Control program you must check it for syntax

errors. Simply click the SyntaxCheck button. The editor will provide a message to indicate if

there were any errors detected, along with the location of the error.

Saving your Program

When you have finished editing your program be sure to save it by clicking the Save button.

Enter a unique name for your program and click OK.

Note: Do not use template.vbs as a filename as this will overwrite the original tem-

plate program.

Click Close to exit the editor.

Running your Program

After the program passes the Syntax Check you can try to run it. Remember that the program

will actually read and control I/O, so it’s highly recommended that you test the program in a

scenario where mistakes in logic won’t damage equipment or place people in danger. To run

your program, the Real-time screen must first be running. The reason for this is that the I/O

values used in the program are read from and written to the Real-time screen. The Real-time

screen handles all data communications between the SCADA units and the Distributed Control

program. Once the Real-time screen is running, click the Run button on the Distributed

Control management screen. A message should appear that first says Starting..., then Running.

To stop the program click Stop.