beautypg.com

Timer – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 381

background image

Section 9. Program Control Instructions

based on a record number. (Refer to the example program.) The variable in
which the number of seconds is stored should be formatted as Long. The
default size for strings is 16 characters. Ensure that your string variable is sized
large enough to accommodate all values returned by the function

Parameter

Enter

SECSSINCE1990 PARAMETERS

Date

Variable String

The Date parameter is a variable formatted as a string that holds the date
to be used in the function.

DataOption
Constant


Code
1

2

4

Sets what format that the data string uses
Date Format

"MM/DD/YYYY HH:mm:ss.uu"

"DD/MM/YYYY HH:mm:ss.uu

"CCYY-MM-DD HH:mm:ss.uu"

Where:

MM = Month; DD = Day
YY = Year CC = Century
HH = Hour mm = minutes
ss = Seconds uu = microseconds

Timer

Used to return the value of a timer.

Syntax
Variable

= Timer(

TimNo, Units, TimOpt

)

Remarks
Timer
is a function that returns the value of a timer. TimOpt is used to start,
stop, reset, or read without altering the state (running or stopped). Multiple
timers, each identified by a different number (TimNo), may be active at the
same time.

Parameter

& Data Type

Enter

TIMER PARAMETERS

TimNo

Constant,
Variable, or
Expression

An integer number for the timer (e.g., 0, 1, 2, . . .) Use low numbers to conserve memory;

using TimNo 100 will allocate space for 100 timers even if it is the only timer in the program.

Units

The units in which to return the timer value.

Constant

Alpha
Code

Numeric
Code


Units

USEC 0

Microseconds

MSEC 1

Milliseconds

SEC 2

Seconds

MIN 3

Minutes

TimOpt

Constant

The action on the timer. The timer function returns the value of the timer after the action is

performed

Code Result

0 Start

1 Stop

2

reset and start

3

stop and reset

4 read

only

9-51