Campbell Scientific CR9000X Measurement and Control System User Manual

Page 356

Advertising
background image

Section 9. Program Control Instructions

be evaluated as false, and than true again, before the Scan will be triggered
once more.

It should be noted that the CR9000X time stamp stored in the Data Tables is
clocked by the execution of the Scan. Thus, if the scan rate is set at 2 seconds,
but the trigger is activated every 4 seconds, the time stamp will still increment
only 2 seconds every time the trigger activates the scan (increment value will
be off by a factor of 2). Thus, if time stamps are to be utilized in the Data
Tables, to avoid misleading timestamps, it is recommended that the trigger
application be repeated at the same rate as the main scan rate of the CR9000X
program.

There are 16 ports on the CR9071E. The status of these ports can be
represented by a binary number with a high signal (+5 V) signifying 1, and a
low signal (0 V) signifying 0. Mask and Word are binary numbers representing
the 16 digital I/O channels. Mask is used to determine which digital inputs to
read. Word sets the digital input pattern, for the Masked ports, that must be
matched in order to set the trigger.

CRBasic allows the entry of numbers in binary format by preceding the
number with "&B". For example, if the mask is entered as &B110 (leading
zeros can be omitted in binary format just as in decimal) and the Word is
entered as &B101, then when port 2 is low and port 3 is high, the trigger
condition will be true. Even though the Word has a 1 in the port 1 location, the
mask indicates that only ports 3 and 2 need to be matched in order to trigger
the scan.

Parameter
& Data Type

Enter

WAITDIGTRIG PARAMETERS

PSlot

Constant

The number of the slot in the CR9000X card frame that holds the CR9071E Module.

Mask

Constant

The Mask parameter is used to select which of the ports will be read when determining
whether or not to trigger the measurement. It is a binary representation of the ports. CRBasic
allows the entry of numbers in binary format by preceding the number with "&B" (ex:
&B001). If a port position is set to 1, the datalogger monitors the status of the port. If a port
position is set to 0, the datalogger ignores the status of the port.

Word

Constant or
Variable

The Word parameter is the digital input pattern to be matched when determining whether or
not to trigger the measurement. It is a binary representation of the digital I/O channels. Only
the channels set by the mask parameter must match the input values set by the word. The
other channels' Word values will be ignored.

Examples:

Scan (1, msec, 0, 0)

WAITDIGTRIG

(6,&B0000000000000100, &B0000000000000111)

'read only port 3, wait until 3 is high. mask and word entered as binary numbers.
' enter measurements and processing instructions
Next Scan

WAITDIGTRIG

(6,4,4)

'same as above: read only port 3, wait until 3 is high.
'mask and word entered as decimal numbers.
measurements and processing instructions
Next Scan

9-26

Advertising