Omega Products D110X Installation Manual

omega.com
e-mail: info@omega.com
For latest product manuals:
omegamanual.info
User’s Guide
D1000 Series
Digital Transmitters
Shop online at
Servicing North America:
U.S.A.: One Omega Drive, Box 4047
ISO 9001 Certified Stamford, CT 06907-0047
Tel: (203) 359-1660 FAX: (203) 359-7700 e-mail: info@omega.com
Canada: 976 Bergar
Laval (Quebec) H7L 5A1, Canada Tel: (514) 856-6928 FAX: (514) 856-6886 e-mail: info@omega.ca
For immediate technical or application assistance:
U.S.A. and Canada: Sales Service: 1-800-826-6342 / 1-800-TC-OMEGA
®
Customer Service: 1-800-622-2378 / 1-800-622-BEST
®
Engineering Service: 1-800-872-9436 / 1-800-USA-WHEN
®
Mexico: En Espan˜ol: (001) 203-359-7803 e-mail: espanol@omega.com
FAX: (001) 203-359-7807 info@omega.com.mx
Servicing Europe:
Benelux: Postbus 8034, 1180 LA Amstelveen, The Netherlands
Tel: +31 (0)20 3472121 FAX: +31 (0)20 6434643 Toll Free in Benelux: 0800 0993344 e-mail: sales@omegaeng.nl
Czech Republic: Frystatska 184, 733 01 Karvina´, Czech Republic
Tel: +420 (0)59 6311899 FAX: +420 (0)59 6311114 Toll Free: 0800-1-66342 e-mail: info@omegashop.cz
France: 11, rue Jacques Cartier, 78280 Guyancourt, France
Tel: +33 (0)1 61 37 2900 FAX: +33 (0)1 30 57 5427 Toll Free in France: 0800 466 342 e-mail: sales@omega.fr
Germany/Austria: Daimlerstrasse 26, D-75392 Deckenpfronn, Germany
Tel: +49 (0)7056 9398-0 FAX: +49 (0)7056 9398-29 Toll Free in Germany: 0800 639 7678 e-mail: info@omega.de
United Kingdom: One Omega Drive, River Bend Technology Centre
ISO 9002 Certified Northbank, Irlam, Manchester
M44 5BD United Kingdom Tel: +44 (0)161 777 6611 FAX: +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.
D1000 SERIES USERS MANUAL
REVISED: 10/1/97 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 in­tended as suggestions for possible use of the products and not as explicit performance in a specific application. Specifications may be subject to change without notice. D1000 modules are not intrinsically safe devices and should not be used in an explosive environment unless enclosed in approved explosion-proof housings.
TABLE OF CONTENTS Warranty 4 CHAPTER 1 Getting Started
Default Mode 1-1
Quick Hook-Up 1-2
CHAPTER 2 Functional Description
Block Diagram 2-4
CHAPTER 3 Communications
Data Format 3-2
RS-232 3-2
Multi-party Connection 3-3
Software Considerations 3-4
Changing Baud Rate 3-5
Using a Daisy-Chain With a Dumb Terminal 3-5
RS-485 3-6
RS-485 Multidrop System 3-8
CHAPTER 4 Command Set
Table of Commands 4-6
User Commands 4-7
Error Messages 4-18
CHAPTER 5 Setup Information and Command
Command Syntax 5-2
Setup Hints 5-11
CHAPTER 6 Digital I/O Function
Digital Outputs 6-1
Digital Inputs 6-2
Events Counter 6-3
Alarm Outputs 6-4
On-Off Controller 6-5
Setpoint 6-9
CHAPTER 7 Power Supply CHAPTER 8 Troubleshooting CHAPTER 9 Calibration Appendix A (ASCII TABLE ) Appendix B D1600 Data Sheet Appendix C D1400 Data Sheet Appendix D D1500 Data Sheet Appendix E D2000 Series Appendix F Continuous Operation Appendix G RTS Operation Appendix H D1000/2000 Specifications
Chapter 1
Getting Started
Default Mode
All D1000 modules contain an EEPROM (Electrically Erasable Program­mable 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 com­munications port without having to physically change switch and pot settings. 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 communica­tions 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 except the six identified illegal values (NULL, CR, $, #, {, }). 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 config­ures 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
1-2 D1000 USERS MANUAL 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 D1000 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.
Begin by typing $1RD and pressing the Enter or Return key. The module will respond with an * followed by the data reading at the input. The data includes sign, seven digits and a decimal point. For example, if you are using a thermocouple module and measuring room temperature your reading might be *+00025.00. The temperature reading will initially be in °C which has been preset at the factory. 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, alarms off, no echo and two-character delay. Refer to the Chapter 5 to configure the module to your application.
Figure 1.1 RS-232C Quick Hook-Up.
Getting Started 1-3
Figure 1.2 RS-485 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-232 output.
In some rare cases it may be necessary to connect the module’s DATA pin to ground through a 100 to 1k resistor.
1-4 D1000 USERS MANUAL
Figure 1.3 RS-485 Quick Hook-Up with RS-232C Port.
Chapter 2
Functional Description
A functional diagram of a typical module is shown in Figure 2.1. It is a useful reference that shows the data path in the module and to explain the function of many of the module’s commands.
The first step is to acquire the sensor signal and convert it to digital data. In Figure 2.1, all the signal conditioning circuitry has been lumped into one block, the analog/digital converter (A/D). Autozero and autocalibration is performed internally and is transparent to the user.
The full-scale output of the A/D converter may be trimmed using the Trim Span (TS) command. The TS command adjusts calibration values stored internally in the EEPROM. The TS command should only be used to trim the accuracy of the unit with a laboratory standard reference applied to the sensor input.
The trimmed data flows into either of two digital filters. The filter selection is performed automatically by the microprocessor after every A/D conversion. The filter selection depends on the difference of the current A/D output data and the previous data stored in the output data register. If the least significant decimal digit from the A/D differs from the old output data by more than 10 counts, the large signal filter is selected. If the change is less than 10 counts, the small signal filter is used.
The two-filter system allows for different degrees of filtering depending on the rate of the input change. For steady-state signals, the small-signal filter averages out noise and small input changes to give a stable steady-state output. The large-signal filter is activated by step changes or very noisy input signals. The time constants for the two filters can be specified independently with the SetUp (SU) command. The filter values are stored in nonvolatile memory. Typically, the small-signal filter is set to a larger time constant than the large-signal filter. This gives very good noise rejection along with fast response to step inputs.
The modules allow user selectable output scaling in °C or °F on temperature data. This selection is shown in Figure 2.1 as a switch following the digital filters. The default scaling in the modules is °C, but this may be converted to °F by feeding the data through a conversion routine. The switch position is controlled by a bit in the setup data and may be changed with the SetUp (SU) command. The scaling selection is nonvolatile. In non-temperature applications, °C should always be selected.
The scaled data is summed with data stored in the Output Offset Register to obtain the final output value. The output offset is controlled by the user and has many purposes. The data in the Output Offset Register may be used to trim any offsets caused by the input sensor. It may be used to null out
2-2 D1000 USERS MANUAL undesired signal such as a tare weight. The Trim Zero (TZ) command is used to adjust the output to any desired value by loading the appropriate value in the offset register. The offset register data is nonvolatile.
The output offset may also be modified using the Set Point (SP) command. The data value specified by the SP command is multiplied by -1 before being loaded into the register. The Set Point command specifies a null value that is subtracted from the input data. The output reading becomes a deviation value from the downloaded setpoint. This feature is very useful in on-off controllers as described in Chapter 6 of this manual.
The value stored in the offset register may be read back using the Read Zero (RZ) command. Data loaded in with the SP command will be read back with the sign changed. The output register may be reset to zero with the Clear Zero (CZ) command.
The output data may be read with the Read Data (RD) command. In some cases when a computer is used as a host, the same data value may be read back several times before it is updated with a new A/D conversion. To guarantee that the same data is not read more than once, the New Data (ND) command is used. Each time an RD or ND command is performed, the New Data Flag is cleared. The flag is set each time the output data register is loaded as the result of a new A/D conversion. The ND command waits until the flag is set before it outputs the data reading.
The remainder of Figure 2.1 shows several functions: a versatile alarm function, an event counter and general-purpose digital inputs and outputs. These functions are described in detail in Chapter 6.
The alarm section consists of two registers that are used to store high and low alarm limit values. These registers may be down-loaded with data values by using the HI and LO alarm commands. The alarm values are loaded with the same data format that is used with the output data. The high and low alarm registers are nonvolatile so they will not be lost when the unit is powered down. The values held in the alarm registers may be read back at any time with the Read High (RH) and Read Low (RL) commands.
The data held in the alarm registers is continually compared with the calculated output data. The result of the comparison is used to trip alarms that may be used as control outputs. The high alarm is turned on when the output data exceeds the high limit value. The low alarm is activated if the output data is less than the low alarm value. Each alarm has two user selectable modes, either Momentary (M) or Latching (L). Momentary alarms are activated only while the alarm condition is met; if the output data returns within limits, the alarm is turned off. Conversely, when latching alarms are activated, they remain on even if the output data returns within limits.
Functional Description 2-3
Latching alarms are turned off with the Clear Alarms (CA) command or if the opposite alarm limit is exceeded.
The state of the alarms may be read with the Digital Input (DI) command. Also, the alarm outputs may be used to activate digital outputs on the module to turn on alarms or to perform simple control functions. The alarm outputs are shared with the general purpose digital output bits DO0 and DO1. To connect the alarm outputs to the module connector, the Enable Alarm (EA) command is used. The connector pins may be switched back to the general­purpose digital outputs using the Disable Alarms (DA) command. The EA/ DA selection is nonvolatile.
The general-purpose digital outputs are open-collector transistor switches that may be controlled by the host with the Digital Output (DO) command. They are designed to activate external solid-state relays to control AC or DC power circuits. The output may also be used to interface to other logic-level devices. The number of digital outputs available depends on the module type.
The Digital Input (DI) command is used to sense the logic levels on the digital input pins DI0-DI7. The digital inputs are used to read logic levels generated by other devices. They are also useful to sense the state of electro­mechanical limit switches. The number of digital inputs available varies with the module type.
The DI0 input is shared with the input to the Event Counter. The Event Counter accumulates the number of positive transitions that occur on the DI0/EV connector pin. The counter can accumulate up to 9999999 (decimal) events and may be read with the Read Events (RE) command. The counter input is filtered and uses a Schmitt-trigger input to provide a bounce-free input for mechanical switches. The counter value may be zeroed with the Clear Events (CE) command or the write-protected Events Clear (EC) command.
2-4 D1000 USERS MANUAL
Chapter 3
Communications
Introduction
The D1000 modules has 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 high-level 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; 122 with repeaters. A practical limit for RS-232C units is about ten, although a string of 122 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 com­mand/response protocol must be strictly observed to avoid communications collisions and data errors.
Communications to the D1000 modules is performed with two-character ASCII command codes such as RD to Read Data from the analog input. 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 time-out error has occurred. After the communications time-out it is as­sumed that no response data is forthcoming. This error usually results when
3-2 D1000 USERS MANUAL an improper command prompt or address is transmitted. The table below
lists the timeout specification for each command: Mnemonic Timeout DI,DO,RD 10 mS
ND See text All other commands 100 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 for­mat. 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 D1000 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 D1000 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
3) greater communications delay in multiple-module systems
4) less reliable–loss of one module; communications are lost
5) wiring is slightly more complex than RS-485
6) 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 D1000 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.
3-4 D1000 USERS MANUAL 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 own 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 D1000 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 is equal to the time necessary to retransmit one character using the baud rate setup in the module:
Baud Rate Delay Baud Rate Delay 300 33.30ms 9600 1.04ms 600 16.70ms 19200 0.52ms 1200 8.33ms 38400 0.26ms 2400 4.17ms 57600 173.6µs 4800 2.08ms 115200 86.8µs
Communications 3-5
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 communica­tions.
5. Be sure to compensate for a different communications delay as a 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.
3-6 D1000 USERS MANUAL 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 D1000 modules at 115200 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; 122 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 avail­able 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 122 modules on one serial communications port.
Communications 3-7
3-8 D1000 USERS MANUAL RS-485 Multidrop System
Figure 3.2 illustrates the wiring required for multiple-module RS-485 sys­tem. 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:
Label Color (B) GND Black
(R) V+ Red (G) DATA* (-) Green (Y) DATA (+) Yellow
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 termi­nated 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.
A1000 series converter boxes have the 1K resistors built-in. The resistors are user-selectable via dip switch located on the rear panel of the A1000.
Special care must be taken with very long busses (greater than 1000 feet) to ensure error-free operation. Long busses must be terminated as de­scribed above. The use of twisted cable for the DATA and DATA* lines will greatly enhance signal fidelity. Use parity and checksums along with the ‘#’ 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
Communications 3-9
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 D1000 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.
3-10 D1000 USERS MANUAL
Chapter 4
Command Set
The D1000 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 four 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 in this chapter). The other two prompt characters: left curly brace ({ ) and right curly brace ( }) are part of the Extended Addressing mode described in chapter 10
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-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. All commands are described in Chapter 4. Commands must be transmitted as upper-case characters.
A two-character checksum may be appended to any command message as a user option. See ‘Checksum’ in Chapter 4 .
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’.)
In addition to the command structure discussed above there is a special command format called Extended Addressing. This mode uses a differ­ent prompt, either '{' or '}' to distinguish it from the regular command syntax. The Extended Addressing mode is described in chapter 10.
4-2 D1000 USERS MANUAL 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 D1000 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, the D1300 thermocouple input modules feature 1 degree output resolution. A typical analog data value from this type of module could be +00123.00. The two digits to the right of the decimal point have no significance in this particular model. 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, an alarm value may be stored in a D1000 module using the ‘HI’ command:
Command: $1HI+12345.67M Response: *
The alarm value is read back with the Read High (RH) command:
Command: $1RH Response: *+12345.60M
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.
Overload values of analog data are +99999.99 and -99999.99 . Data read back from the Event Counter with the Read Events (RE)
command is in the form of a seven-digit decimal number with no sign or decimal point. Round-off errors do not occur on the event counter. For example:
Command: $1RE Response: *0000123
The Digital Input, Digital 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 transmitted immediately after the command prompt character. After the address character the module will ignore any character below ASCII $23 (except 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
4-4 D1000 USERS MANUAL 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 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 the 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 4.1, a communications 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.
Long Form Responses
When the pound sign ‘ # ‘ command prompt is used, the module responds with a ‘long form’ response. This type of response will echo the command message, supply the necessary response data and will add a two-character checksum to the end of the message. Long form responses are used when the host wishes to verify the command received by the module. The checksum is included to verify the integrity of the response data. The ‘ # ‘ command prompt may be used with any command. For example:
Command: $1RD (short form) Response: *+00072.10
Command: #1RD (long form) Response: *1RD+00072.10A4 (A4=checksum)
Checksum
Checksum is a two character hexadecimal value appended to the end of a message. It verifies that the message received is exactly the same as the message sent. The checksum ensures the integrity of the information communicated.
Command Checksum
A two-character checksum may be appended to any command to the module as a user option. When a module interprets a command, it looks for
Command Set 4-5
the two extra characters and assumes that it is a checksum. If the checksum is not present, the module will perform the command normally. If the two extra characters are present, the module calculates the checksum for the message. If the calculated checksum does not agree with the transmitted checksum, the module responds with a ‘BAD CHECKSUM’ error message and the command is aborted. If the checksums agree, the command is executed. If the module receives a single extra character, it responds with ‘SYNTAX ERROR’ and the command is aborted For example:
Command: $1RD (no checksum) Response: *+00072.10
Command: $1RDEB (with checksum) Response: *+00072.10
Command: $1RDAB (incorrect checksum) Response: ?1 BAD CHECKSUM
Command: $1RDE (one extra character) Response: ?1 SYNTAX ERROR
Response Checksums
If the long form ‘ # ‘ version of a command is transmitted to a module, a checksum will be appended to the end of the response. For example:
Command: $1RD (short form) Response: *+00072.10
Command: #1RD (long form) Response: *1RD+00072.10A4 (A4=checksum)
Checksum Calculation
The checksum is calculated by summing the hexadecimal values of all the ASCII characters in the message. The lowest order two hex digits of the sum are used as the checksum. These two digits are then converted to their ASCII character equivalents and appended to the message. This ensures that the checksum is in the form of printable characters.
Example: Append a checksum to the command #1DOFF
Characters: # 1 D O F F ASCII hex values: 23 31 44 4F 46 46 Sum (hex addition) 23 + 31 + 44 + 4F + 46 + 46 = 173
The checksum is 73 (hex). Append the characters 7 and 3 to the end of the message: #1DOFF73
Example: Verify the checksum of a module response *1RD+00072.10A4
4-6 D1000 USERS MANUAL
The checksum is the two characters preceding the CR: A4 Add the remaining character values: *1RD+00072. 10
2A + 31 + 52 + 44 + 2B + 30 + 30 + 30 + 37 + 32 + 2E + 31 + 30 = A4
The two lowest-order hex digits of the sum are A4 which agrees with the transmitted checksum.
The transmitted checksum is the character string equivalent to the calcu­lated hex integer. The variables must be converted to like types in the host software to determine equivalency.
If checksums do not agree, a communications error has occurred. If a module is setup to provide linefeeds, the linefeed characters are not
included in the checksum calculation. Parity bits are never included in the checksum calculation.
Table 4.1 D1000 Command Set
Command and Definition Typical Typical
Command Response Message Message
($ prompt)
DI Read Alarms/Digital Inputs $1DI *0003 DO Set Digital Outputs $1DOFF * ND New Data $1ND *+00072.00 RD Read Data $1RD *+00072.00 RE Read Event Counter $1RE *0000107 REA Read Extended Address $1REA *3031 RH Read High Alarm Value $1RH *+00510.00L RID Read IDentification $1RID * BOILER RL Read Low Alarm Value $1RL *+00000.00L RPT Read Pulse Transition $1RPT *+­RS Read Setup $1RS *31070142 RZ Read Zero $1RZ *+00000.00 WE Write Enable $1WE *
Write Protected Commands CA Clear Alarms $1CA *
CE Clear Events $1CE * CZ Clear Zero $1CZ * DA Disable Alarms $1DA * EA Enable Alarms $1EA *
Command Set 4-7
EC Events Read & Clear $1EC *0000107 HI Set High Alarm Limit $1HI+12345.67L * ID IDentification $1ID BOILER * LO Set Low Alarm Limit $1LO+12345.67L * PT Pulse Transition $1PT+- * RR Remote Reset $1RR * SU Setup Module $1SU31070142 * SP Set Setpoint $1SP+00600.00 * TS Trim Span $1TS+00600.00 * TZ Trim Zero $1TZ+00000.00 * WEA Write Extended Address $1WEA3031 *
D1000 User Commands
Note that in all command and response examples given below, a carriage return is implied after every character string.
Clear Alarms (CA) The clear alarms command turns both the HI and LO alarms OFF. This command does not affect the enable/disable or momentary/latching alarm conditions. The alarms will continue to be compared to the input data after the CA command is given. In cases where the alarm condition persists, the alarms will be set at the end of the next input data conversion. The primary purpose of the CA command is to clear latching alarms. See the Alarm Output section of Chapter 6 for more information.
Command: $1CA Response: *
Command: #1CA Response: *1CADF
Clear Events (CE)
Clear Events command clears the events counter to 0000000.
Command: $1CE Response: *
Command: #1 Response: *1CEE3
Note: When the events counter reaches 9999999, it stops counting. A CE command must be sent to resume counting.
Clear Zero (CZ)
The Clear Zero command clears the output offset register value to +00000.00. This command clears any data resulting from a Trim Zero (TZ)
4-8 D1000 USERS MANUAL or SetPoint (SP) command.
Command: $1CZ Response: *
Command: #1CZ Response: *1CZF8
Disable Alarms (DA)
Most D1000 modules feature LO/DO0 and HI/DO1 pins on the module connector. These pins serve a dual function and can be used to output either the alarm outputs or digital outputs 0 and 1. The Disable Alarms command is used to connect the digital outputs 0 and 1 to the connector pins. The alarm settings are not affected in any way except that the alarm outputs are disconnected from the module connector. The alarm status can still be read with the Digital Input (DI) command. The complement to the DA command is the Enable Alarms (EA) command.
Command: $1DA Response: *
Command: #1DA Response: *1DAE0
Digital Input (DI)
The DI command reads the status of the digital inputs and the alarms. The response to the DI command is four hex characters representing two bytes of data. The first byte contains the alarm status. The second byte contains the digital input data.
Command: $1DI Response: *0003
Command: #1DI Response: *1DI0003AB
Listed below are the four possible alarm states in the first digital input byte and their hex values.
00 Both HI and LO alarms off. 01 HI alarm off. LO alarm on. 02 HI alarm on. LO alarm off. 03 Both HI and LO alarms on.
The second byte displays the hex value of the digital input status. The number of digital inputs varies depending on module type.
Digital Inputs DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 Data Bits 76543210
Loading...
+ 74 hidden pages