Call, Calltable – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 208

Advertising
background image

Section 9. Program Control Instructions

9-2

Scan (1,Sec,3,0)
RealTime (TIME)
PulseCount (WINDSP,1,1 ,1,1,1.0,0)
PulseCount (RAIN,1,2,2,0,1.0,0)
CallTable METDATA
NextScan

EndProg

Call

The Call statement is used to transfer program control from the main program
to a subroutine.

Syntax
Call Name(list of variables)

Remarks
Use of the Call keyword when calling a subroutine is optional.

The Call statement has these parts:

Call

Call is an optional keyword used to transfer
program control to a subroutine.

Name

The Name parameter is the name of the
subroutine to call.

List of Variables or Constants The list may contain variables, constants, or

expressions that evaluate to a constant (i.e., do
not contain a variable) 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 subroutine declared variable, it
changes the value in the variable that was
passed in. If a constant is passed to one of the
subroutine declared “ variables” , that
“ variable” becomes a constant and its value
cannot be changed by the subroutine.

Call Statement Example
See Sub description in Section 5.

CallTable

Used to call a data table.

Syntax
CallTable
Name

Remarks
CallTable is used in the main program to call a DataTable. DataTables are
listed in the declaration section of the program prior to BeginProg. When the

Advertising