19 move signature into input location, 20 port set, 21 pulse port with duration – Campbell Scientific CR10X Measurement and Control System User Manual
Page 142

SECTION 9. INPUT/OUTPUT INSTRUCTIONS
9-10
PARAM.
DATA
NUMBER
TYPE
DESCRIPTION
01:
2
Option Code (see
above)
02:
4
Number to modulo
divide by
03:
4
Input location number
Input locations altered: 1 or 5
*** 19 MOVE SIGNATURE INTO INPUT ***
LOCATION
FUNCTION
This instruction stores the signature of the
operating system and running program into an
input location. The signature is a result of the
CR10X operating system, the size of memory,
and the entries in the
∗1, ∗2, ∗3, ∗4, ∗A, and ∗C
Modes. The signature for the same program
will be different in a CR10X and a CR10X-2M.
This signature is not the same as the signatures
given in the
∗B Mode. Recording the signature
allows detection of any program change or
ROM failure.
PARAM.
DATA
NUMBER
TYPE
DESCRIPTION
01:
4
Input location number
Input locations altered: 1
*** 20 PORT SET ***
FUNCTION
This instruction sets or configures specified
control ports (C1-C8). On power-up, ports
default to input configuration (i.e., they are not
driven high or low by the CR10X, and can be
used to read the status of an external signal
using Instruction 25). When a port is set high,
low, pulsed, or toggled by this instruction or a
program control command, the port is
automatically configured as an output.
NOTE: Voltages in excess of 5.5 volts
applied to a control port can cause the
CR10X to malfunction.
Ports can also be set using the
∗6 Mode or the J
and K telecommunications commands. However,
the ports MUST be configured as outputs before
these means of setting them will work. The
option to configure the port as an output is used
when a port must be configured as an output
without changing the state of the port.
Pulse duration, initiated by a program control
instruction, can be set for each control port
(Table 12-2). Instruction 20 does not pulse the
port, it only sets the duration. If Instruction 20 is
not used to set the duration, the pulse
command will result in a 10 ms pulse.
Instruction 20 has two 4 digit parameters. Each
digit represents one control port. The code (0-
9) entered as the digit determines what effect
command 20 has on the corresponding port.
TABLE 9-6. Port Configuration Option Codes
Code
Function
0
Set port low
1
Set port high
2
Toggle port
3
Pulse duration 1 ms
4
Pulse duration 10 ms
5
Pulse duration 100 ms
6
Pulse duration 1 s
7
Configure as output
8
Configure as input
9
Leave unchanged
Duration of pulse on subsequent pulse port
command in Program Control Instruction.
PARAM.
DATA
NUMBER
TYPE
DESCRIPTION
01:
4
C8, C7, C6, C5 option
codes
02:
4
C4, C3, C2, C1 option
codes
Input locations altered: 0
*** 21 PULSE PORT WITH DURATION ***
FUNCTION
Instruction 21 pulses a control port for a
specified amount of time in hundredths of
seconds (0.01 seconds).
The pulse works as a toggle; if the port is high
before the instruction is executed, it will pulse
low and vice versa. Any value less than 1,
including 0, gives a pulse of 10 milliseconds.
The maximum input value is limited to 65,000,
which gives a pulse length of 650 sec.
Parameter 1 is the port number to be pulsed.
Parameter 2 is the input location containing the
pulse length.