Programming The Cr800, Cr850, Cr1000, Cr3000, And Cr5000; Sdmio16 Instruction - Campbell SDM-IO16 User Manual

16 channel input/output expansion module
Table of Contents

Advertisement

6.2 Programming the CR800, CR850, CR1000, CR1000X, CR3000,
and CR5000

6.2.1 SDMIO16 Instruction

The SDMIO16 instruction in CRBasic supports all of the functions of the SDM-
IO16. The SDMIO16 instruction is described below; refer to Section 7 for an
example.
Syntax
SDMIO16 ( Dest, Status, Address, Command, Mode Ports 16-13, Mode Ports
12-9, Mode Ports 8-5, Mode Ports 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.
Dest
Status
SDMAddress
Command
Mode
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.
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.
The SDMAddress parameter defines the address of the SDM-
IO16 with which to communicate. Valid SDM addresses are 0
through 14. Address 15 is reserved for the SDMTrigger
instruction. If the Reps parameter is greater than 1, the datalogger
will increment the SDM address for each subsequent SDM-IO16
that it communicates with.
The Command parameter is used to set up the SDM-IO16. Please
read Section 6.4 for detailed description of the controlling
command codes.
Each Mode parameter is used to configure a bank of four ports
when a Command code 86 through 90 is used (if any other
Command Code is used, enter 0 for the Mode parameters). Mode
is entered as a four digit parameter, where each parameter
indicates the setting for a port. Ports are represented from the
highest port number to the lowest, from left to right (e.g., 16 15 14
13; 12 11 10 9; 8 7 6 5; 4 3 2 1). There is a Mode for Ports 16 -
13, 12 - 9, 8 - 5, and 4 - 1. The valid codes are:
User Guide
9

Advertisement

Table of Contents
loading

Table of Contents