B&B Electronics 232DRIO User Manual

RS-232 Digital Relay I/O
Documentation Number 232DRIO1005
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 – January 2008
pn#4520-r2
This product
In Ottawa, Illinois
USA
Internet:
sales@bb-elec.com
232DRIO-0308 Manual Cover Page
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Table of Contents
Chapter 1- Introduction ........................................... 3
232DRIO Features .................................................. 3
Packing List ............................................................. 2
232DRIO Specifications...........................................
Opto-Isolated Input ................................................................ 3
Relay Outputs ....................................................................... 3
Power Supply ........................................................................ 3
Communications ................................................................... 3
Environment .......................................................................... 3
Size ....................................................................................... 3
Chapter 2 - Connections ......................................... 5
I/O Connections ............................................ ………5
Opto-isolated Input ................................................................ 5
Relay Outputs ....................................................................... 5
Ground .................................................................................. 5
Serial Port Connections ........................................... 6
Power Supply Connections ...................................... 7
Chapter 3 - Commands ........................................... 9
Syntax ................................................................... 10
I/O Data Bytes ..................................................................... 11
Read I/O Lines Command ..................................... 13
Set Output Lines Command .................................. 13
3
Chapter 4 - I/O Interfacing ..................................... 15
Opto-isolated Input ................................................ 15
Relay Outputs ........................................................ 17
Chapter 5 - Software .............................................. 19
Programming Techniques ...................................... 19
Opening a COM Port........................................................... 19
Closing a COM Port ............................................................ 19
QuickBasic .......................................................................... 20
Read I/O States Command ................................................. 20
Set Output States Command .............................................. 20
C/C++ .................................................................................. 21
Read I/O States Command ................................................. 21
Set Output States Command .............................................. 21
232DRIO-0308 Manual Table of Contents i
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Demonstration Program ........................................ 22
Hard Drive Installation ......................................................... 22
Running Demonstration Program ....................................... 22
APPENDIX A .......................................................... A-1
ASCII Character Codes ........................................ A-1
APPENDIX B .......................................................... B-1
Hexadecimal/Decimal Conversions ...................... B-1
ii Table of Contents 232DRIO-0308 Manual
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Chapter 1- Introduction
232DRIO Features
The 232DRIO is a general purpose data acquistion controller that is connected to your computer’s RS-232 serial port. The 232DRIO offers 1 opto-isolated input and 2 relay outputs. With these features, the controller can be used to sense external ON/OFF conditions and to control a variety of devices. The relay outputs are CMOS/TTL compatible. The optically isolated AC/DC input are also CMOS/TTL compatible. For maximum flexibility, both input and outputs are connected with internal screw type terminal blocks. Three LEDs are provided to monitor the status of each of these. The 232DRIO connects to your computer’s RS-232 serial port through a DB-9F connector. The unit communicates at a baud rate of 9600, 8 data bits, no parity, and 1 stop bit. This unit can not be powered through the handshake lines because of the higher current requirement to drive the relays. However, the unit may be powered by an external +12Vdc source brought in through the power pin, pin #9 of the serial port. If the 232DRIO cannot be powered using the previous method, it may be powered with +12Vdc @ 100mA through the supplied terminal blocks. Power supply is available.
232DRIO-0308 Manual 3
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Figure 1.1 – 232DRIO Module
Serial Port DB-9S
TD
RD
5-30 Vdc/Vac
Input
RS-232
Transceiver
+5V
R
Opto Isolator
POWER
SPDT
RELAY
Microcontroller
SPDT
RELAY
GND +12Vdc
#2 N/O #2 N/C
#2 Com
#1 N/O
#1 N/C #1 Com
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. 232DRIO unit
2. Software
3. This instruction manual If any of these items are damaged or missing contact B&B Electronics immediately.
232DRIO Specifications
Non-polarized, Optically Isolated Input
4 232DRIO-0308 Manual
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Number of Channels: 1 Indication Mode Logic “0”: LED on, digital voltage input high Logic “1”: LED off, digital voltage input low Input Electrical Characteristic Voltage input low: <1.5 VAC/VDC Voltage input high: 5-30 VAC/VDC @ 1mA to 30mA Isolation Voltage: 2500 V Leakage Current: 10 µA max.
Relay Outputs
Number of Channels: 2 electromechanical relays Factory Default: Both relays de-energized
Indication Mode Logic “0”: LED off, Relays de-energized Logic “1”: LED on, Relays energized Relay Ratings Contact (standard): 10A @ 120VAC
8A @ 30VDC (resistive) Max. switching capacity: 1200VA/240W Max. operating voltage: 250VAC/125VDC
Max. carrying current: 10A (AC), 8A (DC) – standard
Min. permissible load: 100 mA @ 5 VDC Relay Form: Form C, single-pole double-throw (SPDT) Output Terminals: Normally open (N/O) or Normally close (N/C) Relay Life (mech.): 10 million operations min. Relay Life (load dependent): 100 thousand operations min. Operating Time: 10 msec. max. (mean: ~5.1ms)
Power Supply Input Voltage: 9-16 VDC
Input Current: 100 mA Connections: Blue terminal block field wiring Pin #9 (Power pin) of DB9F
Communications Standard: RS-232 (unit is DCE)
Baud Rate: 9600 Format: 8 data bits, 1 stop bit, no parity
Environment Operating Temperature: 0°-70°C
Operating Humidity: 0-95%, non-condensing
Storage Temperature: -20°-70°C Size 4.60”L x 2.40"W x 1.32"H
232DRIO-0308 Manual 5
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Chapter 2 - Connections
Do not make any connections to the 232DRIO until you have read this chapter. Remember to power down the unit and any
other connected devices before making any kinds of connections. Also be sure that the wires connected to the terminal blocks will support the voltage and current requirements of your external devices.
This chapter will cover the connections for the 232DRIO. There are four sets of connections: opto-isolated input (optional), relay outputs, serial port, and power supply.
I/O Connections
Connections to the I/O lines are made through the internal block terminals. These should clearly be labeled on the board. Refer to Table 2.1. See Chapter 5 for I/O interfacing examples.
Opto-isolated Input (black terminal blocks)
The non-polarized, opto-isolated input line is CMOS/TTL compatible and can handle voltages from 0Vdc/Vac to +30Vdc/Vac. Refer to the Specification for a complete detail.
Relay Outputs (blue terminal blocks)
The relay output lines have a maximum operating voltage of +250Vac/+125Vdc and are CMOS/TTL compatible. Refer to the Specification for a complete detail. Both relays are de-energized
at factory default settings. Ground
Connect the ground correspondingly as marked. Do not interchange the grounds for input and power. Otherwise, the input will not be optically isolated. The input is non-polarized so the input ground could be connected to either one of the black terminal while the power ground must be connected as marked on the blue terminal.
6 232DRIO-0308 Manual
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Table 2.1 - 232DRIO Terminal Blocks
Blue Pin # Function
1 - Ground Input Power 1 Opto-Isolated Input 2 +12Vdc Input Power 2 Opto-Isolated Input 3 #2 N/C-Normally Closed Non-polarized 4 #2 N/O-Normally Opened 0-30 Vdc/Vac 5 #2 C-Common 6 #1 C-Common 7 #1 N/C-Normally Closed 8 #1 N/O-Normally Opened
Black Pin #
Function
Serial Port Connections
In order to communicate to the 232DRIO module it must be connected to an RS-232 serial port. The unit is designed for a baud rate of 9600, so the serial port must be set for this rate. A data format of 8 data bits, 1 stop bit and no parity is used. is configured as a DCE device (See Table 2.2). If your communications equipment is configured as a DTE device, such as a standard IBM PC serial port, the 232DRIO should be connected using a “straight through” DB-25 cable or a standard DB-9 to DB-25 cable adapter as shown in Table 2.3. If your communications equipment is configured as a DCE device, such as a modem, the 232DRIO should be connected using a “null modem” cable (see Table 2.4).
The 232DRIO
Table 2.2 – RS232 Connector Pinout
DB-9S Pin #
2 Receive Data (RD) Output Required 3 Transmit Data (TD) Input Required 5 Signal Ground (SG) ------ Required 9 Power pin Input Can be wired to
Signal
Signal Direction at 232DRIO
Notes
power unit
232DRIO-0308 Manual 7
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Loading...
+ 19 hidden pages