Section 9. datalogger control, 1 program structure/control, Beginprog, endprog, exit – Campbell Scientific CR9000X Measurement and Control System User Manual
Page 331: Call

Section 9. Datalogger Control
9.1 Program Structure/Control
BeginProg, EndProg, Exit
BeginProg and EndProg are used to mark the beginning and end of a
program. Exit is used to exit the program
Syntax
BeginProg
...
[Conditional]
Exit
..
EndProg
BeginProg marks the end of Variable, DataTable, Subroutine, and user
defined Function declarations and the beginning of the main program.
BeginProg Example
This program segment uses BeginProg and EndProg to mark the beginning and
end of a program.
BeginProg
...
If Flag(1) then Exit...
EndProg
Call
The Call statement is used to transfer program control from the main program
to a subroutine.
Syntax
Call
SubName(List of Variables)
or
SubName(List of Variables) or
SubName
Remarks
Use of the Call keyword when calling a subroutine is optional.
The Call statement has these parts:
Part Description
Call
Call is an optional keyword used to transfer program
control to a subroutine.
SubName
The Name parameter is the name of the subroutine to call.
List of Variables
Optional. Only needed when it is desired to pass variables
or values to the subroutine. The list may contain variables,
constants, or expressions that evaluate to a constant that
should be passed into the variables declared in the
subroutine. Values of variables passed can be altered by
the subroutine. If the subroutine changes the value of the
matching subroutine declared variable, it changes the
9-1