beautypg.com

Campbell Scientific CR9000X Measurement and Control System User Manual

Page 254

background image

Section 7. Measurement Instructions

7-30

SDMIO16 (Dest, Status, Address, Command, ModePorts 16-13, ModePorts

12-9, ModePorts 8-5, ModePorts 4-1, Mult, Offset)

The SDMIO16 instruction is used to set up and measure an SDM-IO16 control
port expansion device. See the SDM-IO16 Manual for more complete details.

Syntax
SDMIO16
(Dest, Status,Address,Command, ModePorts 16-13,

ModePorts 12-9, ModePorts 8-5, ModePorts 4-1, Mult, Offset )

Remarks
The ports on the SDM-IO16 can be configured for either input or output.
When configured as input, the SDM-IO16 can measure the logical state of
each port, count pulses, and measure the frequency of and determine the duty
cycle of applied signals. The module can also be programmed to generate an
interrupt signal to the datalogger when one or more input signals change state.
When configured as an output, each port can be set to 0 or 5 V by the
datalogger. In addition to being able to drive normal logic level inputs, when
an output is set high a ‘boost’ circuit allows it to source a current of up to 100
mA, allowing direct control of low voltage valves, relays, etc.

This instruction must NOT be placed inside a conditional
statement or SubScan.

Parameter

& Data Type

Enter

SDMIO16 PARAMETERS

Dest

Variable or Array

The Dest parameter is a variable or variable array in which to store the results of the

measurement (Command codes 1 - 69, 91, 92, 99) or the Source value for the Command

Codes (70 - 85, 93 - 98). The variable array for this parameter must be dimensioned to

accommodate the number of values returned (or sent) by the instruction.

Status

Variable

The Status parameter is used to hold the result of the command issued by the instruction. If
the command is successful a 0 is returned; otherwise, the value is incremented by 1 with
each failure.

Address

Constant

The SDM address for the SDM-SIO4 (0-14)

Command

Constant

The Command parameter is used to set up the SDM-IO16. See the SDMIO16 manual or

the CRBasic editor help for more details.

Mode

The SIO4 port the instruction applies to.

Constant

Cod

e

Port Code

Port

1

Output Logic Low

6

Undefined

2

Output Logic High

7

Undefined

3

Input Switch Closure, 3.17 mS debounce

filter

8 Undefined

4

Input Digital interrupt enabled, no debounce

filter

9 No

change

5

Input Switch Closure interrupt enabled

Mult, Offset

Constant,
Variable, Array, or
Expression

A multiplier and offset by which to scale the results. A multiplier of one and an offset of 0

are necessary to store the values as received.

NOTE