United Kingdom: One Omega Drive, River Bend Technology Centre
ISO 9002 CertifiedNorthbank, Irlam, Manchester
M44 5BD United Kingdom
Tel: +44 (0)161 777 6611FAX: +44 (0)161 777 6622
Toll Free in United Kingdom: 0800-488-488
e-mail: sales@omega.co.uk
OMEGAnet®Online Service Internet e-mail
omega.com info@omega.com
It is the policy of OMEGA Engineering, Inc. to comply with all worldwide safety and EMC/EMI
regulations that apply. OMEGA is constantly pursuing certification of its products to the European New
Approach Directives. OMEGA will add the CE mark to every appropriate device upon certification.
The information contained in this document is believed to be correct, but OMEGA accepts no liability for any
errors it contains, and reserves the right to alter specifications without notice.
WARNING: These products are not designed for use in, and should not be used for, human applications.
D3000/4000 SERIES USERS MANUAL
REVISED: 6/1/94
Omega Engineering
One Omega Drive
P O Box 4047
Stamford, CT 06907
Phone: 1-800-DAS-IEEE
Fax: 203-359-7990
e-mail: das@omega.com
www.omega.com
The information in this publication has been carefully checked and is
believed to be accurate; however, no responsibility is assumed for possible
inaccuracies or omissions. Applications information in this manual is intended as suggestions for possible use of the products and not as explicit
performance in a specific application. Specifications are subject to change
without notice.
D3000/4000 modules are not intrinsically safe devices and should not be
used in an explosive environment unless enclosed in approved explosionproof housings.
Slope Control 10-1
Input Data Scaling 10-4
Watchdog Timer 10-6
Analog Readback 10-7
Continuous Input 10-9
Appendix A(ASCII TABLE )
Appendix BD3000/4000 Data Sheet
Chapter 1
Getting Started
Introduction
The D3000/4000 series are completely self-contained computer-to-analog
output interfaces. They are designed to be mounted remotely from a host
computer and communicate with standard RS-232 and RS-485 serial ports.
Simple ASCII commands are used to control a 12-bit DAC (Digital-to-Analog
Converter) which is scaled to provide commonly used current and voltage
ranges. An on-board microprocessor is used to provide the communications
interface and many intelligent analog output functions.
D3000 versions provide a basic computer-to-analog output interface for
cost-sensitive applications where some of the intelligent enhancements are
not required. D3000 units feature step-function outputs, fixed input scaling,
and no analog readback.
D4000 versions perform all of the D3000 functions plus many additional
intelligent enhancements:
Controlled output slew rates
True analog readback
Programmable input data scaling
Programmable starting value
Watchdog timer
This manual has been written to be a guide for both the D3000 and D4000
units. Basic operating characteristics of both models are identical and
unless otherwise noted, the information in this manual applies to both
versions. Commands and functions exclusive to the D4000 are so noted in
the text.
Terminal Designations
All D3000 and D4000 units have similar terminal designations, although
there are slight variations between current/voltage and RS-232/RS-485
models.
Pin 1+I OUT or +V OUT
Pin 2-I OUT or -V OUT
Pins 1 and 2 are the connections to the analog output signal. On voltage
models, the input data is scaled so that the voltage at +V OUT is positive with
respect to -V OUT. Voltage outputs can source or sink current.
On current output models, the output current flows from the +I OUT terminal
to the -I OUT terminal, so for a typical resistive load, the +I OUT terminal will
be at a more positive voltage level than the -I OUT terminal. Current outputs
can only source current.
Getting Started 1-2
Pins 1 and 2 are electrically isolated from the other pins.
Pin 3DI2
Pin 4DI1/UP*
Pin 5DI0/DN*
Pins 3-5 are digital input pins. They may be used as general-purpose inputs
or they may be set-up to provide special functions that control the analog
output. The standard factory set-up configures the UP* and DN* pins to
provide manual up and down control of the analog output. The * designation
indicates that the labels are negative true. A full functional description of
these pins may be found in Chapter 6.
Pin 6DEFAULT*
Grounding this pin places the module in Default Mode, described in detail
below.
Pin 7TRANSMIT or DATA
Pin 8RECEIVE or DATA*
Pins 7 and 8 are connections to the serial communications lines connecting
the module to the host computer or terminal.
On RS-232 models, the TRANSMIT pin is the serial output connection from
the module. The RECEIVE pin is the serial input into the module.
On RS-485 versions, DATA and DATA* are connections to the balanced
RS-485 communications lines. DATA and DATA* are sometimes labeled
DATA+ and DATA- respectively.
Pin 9V+
Pin 10GND
Pins 9 and 10 are the power connections. The D3000/4000 modules operate
on 10-30V unregulated power.
Default Mode
All D3000/4000 modules contain an EEPROM (Electrically Erasable Programmable Read Only Memory) to store setup information and calibration
constants. The EEPROM replaces the usual array of switches and pots
necessary to specify baud rate, address, parity, etc. The memory is
nonvolatile which means that the information is retained even if power is
removed. No batteries are used so it is never necessary to open the module
case.
The EEPROM provides tremendous system flexibility since all of the
module’s setup parameters may be configured remotely through the communications port without having to physically change switch and pot
Getting Started 1-3
settings. However, there is one minor drawback in using EEPROM instead
of switches; there is no visual indication of the setup information in the
module. It is impossible to tell just by looking at the module what the baud
rate, address, parity and other settings are. It is difficult to establish
communications with a module whose address and baud rate are unknown.
To overcome this, each module has an input pin labeled DEFAULT*. By
connecting this pin to Ground, the module is put in a known communications
setup called Default Mode.
The Default Mode setup is: 300 baud, one start bit, eight data bits, one
stop bit, no parity, any address is recognized.
Grounding the DEFAULT* pin does not change any of the setups stored in
EEPROM. The setup may be read back with the Read Setup (RS) command
to determine all of the setups stored in the module. In Default Mode, all
commands are available.
A module in Default Mode will respond to any address. A dummy address
must be included in every command for proper responses. The ASCII value
of the module address may be read back with the RS command. An easy
way to determine the address character is to deliberately generate an error
message. The error message outputs the module’s address directly after
the “?” prompt.
Setup information in a module may be changed at will with the SetUp (SU)
command. Baud rate and parity setups may be changed without affecting
the Default values of 300 baud and no parity. When the DEFAULT* pin is
released, the module automatically performs a program reset and configures itself to the baud rate and parity stored in the setup information.
The Default Mode is intended to be used with a single module connected to
a terminal or computer for the purpose of identifying and modifying setup
values. In most cases, a module in Default Mode may not be used in a string
with other modules.
RS-232 & RS-485 Quick Hook-Up
Software is not required to begin using your D3000/4000 module. We
recommend that you begin to get familiar with the module by setting it up on
the bench. Start by using a dumb terminal or a computer that acts like a dumb
terminal. Make the connections shown in the quick hook-up drawings,
Figures 1.1 or 1.2. Put the module in the Default Mode by grounding the
DEFAULT* terminal. Initialize the terminal communications package on
your computer to put it into the “terminal” mode. Since this step varies from
computer to computer, refer to your computer manual for instructions.
Connect a suitable voltmeter or ammeter to the output connections of the
module to monitor the output signal. If an ammeter is not available to
Getting Started 1-4
measure the signals from current-output modules, a sense resistor and a
voltmeter may be used as shown in Fig. 1.1. Turn power on to the module.
Momentarily ground the UP* pin on the connector. The output signal should
increase in value as the UP* pin is held low. Now release the UP* pin and
ground the DN* (down) pin. The output signal should decrease in value as
the pin is held low.
This demonstrates the “Manual Mode” method of controlling the output. It is
also a quick check to see if the module is connected and working properly.
Use your terminal to type the command $1RD and terminate the command
with a carriage return. The module will respond with an * followed by the
output data reading. The data includes sign, seven digits and a decimal
point. For example, a typical reading might be *+00015.00. This is an output
status reading and it should closely correspond with the reading on your
meter.
Now type the command:
$1AO+00010.00 and terminate with a carriage return.
The module should respond with ‘*’ and the output will change to 10 millivolts
(or milliamps). This demonstrates the Analog Output (AO) command, which
is the primary method of controlling the analog output.
If you have a voltage output module,try these commands:
$1AO+00000.00 (terminate with a carriage return)
$1AO+00100.00
$1AO+01000.00
$1AO+01234.00
For current output models these commands are more appropriate:
$1AO+00004.00
$1AO+00020.00
$1AO+00010.00
Remember to terminate each command with a carriage return.
Once you have a response from the module you can turn to the Chapter 4
and get familiar with the command set.
All modules are shipped from the factory with a setup that includes a channel
address of 1, 300 baud rate, no linefeeds, no parity, limits off, no echo and
two-character delay. Refer to the Chapter 5 to configure the module to your
application.
Getting Started 1-5
Figure 1.1 D3000/4000 RS-232C Quick Hook-up.
RS-485 Quick Hook-up to a RS-232 port
An RS-485 module may be easily interfaced to an RS-232C terminal for
evaluation purposes. This connection is only suitable for benchtop operation
and should never be used for a permanent installation. Figure 1.3 shows the
hook-up. This connection will work provided the RS-232C transmit output is
current limited to less than 50mA and the RS-232C receive threshold is
greater than 0V. All terminals that use 1488 and 1489 style interface IC’s will
satisfy this requirement. With this connection, characters generated by the
terminal will be echoed back. To avoid double characters, the local echo on
the terminal should be turned off.
If the current limiting capability of the RS-232C output is uncertain, insert a
100Ω to 1kΩ resistor in series with the RS-232C output.
Getting Started 1-6
Figure 1.2 D3000/4000 RS-485 Quick Hook-up.
Getting Started 1-7
Note: If using a DB-9 connector ground is tied to pin 5 only.
Figure 1.3 D3000/4000 RS-485 Quick Hook-up with RS-232C Port.
Getting Started 1-8
Chapter 2
Functional Description
The D3000/4000 Computer to Analog Output interfaces provide accurate
analog process control signals in response to simple digital commands from
a host computer. The D3000/4000 units are completely self-contained and
are designed to be operated remotely from the host. Digital commands are
transmitted to the D3000/4000 units using standard RS-232 or RS-485
communications links. Commands and responses are in the form of simple
English ASCII character strings for ease of use. The ASCII protocol allows
the units to be interfaced with dumb terminals and modems as well as
intelligent controllers and computers.
Figure 2.1 shows a functional block diagram of the D3000/4000. The key
block is the 12-bit Digital to Analog Converter (DAC). The DAC converts
digital data derived from host commands into the desired analog output. All
of the other components provide a supporting role for proper operation of the
DAC.
An 8-bit CMOS microprocessor is used to provide an intelligent interface
between the host and the DAC. The microprocessor receives commands
and data from the host computer through a serial communications port.
Specialized communications components are used to interface the microprocessor to either RS-232 or RS-485 communications standards. Commands received by the microprocessor are thoroughly checked for syntax
and data errors. Valid commands are then processed to complete the
desired function. A wide variety of commands are available to control the
DAC, read status information, and to configure the module to fit the user’s
requirements. Responses to the host commands are then produced by the
microprocessor and transmitted back to the host over the RS-232/RS-485
serial link.
An Electrically Erasable Programmable Read-Only Memory (EEPROM) is
used to retain important data even if the module is powered down. The
EEPROM contains setup information such as the address, baud rate, and
parity as well as calibration data.
In response to host commands, the microprocessor produces the appropriate digital data necessary to control the DAC. Digital data is transmitted to
the DAC through opto-isolators which provide electrical isolation. The DAC
produces a precise analog current that is directly proportional to the
magnitude of the digital data. The DAC output current is then processed and
amplified by signal conditioning circuits to produce the desired output
voltage or current. Output protection circuits are included to protect the
module from potentially damaging output faults.
Functional Description 2-2
D4000 models also feature a simple Analog to Digital Converter (ADC)
which is used to monitor the output signal. The ADC input is tied directly to
the analog output and converts the signal level to digital data. The digital
data is optically isolated and may be read by the microprocessor. This
circuitry allows the D4000 user to directly monitor the output signal and
ensure its integrity.
The last major block in the diagram is the power supply. The power supply
converts the raw 10 to 30 volts supplied by the user into regulated voltages
used in the module. It produces +5V necessary to operate the microprocessor and EEPROM. On RS-232 units, the power supply produces ±10V
necessary for the RS-232 communications standard. It also produces ±15
volts to power the DAC and associated output circuitry.
The power supplied to the DAC and output circuitry is transformer isolated
from the input power and communications connections. The transformer
along with the opto-isolators provide an isolation barrier between the output
section and the rest of the circuitry. The isolation barrier is extremely helpful
in breaking ground loops and isolating troublesome common-mode voltages that are often found in large systems. The isolation barrier also
provides damage protection for the module and the host in cases where the
output lines may accidently contact AC power lines.
The combination of an accurate high-resolution DAC and a dedicated
microprocessor produces a very powerful system for the generation of
process control signals. The power of the microprocessor is used to provide
software addressing for multidrop capability, data formatting in engineering
units, limit checking, digital calibration, and a host of other features not
possible with unintelligent analog output systems.
During normal operation, the microprocessor constantly updates the DAC
data at a rate of 1000 times per second, even if the output is stable. The
D4000 fully utilizes this characteristic to provide controlled output slew rates.
Linear output ramp signals are created by incrementally stepping the DAC
every millisecond with values precisely calculated by the microprocessor.
The small output steps created at millisecond intervals are used to approximate ramp outputs. Slope rates are programmable and may be changed at
any time with simple commands. Linear ramps may be initialized with a
single command from the host computer. No further intervention or monitoring is required from the host; the D4000 does the rest.
Functional Description 2-3
Functional Description 2-4
Chapter 3
Communications
Introduction
The D3000/4000 modules have been carefully designed to be easy to
interface to all popular computers and terminals. All communications to and
from the modules are performed with printable ASCII characters. This allows
the information to be processed with string functions common to most highlevel languages such as BASIC. For computers that support RS-232C, no
special machine language software drivers are necessary for operation. The
modules can be connected to auto-answer modems for long-distance
operation without the need for a supervisory computer. The ASCII format
makes system debugging easy with a dumb terminal.
This system allows multiple modules to be connected to a communications
port with a single 4-wire cable. Up to 32 RS-485 modules may be strung
together on one cable; 124 with repeaters. A practical limit for RS-232C units
is about ten, although a string of 124 units is possible. The modules
communicate with the host on a polling system; that is, each module
responds to its own unique address and must be interrogated by the host.
A module can never initiate a communications sequence. A simple command/response protocol must be strictly observed to avoid communications
collisions and data errors.
Communications to the D3000/4000 modules are performed with two or
three-character ASCII command codes such as RD to Read Data from the
analog output. A complete description of all commands is given in the
Chapter 4. A typical command/response sequence would look like this:
Command:$1RD
Response:*+00123.00
A command/response sequence is not complete until a valid response is
received. The host may not initiate a new command until the response from
a previous command is complete. Failure to observe this rule will result in
communications collisions. A valid response can be in one of three forms:
1) a normal response indicated by a ‘ * ‘ prompt
2) an error message indicated by a ‘ ? ‘ prompt
3) a communications time-out error
When a module receives a valid command, it must interpret the command,
perform the desired function, and then communicate the response back to
the host. Each command has an associated delay time in which the module
is busy calculating the response. If the host does not receive a response in
an appropriate amount of time specified in Table 3.1, a communications
Communications 3-2
time-out error has occurred. After the communications time-out it is assumed that no response data is forthcoming. This error usually results when
an improper command prompt or address is transmitted. The table below
lists the timeout specification for each command:
MnemonicTimeout
DI, HX, WE3mS
ID130mS
All other commands35 mS
Table 3.1 Response Timeout Specifications.
The timeout specification is the turn-around time from the receipt of a
command to when the module starts to transmit a response.
Data Format
All modules communicate in standard NRZ asynchronous data format. This format provides one start bit, seven data bits, one parity bit
and one stop bit for each character.
RS-232C
RS-232C is the most widely used communications standard for information
transfer between computing equipment. RS-232C versions of the D3000/
4000 will interface to virtually all popular computers without any additional
hardware. Although the RS-232C standard is designed to connect a single
piece of equipment to a computer, the D3000/4000 system allows for
several modules to be connected in a daisy-chain network structure.The
advantages offered by the RS-232C standard are:
1) widely used by all computing equipment
2) no additional interface hardware in most cases
3) separate transmit and receive lines ease debugging
4) compatible with dumb terminals
However, RS-232C suffers from several disadvantages:
1) low noise immunity
2) short usable distance - 50 to 200 feet
3) maximum baud rate - 19200
4) greater communications delay in multiple-module systems
5) less reliable–daisy-chain connection
6) wiring is slightly more complex than RS-485
7) host software must handle echo characters
Communications 3-3
Single Module Connection
Figure 1.1 shows the connections necessary to attach one module to a host.
Use the Default Mode to enter the desired address, baud rate, and other
setups (see Setups). The use of echo is not necessary when using a single
module on the communications line.
Multi-party Connection
RS-232C is not designed to be used in a multiparty system; however the
D3000/4000 modules can be daisy-chained to allow many modules to be
connected to a single communications port. The wiring necessary to create
the daisy-chain is shown in Figure 3.1. Notice that starting with the host,
each TRANSMIT output is wired to the RECEIVE input of the next module
in the daisy chain. This wiring sequence must be followed until the output of
the last module in the chain is wired to the Receive input of the host. All
modules in the chain must be setup to the same baud rate and must echo
all received data (see Setups). Each module must be setup with its own
unique address to avoid communications collisions (see Setups). In this
network, any characters transmitted by the host are received by each
module in the chain and passed on to the next station until the information
is echoed back to the Receive input of the host. In this manner all the
commands given by the host are examined by every module. If a module in
the chain is correctly addressed and receives a valid command, it will
respond by transmitting the response on the daisy chain network. The
response data will be ripple through any other modules in the chain until it
reaches its final destination, the Receive input of the host.
Figure 3.1 RS-232 Daisy-Chain Network.
Communications 3-4
The daisy chain network must be carefully implemented to avoid the pitfalls
inherent in its structure. The daisy-chain is a series-connected structure and
any break in the communications link will bring down the whole system.
Several rules must be observed to create a working chain:
1. All wiring connections must be secure; any break in the wiring,
power, ground or communications breaks the chain.
2. All modules must be plugged into their connectors.
3. All modules must be setup for the same baud rate.
4. All modules must be setup for echo.
Software Considerations
If the host device is a computer, it must be able to handle the echoed
command messages on its Receive input along with the responses from the
module. This can be handled by software string functions by observing that
a module response always begins with a ‘ * ‘ or ‘ ? ‘ character and ends with
a carriage return.
A properly addressed D3000/4000 module in a daisy chain will echo all of
the characters in the command including the terminating carriage return.
Upon receiving the carriage return, the module will immediately calculate
and transmit the response to the command. During this time, the module will
not echo any characters that appear on its receive input. However, if a
character is received during this computation period, it will be stored in the
module’s internal receive buffer. This character will be echoed after the
response string is transmitted by the module. This situation will occur if the
host computer appends a linefeed character on the command carriage
return. In this case the linefeed character will be echoed after the response
string has been transmitted.
The daisy chain also affects the command timeout specifications. When a
module in the chain receives a character it is echoed by retransmitting the
character through the module’s internal UART. This method is used to
provide more reliable communications since the UART eliminates any
slewing errors caused by the transmission lines. However, this method
creates a delay in propagating the character through the chain. The delay
Communications 3-5
is equal to the time necessary to retransmit one character using the baud
rate setup in the module:
One delay time is accumulated for each module in the chain. For example,
if four modules are used in a chain operating at 1200 baud, the accumulated
delay time is 4 X 8.33 mS = 33.3 mS This time must be added to the times
listed in Table 3.1 to calculate the correct communications time-out error.
For modules with RS-232C outputs, the programmed communications
delay specified in the setup data (see Chapter 5) is implemented by sending
a NULL character (00) followed by an idle line condition for one character
time. This results in a delay of two character periods. For longer delay times
specified in the setup data, this sequence is repeated. Programmed
communications delay is seldom necessary in an RS-232C daisy chain
since each module in the chain adds one character of communications
delay.
Changing Baud Rate
It is possible to change the baud rate of an RS-232C daisy chain on-line. This
process must be done carefully to avoid breaking the communications link.
1. Use the SetUp (SU) command to change the baud rate setup on each
module in the chain. Be careful not to generate a reset during this process.
A reset can be caused by the Remote Reset (RR) command or power
interruptions.
2. Verify that all the modules in the chain contain the new baud rate setup
using the Read Setup (RS) command. Every module in the chain must be
setup for the same baud rate.
3. Remove power from all the modules for at least 10 seconds. Restore
power to the modules. This generates a power-up reset in each module and
loads in the new baud rate.
4. Change the host baud rate to the new value and check communications.
5. Be sure to compensate for a different communications delay as a
Communications 3-6
result of the new baud rate.
Using A Daisy-Chain With A Dumb Terminal
A dumb terminal can be used to communicate to a daisy-chained system.
The terminal is connected in the same manner as a computer used as a host.
Any commands typed into the dumb terminal will be echoed by the daisy
chain. To avoid double characters when typing commands, set the terminal
to full duplex mode or turn off the local echo. The daisy chain will provide the
input command echo.
RS-485
RS-485 is a recently developed communications standard to satisfy the
need for multidropped systems that can communicate at high data rates
over long distances. RS-485 is similar to RS-422 in that it uses a balanced
differential pair of wires switching from 0 to 5V to communicate data. RS-485
receivers can handle common mode voltages from -7V to +12V without loss
of data, making them ideal for transmission over great distances. RS-485
differs from RS-422 by using one balanced pair of wires for both transmitting
and receiving. Since an RS-485 system cannot transmit and receive at the
same time it is inherently a half-duplex system. RS-485 offers many
advantages over RS-232C:
1) balanced line gives excellent noise immunity
2) can communicate with modules at 38400 baud
3) communications distances up to 4,000 feet.
4) true multidrop; modules are connected in parallel
5) can disconnect modules without losing communications
6) up to 32 modules on one line; 124 with repeaters
7) no communications delay due to multiple modules
8) simplified wiring using standard telephone cable
RS-485 does have disadvantages. Very few computers or terminals have
built-in support for this new standard. Interface boards are available for the
IBM PC and compatibles and other RS-485 equipment will become available as the standard gains popularity. An RS-485 system usually requires
an interface.
We offer the A1000 and A2000 interface converters that will convert RS-232
signals to RS-485 or repeat RS-485 signals. The A1000 converters also
include a +24Vdc, one amp power supply for powering D1000 series
modules. The A1000 or A2000 connected as an RS-485 repeater can be
used to extend an existing RS-485 network or connect up to 124 modules
Communications 3-7
Communications 3-8
on one serial communications port.
RS-485 Multidrop System
Figure 3.2 illustrates the wiring required for multiple-module RS-485 system. Notice that every module has a direct connection to the host system.
Any number of modules may be unplugged without affecting the remaining
modules. Each module must be setup with a unique address and the
addresses can be in any order. All RS-485 modules must be setup for no
echo to avoid bus conflicts (see Setup). Also note that the connector pins on
each module are labelled with notations (B), (R), (G), and (Y). This
designates the colors used on standard 4-wire telephone cable:
LabelColor
(B) GNDBlack
(R) V+Red
(G) DATA*Green
(Y) DATAYellow
This color convention is used to simplify installation. If standard 4-wire
telephone cable is used, it is only necessary to match the labeled pins with
the wire color to guarantee correct installation.
DATA* on the label is the complement of DATA (negative true).
To minimize unwanted reflections on the transmission line, the bus should
be arranged as a line going from one module to the next. ‘Tree’ or random
structures of the transmission line should be avoided. When using long
transmission lines and/or high baud rates, the data lines should be terminated at each end with 200 ohm resistors. Standard values of 180 ohms or
220 ohms are acceptable.
During normal operation, there are periods of time where all RS-485 drivers
are off and the communications lines are in an 'idle' high impedance
condition. During this condition, the lines are susceptible to noise pickup
which may be interpreted as random characters on the communications
line. To prevent noise pickup, all RS-485 systems should incorporate 1K
ohm bias resistors as shown in Figure 3.2. The resistors will maintain the
data lines in a 'mark' condition when all drivers are off.
The A1000 series converter boxes have the 1KΩ resistors built-in.
Special care must be taken with very long busses (greater than 1000 feet)
to ensure error-free operation. Long busses must be terminated as described above. The use of twisted cable for the DATA and DATA* lines will
greatly enhance signal fidelity. Use parity and checksums along with the ‘#’
Communications 3-9
form of all commands to detect transmission errors. In situations where
many modules are used on a long line, voltage drops in the power leads
becomes an important consideration. The GND wire is used both as a power
connection and the common reference for the transmission line receivers in
the modules. Voltage drops in the GND leads appear as a common-mode
voltage to the receivers. The receivers are rated for a maximum of -7V. of
common-mode voltage. For reliable operation, the common mode voltage
should be kept below -5V.
To avoid problems with voltage drops, modules may be powered locally
rather than transmitting the power from the host. Inexpensive 'calculator'
type power supplies are useful in remote locations. When local supplies are
used, be sure to provide a ground reference with a third wire to the host or
through a good earth ground. With local supplies and an earth ground, only
two wires for the data connections are necessary.
Communications Delay
All modules with RS-485 outputs are setup at the factory to provide two units
of communications delay after a command has been received (see Chapter
5). This delay is necessary when using host computers that transmit a
carriage return as a carriage return-linefeed string. Without the delay, the
linefeed character may collide with the first transmitted character from the
module, resulting in garbled data. If the host computer transmits a carriage
return as a single character, the delay may be set to zero to improve
communications response time.
Communications 3-10
Chapter 4
Command Set
The D3000/4000 modules operate with a simple command/response protocol to control all module functions. A command must be transmitted to the
module by the host computer or terminal before the module will respond with
useful data. A module can never initiate a communications sequence. A
variety of commands exists to exploit the full functionality of the modules. A
list of available commands and a sample format for each command is listed
in Table 4.1.
Command Structure
Each command message from the host must begin with a command prompt
character to signal to the modules that a command message is to follow.
There are two valid prompt characters; a dollar sign character ($) is used to
generate a short response message from the module. A short response is
the minimum amount of data necessary to complete the command. The
second prompt character is the pound sign character (#) which generates
long responses (will be covered later).
The prompt character must be followed by a single address character
identifying the module to which the command is directed. Each module
attached to a common communications port must be setup with its own
unique address so that commands may be directed to the proper unit.
Module addresses are assigned by the user with the SetUp (SU) command.
Printable ASCII characters such as ‘1’ (ASCII $31) or ‘A’ (ASCII $41) are the
best choices for address characters.
The address character is followed by a two or three-character command that
identifies the function to be performed by the module. All of the available
commands are listed in Table 4.1 along with a short function definition.
Commands must be transmitted as upper-case characters.
A two-character checksum may be appended to any command message
(except the ID command) as a user option. See ‘Checksum’ later in this
chapter .
All commands must be terminated by a Carriage Return character (ASCII
$0D). (In all command examples in this text the Carriage Return is either
implied or denoted by the symbol ‘CR’.)
Command Set 4-2
Data Structure
Many commands require additional data values to complete the command
definition as shown in the example commands in Table 4.1. The particular
data necessary for these commands is described in full in the complete
command descriptions.
The most common type of data used in commands and responses is analog
data. Analog data is always represented in the same format for all models
in the D3000/4000 series. Analog data is represented as a nine-character
string consisting of a sign, five digits, decimal point, and two additional digits.
The string represents a decimal value in engineering units. Examples:
+12345.68
+00100.00
-00072.10
-00000.00
When using commands that require analog data as an argument, the full
nine-character string must be used, even if some digits are not significant.
Failure to do this results in a SYNTAX ERROR.
Analog data responses from the module will always be transmitted in the
nine-character format. This greatly simplifies software parsing routines
since all analog data is in the same format for all module types.
In many cases, some of the digits in the analog data may not be significant.
For instance, in the D3151 0 to 20mA output module, the data is scaled in
milliamps. The full scale output is +00020.00mA. The left three digits have
no significance. However, the data format is always adhered to in order to
maintain compatibility with other module types.
The maximum computational resolution of the module is 16 bits, which is
less than the resolution that may be represented by an analog data variable.
This may lead to round-off errors in some cases. For example, a limit value
may be stored in a D3000/4000 module using the ‘HI’ command:
Command:$1HI+12345.67
Response:*
The limit value is read back with the Read HIgh (RHI) command:
Command:$1RHI
Response:*+12345.60
It appears that the data read back does not match the value that was
originally saved. The error is caused by the fact that the value saved exceeds
the computational resolution of the module. This type of round-off error only
Command Set 4-3
appears when large data values saved in the module’s EEPROM are read
back. In most practical applications, the problem is non-existent.
The Digital Input, Hex Output and Setup commands use hexadecimal
representations of data. The data structures for these commands are
detailed in the command descriptions.
Write Protection
Many of the commands listed in Table 4.1 are under the heading of ‘Write
Protected Commands’. These commands are used to alter setup data in the
module’s EEPROM. They are write protected to guard against accidental
loss of setup data. All write-protected commands must be preceded by a
Write Enable (WE) command before the protected command may be
executed.
Miscellaneous Protocol Notes
The address character must be transmitted immediately after the command
prompt character. After the address character the module will ignore any
character below ASCII $23 (except, of course, CR). This allows the use of
spaces (ASCII $20) within the command message for better readability if
desired.
The length of a command message is limited to 20 printable characters. If
a properly addressed module receives a command message of more than
20 characters the module will abort the whole command sequence and no
response will result.
If a properly addressed module receives a second command prompt before
it receives a CR, the command will be aborted and no response will result.
Response Structure
Response messages from the module begin with either an asterisk ‘ * ‘
(ASCII $2A) or a question mark ‘ ? ‘ (ASCII $3F) prompt. The ‘ * ‘ prompt
indicates acknowledgment of a valid command. The ‘ ? ‘ prompt precedes
an error message. All response messages are terminated with a CR. Many
commands simply return a ‘ * ‘ character to acknowledge that the command
has been executed by the module. Other commands send data information
following the ‘ * ‘ prompt. The response format of all commands may be found
in the detailed command description.
The maximum response message length is 20 characters.
A command/response sequence is not complete until a valid response is
received. The host may not initiate a new command until the response from
a previous command is complete. Failure to observe this rule will result in
Loading...
+ 67 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.