Structure, Keywords, Definitions – Sensaphone SCADA 3000 Users manual User Manual

Page 238: Dim statement, Structure -6 keywords -6 definitions -6, Dim statement -6

Advertising
background image

22-6

SCADA 3000 User’s Manual

The Distributed Control program comprises the following elements:

STRUCTURE: To write a valid Visual Basic program, regardless of length, you

must follow its simple structural elements.

KEYWORDS: These are short words or symbols that define variables or execute

specific actions within a Visual Basic program. They include operators, assign-

ment, comparators, and comments.

PREDEFINED VARIABLES: These are variables that have specific predefined

values that are automatically updated and cannot be changed by the user.

FUNCTIONS: These are word commands that perform a predefined function

within a Visual Basic program.

ARRAYS: This is a more advanced programming type that significantly shortens

and simplifies long programs.

ERROR HANDLING: When a program is compiled, it is scanned for language

related errors. An error message, including the type of error, is displayed.

EDITING TOOL: The SCADA 3000 Realtime Editor provides a Distributed

Control program editing utility that allows you to write, compile, and run

Distributed Control programs. This chapter provides basic instruction in the

Visual Basic language and gives all the commands that are valid for use with

SCADA 3000. Sample programs are included.

Structure

Listed below is information that will help demonstrate the Visual Basic language structure as

it is used in the SCADA 3000. Refer to the following pages for explanation of the keywords,

functions, and commands used within the sample programs.
All programs must start with the predefined template (template.vbs). Your specific program

must be inserted between the comments labeled Begin User Program and End User Program.

' Begin User Program

' End User Program

*Note: All SCADA 3000 Distributed Control Programs must include some pre-

program and post-program instructions. These have been pre-written for you

and are included in the distributed control template program (template.vbs)

located in the SCADA 3000>Samples>Scripts folder.

Keywords

The following is a partial list of valid components of the Visual Basic language that can be used

within the SCADA 3000 Distributed Control program.

Dim
If . . . Then . . . Else
For . . . Next
Do . . . Loop

Definitions

Dim Statement

Declares variables and allocates storage space.

Advertising