B&B Electronics 485SDD16 User Manual

RS-485 Digital I/O Module
Model 485SDD16
Document ation Number 485SDD16-1005
Designed and Manufactured
of domestic and imported parts by
B&B Electronics Mfg. Co. Inc.
707 Dayton Road -- P.O. Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
http://www.bb-elec.com
support@bb-elec.com
B&B Electronics -- Revised February 2005
This product
In Ottawa, Illinois
USA
Internet:
sales@bb-elec.com
485SDD16-1005 Manual Cover Page
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Table of Contents
Chapter 1- Introduction........................................... 1
485SDD16 Features............................................... 1
Packing List............................................................2
485SDD16 Specifications....................................... 2
I/O Lines................................................................................2
Inputs.................................................................................2
Outputs..............................................................................2
Power Supply........................................................................3
Communications ...................................................................3
Size .......................................................................................3
Chapter 2 - Connections......................................... 5
Digital I/O Connections........................................... 5
Digital Inputs ..... ....................................................................5
Digital Outputs.......................................................................5
Ground ..................................................................................5
Serial Port Connections.......................................... 6
Power Supply Connections..................................... 8
Chapter 3 - Commands........................................... 9
Syntax .................................................................. 10
I/O Data Bytes...... .............................. .................................10
Read I/O Lines Command.................................... 12
Set Output Lines Command................................. 12
Set Module Address Command............................ 13
Set Turn-around Delay Command........................ 13
Define I/O Lines Command..................................14
Set Power-up States Command........................... 15
Read Configuration Command............................. 15
Chapter 4 - I/O Interfacing..................................... 17
Digital Inputs......................................................... 17
Digital Outputs...................................................... 19
Chapter 5 - Software.............................................. 21
Programming Techniques.....................................21
Read I/O Lines Command ..................................................21
Read Configurat ion Command ...........................................22
Set Output States Command..............................................24
Define I/O Lines Command.................................................25
Set Power-up States Command .........................................26
Set Module Address Command..........................................27
Set Turn-around Delay Command........................ ..............28
Demonstration Program ....................................... 29
Hard Drive Installation .......... Error! Bookmark not defined.
Running Demonstration Program .......................................29
APPENDIX A..........................................................A-1
ASCII Character Codes.......................................A-1
APPENDIX B..........................................................B-1
Hexadecimal/Decimal Conversions.....................B-1
APPENDIX C..........................................................C-1
Interface Modules for SDD16 Models..................C-1
DTB25.................................................................C-2
DBM16 ................................................................C-3
DBM16 Interfacing ............................................................C-4
Inputs.............................................................................C-5
Outputs..........................................................................C-7
DBM16 Specificat ions.......................................................C-8
I/O Lines ........................................................................C-8
Inputs .........................................................................C-8
Outputs ......................................................................C-8
Power Supply ................................................... .............C-8
Size................................................................................C-8
Appendix D
Adding Data Field Confirmation.........................D-1
485SDD16-1005 Manual Table of Contents i
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
ii Table of Contents 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Chapter 1- Introduction
485SDD16 Features
The 485SDD16 is a general purpose control module that operates through an RS-485 interface. The 485SDD16 offers 16 discrete digital I/O lines. With these features, the module can be used to sense external ON/OFF conditions and to control a variety of devices. Each of the sixteen I/O lines can be defined as either an input or an output. The digital outputs are CMOS compatible. The digital inputs are CMOS/TTL compatible. The digital I/O lines are available through a DB-25S (female) connector.
The 485SDD16 connects to the host computer’s RS-485 or RS­422 serial port using terminal blocks. The address and turn-around delay are software programmable to allow for use of multiple devices or connection to existing multi-node systems. The unit automatically detects baud rates from 1200 to 9600. A data format of 8 data bits, 1 stop bit and no parity is used. Configuration parameters are stored in non-volatile memory. These parameters consists of module address, communication turn­around delay, I/O definitions, and output power-up states.
The unit is powered by connecting +12Vdc to terminal blocks or to the DB-25S I/O connector.
Figure 1.1 - 485SDD16 Module
Figure 1.2 - Simplified Block Diagram
Packing List
Examine the shipping carton and contents for physical damage. The following items should be in the shipping carton:
1. 485SDD16 unit
2. Software
3. This instruction manual If any of these items are damaged or missing contact B&B Electronics immediately.
485SDD16 Specifications
I/O Lines
Total: 16 (Factory default = inputs)
Inputs
Voltage Range: 0 Vdc to 5 Vdc Low Voltage: 1.0 Vdc max. High Voltage: 2.0 Vdc min. Leakage Current: 1 microamp max.
Outputs
Low Voltage: 0.6 Vdc @ 8.3 milliamps (Sink) High Voltage: 4.3 Vdc @ -3.1 milliamps (Source)
485SDD16-1005 Manual 1
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
2 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Power Supply
Input Voltage: 8 Vdc to 16 Vdc @ 35 milliamps
(Doesn’t include the power consumption of external devices.)
Connection: Terminal Blocks or DB-25S
Communications
Standard: RS-422/485 Addresses: 256 (Factory default = 48 decimal) Turn-around Delay: Software programmable from 0 to 255 character transmission times. (Factory default = 1)
Baud Rate: 1200 to 9600 (automatic detection) Format: 8 data bits, 1 stop bit, no parity Connection: Terminal Blocks Optical Isolation: If optical isolation is required, use B&B’s 485HSPR high-speed optically isolated converter with this product.
Size 0.7" x 2.1" x 5.2"
485SDD16-1005 Manual 3
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
4 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Chapter 2 - Connections
This chapter will cover the connections required for the 485SDD16. There are three sets of connections: digital I/O, serial port, and power supply. Do not make any connections to the 485SDD16 until you have read this chapter.
Digital I/O Connections
Connections to the I/O lines are made through the DB25S (female) I/O port connector. Refer to Table 2.1. See Chapter 5 for I/O interfacing examples.
Digital Inputs
The digital input lines are CMOS/TTL compatible and can handle voltages from 0Vdc to +5Vdc.
Digital Outputs
The digital output lines have a maximum voltage of +5Vdc and are CMOS compatible.
Ground
This pin should be connected to the external digital devices ground.
Table 2.1 - 485SDD16 I/O Port Pinout
DB-25S
Pin #
10 I/O #1 23 I/O #7 11 I/O #2 24 I/O #6 12 I/O #3 25 I/O #5 13 I/O #4
Function
DB-25S
Pin #
Function
1 No connection 14 I/O #15 2 No connection 15 I/O #14 3 No connection 16 I/O #13 4 No connection 17 I/O #12 5 No connection 18 I/O #11 6 No connection 19 I/O #10 7 Ground 20 No connection 8 +12Vdc Input 21 I/O #9 9 I/O #0 22 I/O #8
Serial Port Connections
In order to communicate to the 485SDD16 module it must be connected to an RS-422/RS-485 serial port. The 485SDD16 will work on a 2-wire or 4-wire RS-485 multi-node network. Refer to B&B Electronics’ free RS-422/485 Application Note for more information. The unit automatically detects baud rates from 1200 to
9600. A data format of 8 data bits, 1 stop bit and no parity is used. Connections are made using terminal blocks. Table 2.2 shows the terminal blocks and their functions.
Table 2.2 - RS-485 Terminal Block Connections
TB
Label
FR
GND
TD(A) Transmit
TD(B) Transmit
RD(A) Receive
RD(B) Receive
+12V +12 Vdc
GND Ground - Connection for Signal GND and
Signal
Frame Ground
Data (A)
Data (B)
Data (A)
Data (B)
Power
Signal
Direction at
485SDD16
- Connection for frame ground.
Output Connection is required. [Loop to
RD(A) for 2-wire hookup]
Output Connection is required. [Loop to
RD(B) for 2-wire hookup]
Input Connection is required. [Loop to
TD(A) for 2-wire hookup]
Input Connection is required. [Loop to
TD(B) for 2-wire hookup]
Input Connection is required.
Power Supply GND.
A typical 2-wire RS-485 connection is shown in Figure 2.3 and a
typical RS-422 (or RS-485 4-wire) connection is shown in Figure
2.4. Note that the 485SDD16 data line labels use “A” and “B” designators (per EIA RS-485 Specification). However, some RS-485 equipment uses “+” and “-“ as designators. In almost all cases, the “A” line is the equivalent of the “-“ line and the “B” is the equivalent of the “+” line. With an RS-485/422 system there are other factors that require consideration, such as termination and turn-around delay. For more information refer to B&B Electronics’ free RS-422/485 Application Note.
Notes
485SDD16-1005 Manual 5
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
6 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Figure 2.1 - Example of Multi-Node Network
485SDD16 485SDD16485SDD16
Power Supply Connections
Power to the 485SDD16 must be supplied by an external power
Figure 2.3 - RS-422 4-wire Connection
supply connected to the +12Vdc and GND terminal blocks or to the I/O connector. An external power supply must be able to supply 8 to 16 Vdc at 35ma.
NOTE: Power requirements of the module does not include the power consumption of any external devices connected to the module. Therefore, any current that is sourced by the digital outputs must be added to this value and the current must not exceed the maximum output source current. Refer to the 485SDD16 Specification Section of Chapter 1.
Figure 2.2 - RS-485 2-wire Connection
485SDD16-1005 Manual 7
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
8 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Chapter 3 - Commands
There are only two commands required to control the 485SDD16: set output lines, and read I/O lines. Five additional commands are used for configuring the module: set module address, set turn­around delay, define I/O lines, set power-up states, and read configuration. Command strings are from four to six bytes in length: the “!” character, an address byte, two command characters, and one or two data bytes (if required). (See Table 3.1).
Table 3.1 - 485SDD16 Commands
Function Command Response Read I/O Lines !{addr}RD {I/O msb}{I/O lsb}
Set Output Lines !{addr}SO{I/O msb}{I/O
Set Module Address !{addr}SA{new adr} no response Set Turn-around Delay Define I/O Lines !{addr}SD{I/O msb}{I/O lsb} no response Set Power-up States !{addr}SS{I/O msb}{I/O lsb} no response
Read Configuration !{addr}RC
lsb}
!{addr}SC{#} no response
Symbols: {...} represents one byte
<...> represents a numeric value
Before going into the specifics of each command, it is important to understand that a byte has a numeric value from 0 to 255. The byte's value can be represented in decimal (0 - 255) format, hexadecimal (00 - FF) format, binary (00000000 - 11111111) format, or as an ASCII character. The fixed bytes of each command will be represented as ASCII characters. For example the Read I/O command contains the following ASCII characters: “!" and "RD”. Refer to Table 3.1. However, it is important to remember that an ASCII character has a numeric value. Example: the ASCII "0" (zero) does not have a numeric value of zero but has a value of 48. The decimal and hexadecimal equivalents of some ASCII characters are shown in Table 3.2. Some commands require additional data bytes to complete the command. These data bytes may be represented in any of the formats list above. Refer to Appendix A for more ASCII and decimal equivalents.
no response
I/O Definitions {I/O msb}{I/O lsb} Power-up States {I/O msb}{I/O msb} RS-485 Config. {addr}{t-a delay}
Table 3.2 - Equivalent Values
ASCII Decimal Hexadecimal
! 33 21h 0 48 30h A 65 41h
C 67 43h D 68 44h O 79 4Fh R 82 52h S 83 53h
Syntax
Command strings consist of four to six bytes. The first byte is the start of message byte. The start of message byte is always the ASCII “!” character. The second byte is the address byte. This byte allows each unit to have a unique address. The factory default address is the ASCII "0" character. The next two bytes are the command characters. These bytes are ASCII characters and used to specify which command will be executed by the module. Some commands require an argument field containing a fifth and sometimes a sixth data byte. Commands that manipulate I/O lines require two data bytes, a Most Significant and a Least Significant data byte respectively.
Command Syntax: ! | | | | | | | | | | | 6th Data Byte | | | | 5th Data Byte | | | 2nd Command Byte | | 1st Command Byte | Address Byte Start of Message Byte
I/O Data Bytes
When constructing commands to manipulate output lines or when reading the state of the I/O lines it is necessary to know how to select and interpret the I/O data bytes. The sixteen I/O lines are represented by two data bytes. The Most Significant data byte represents I/O lines #15 through #8 and the Least Significant data byte represents I/O lines #7 through #0. The Most Significant byte is always sent and received first followed by the Least Significant byte.
0 _ _ _ _
485SDD16-1005 Manual 9
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
10 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
A byte represents an eight-bit binary number (11111111), therefore each byte can represent eight I/O lines. Each bit is assigned a bit position and a weight (value). Refer to Table 3.3.
Table 3.3 - Bit Assignments for I/O Lines
MOST SIGNIFICANT I/O BYTE
I/O Line # 15 14 13 12 11 10 9 8
Bit Position 7 6 5 4 3 2 1 0
Hex Weight 80 40 20 10 8 4 2 1
Dec. Weight 128 64 32 16 8 4 2 1
LEAST SIGNIFICANT I/O BYTE
I/O Line # 7 6 5 4 3 2 1 0
Bit Position 7 6 5 4 3 2 1 0
Hex Weight 80 40 20 10 8 4 2 1
Dec. Weight 128 64 32 16 8 4 2 1
To set an output to a HIGH state the corresponding bit position must be set to a "1". Conversely to set an output LOW the corresponding bit position must be set to a "0". When reading I/O lines, any bit set to a "0" indicates the corresponding I/O line is in the LOW state and any bit set to a "1" indicates the corresponding I/O line is in the HIGH state.
Example 3.1 - To set outputs 15, 8, 1, and 0 to a HIGH state, and all
other outputs to a LOW state (shown in bold face) -
MS Byte LS Byte
Shown in binary -
Shown in decimal -
Shown in hexadecimal -
10000001
129
(128+1)
81
(80h+1h)
Example 3.2 - Reply from Read I/O command (shown in bold face) -
MS Byte LS Byte
Shown in binary -
Shown in decimal -
Shown in hexadecimal -
11001000
200
(128+64+8)
C8
(80h+40h+8h)
I/O lines #15, 14, 11, 6, 4, 1 are HIGH and all other I/O lines are LOW.
00000011
(2+1)
(2h+1h)
01010010
(64+16+2)
(40h+10h+2h)
3
3
82
52
Read I/O Lines Command
The Read I/O Lines command returns two data bytes that reflect the state of the I/O lines. The first data byte contains the most significant I/O lines (15 - 8). The second data byte contains the least significant I/O lines (7 - 0). If a bit is a "0" then the state of that I/O line is LOW. If a bit is a "1" then the state of that I/O line is HIGH.
Command: !{addr}RD Argument: none Response: the state of the 16 I/O lines in two 8 bit bytes. (shown in bold face) ASCII Example: !0RDÈR Dec. Example: !0RD<200><82> Hex. Example: !0RD<C8><52> Bin. Example: !0RD<11001000><01010010> Description: Read module 0's (decimal 48) I/O lines. The first byte indicates that I/O lines #15, 14, & 11 are HIGH and I/O lines # 13, 12, 10, 9, & 8 are LOW; the second byte indicates that I/O lines # 6, 4, & 1 are HIGH and I/O lines # 7, 5, 3, 2, & 0 are LOW.
Set Output Lines Command
The Set Output Lines command is used to set the states of the output lines. This command requires two data bytes. These data bytes specify the output state of each output line. The first data byte represents the most significant I/O lines (15 - 8). The second data byte represents the least significant I/O lines (7 - 0). If a bit position is set to a "0" then the state of that output line will be set LOW. If a bit position is set to a "1" then the state of that output line will be set HIGH. NOTE: Refer to the "Define I/O Lines" command to define an I/O line as an output.
Command: !{addr}SO Argument: {I/O msb}{I/O lsb} Response: none ASCII Example: !0SOUA Dec. Example: !0SO<85><65> Hex. Example: !0SO <55><41> Bin. Example: !0SO<01010101><01000001> Description: Set module 0's (decimal 48) output lines. The first byte sets output lines #14, 12, 10, & 8 HIGH and output lines #15, 13, 11, & 9 LOW; the second byte sets output lines #6, & 0 HIGH and output lines # 7, 5, 4, 3, 2, & 1 LOW. Note: If any of these lines are defined as inputs the bit settings are ignored.
485SDD16-1005 Manual 11
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
12 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Set Module Address Command
The Set Module Address command is used to change the address of a 485SDD16. This commands requires one data byte. This data byte is used to specify the module's new address. Addresses can be assigned any decimal value from 0 to 255. The address is stored in non-volatile memory and is effective immediately. Each module must be assigned its own unique address when connected to an RS-485 muti-node network.
Command: !{addr}SA Argument: {new address} Response: none ASCII Example: !0SA9 Dec. Example: !0SA<57> Hex. Example: !0SA<39> Bin. Example: !0SA<00111001> Description: Change module address from ASCII "0" (48 decimal) to address ASCII "9" (57 decimal).
Set Turn-around Delay Command
The Set Turn-around Delay command sets the amount of time the 485SDD16 waits before transmitting its response. This ensures that no two drivers are enabled at the same time on a two-wire RS­485 network. The turn-around delay is stored in non-volatile memory. This command requires a data byte that specifies the turn­around delay. Where {turn-around delay} is a number from 0 to 255. One unit of turn-around is equal to one character transmission time. The turn-around delay can be computed as follows:
character time = (1 / baud rate) * 10
Command: !{addr}SC Argument: {turn-around delay} Response: none ASCII Example: !9SC Dec. Example: !9SC<04> Hex. Example: !9SC<04> Bin. Example: !9SC<00000100> Description: Set module 9's (decimal 57) turn-around delay to four character transmission times (@ 9600 baud the turn-around delay =
4.17ms).
turn-around delay = character time * data byte
Define I/O Lines Command
The Define I/O Lines command is used to define each of the 16 I/O lines as either an input or an output. This command requires two data bytes. Each data byte defines eight I/O lines. The first data byte defines the eight most significant I/O lines (15 - 8). The second data byte defines the eight least significant digital I/O lines (7 - 0). If a bit position is set to a "0" then the I/O line will defined as an input. If a bit position set to a "1" then the I/O line will be defined as an output.
Command: !{addr}SD Argument: {I/O msb}{I/O lsb} Response: none ASCII Example: !0SDUA Dec. Example: !0SD<85><65> Hex. Example: !0SD<55><41> Bin. Example: !0SD<01010101><01000001> Description: Define module 0's (decimal 48) I/O lines. The first byte define I/O lines #14, 12, 10, & 8 as outputs and I/O lines #15, 13, 11, & 9 as inputs; the second byte define I/O lines #6, & 0 as outputs and I/O lines #7, 5, 4, 3, 2, & 1 as inputs.
485SDD16-1005 Manual 13
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
14 485SDD16-1005 Manual
B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Loading...
+ 19 hidden pages