B&B Electronics RS-232 Digital Relay I/O 232DRIO User Manual

B&b electronics rs-232 digital relay i/o user manual

Advertisement

Quick Links

RS-232 Digital Relay I/O
Model 232DRIO
Documentation Number 232DRIO1005
pn#4520-r2
This product
Designed and Manufactured
In Ottawa, Illinois
USA
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
Internet:
http://www.bb-elec.com
sales@bb-elec.com
support@bb.elec.com
© B&B Electronics – January 2008
232DRIO-0308 Manual
Cover Page
B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104

Advertisement

Table of Contents
loading

Summary of Contents for B&B Electronics RS-232 Digital Relay I/O 232DRIO

  • Page 1 RS-232 Digital Relay I/O Model 232DRIO Documentation Number 232DRIO1005 pn#4520-r2 This product Designed and Manufactured In Ottawa, Illinois 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 Internet: http://www.bb-elec.com...
  • Page 3: Table Of Contents

    Table of Contents Chapter 1- Introduction ... 3 232DRIO Features ... Packing List ... 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 ...
  • Page 4 Hard Drive Installation ... 22 Running Demonstration Program ... 22 APPENDIX A ... A-1 ASCII Character Codes ... APPENDIX B ... B-1 Hexadecimal/Decimal Conversions ... Table of Contents B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350 PH (815) 433-5100 -- FAX (815) 433-5104 232DRIO-0308 Manual...
  • Page 5: Chapter 1- Introduction

    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.
  • Page 6: Packing List

    Figure 1.1 – 232DRIO Module Serial Port RS-232 DB-9S Transceiver Microcontroller 5-30 Vdc/Vac Input Opto Isolator 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.
  • Page 7: Relay Outputs

    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 10 µA max. Leakage Current: Relay Outputs Number of Channels:...
  • Page 8: Chapter 2 - Connections

    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.
  • Page 9: Serial Port Connections

    Table 2.1 - 232DRIO Terminal Blocks Blue Pin # Function - Ground Input Power +12Vdc Input Power #2 N/C-Normally Closed #2 N/O-Normally Opened #2 C-Common #1 C-Common #1 N/C-Normally Closed #1 N/O-Normally Opened Serial Port Connections In order to communicate to the 232DRIO module it must be connected to an RS-232 serial port.
  • Page 10: Power Supply Connections

    232DRIO Pin # Signal Receive Data (RD) Transmit Data (TD) Signal Ground (SG) Ring Indicator Table 2.4 – 232DRIO To DCE Connections 232DRIO Pin # Signal Receive Data (RD) Transmit Data (TD) Signal Ground (SG) Ring Indicator Power Supply Connections The power requirement is 12VDC at 100mA.
  • Page 11: Chapter 3 - Commands

    232DRIO: set output lines and read I/O lines. For normal environments, command strings are from three to four bytes in length; the “!” character, the “0” (zero) character, one command character, and one data byte (if required). With serial communications in a laboratory environment, the possibility of a communication error occurring is minimal.
  • Page 12: Syntax

    Table 3.1 – 232DRIO Commands Function Command Set Output Lines !0S{…} Read I/O Lines Set Output Lines #0S{…}{~…} Read I/O Lines Symbol: {…} represents one byte <…> represents a numeric value complement of the specified data byte Before going into the specifics of each command, it is important to understand that a byte has a numeric value from 0 to 255.
  • Page 13: I/O Data Bytes

    controller,either the “R” or “S” character. The set output command requires one argument field (for normal environments) or two argument fields (data and its complement for harsh environments). This field contains the fourth and/or fifth data byte. Command Syntax: ! or # Address Byte Start of Message Byte I/O Data Bytes...
  • Page 14 Example 3.1 Set Output Lines Data Byte Binary Decimal Hex Relay #2 XXXXXX00 de-energized XXXXXX01 de-energized XXXXXX10 energized XXXXXX11 energized Symbol: X don’t cares (default setting should all be “0”) To energize the relays, the corresponding bit of the data byte must be set high.
  • Page 15: Read I/O Lines Command

    The Read I/O Lines command returns one data byte (with the “!”) and two data bytes (data and its complement with the “#”) that reflects the state of the I/O lines. Bit 2 is Input #1, Bit 1 is Relay #2, and finally Bit 0 corresponds to Relay #1.
  • Page 16: Chapter 4 - I/O Interfacing

    Command: !0S Argument: {…} (shown in bold face) Response: none ASCII Example: !0S<ETX> Dec. Example: !0S<3> Hex. Example: !0S<03> Bin. Example: !0S<00000011> Description: Relay #2 is energized (“1”), and Relay #1 is energized (“1”). Command: #0S Argument: {…}{~…} (shown in bold face) Response: none ASCII Example: #0S<ETX><n>...
  • Page 17: Opto-Isolated Input

    some general examples of how to interface to the I/O lines. Caution must be taken not to exceed 232DRIO specifications listed in Chapter 1 when interfacing to external devices. Failure to stay within these specifications could result in damage to the unit and will void warranty.
  • Page 18 Figures 4.2 - 4.4 show examples of some typical input interfaces. 232DRIO EXTERNAL CIRCUIT Opto Isolated Input 5-30 Vdc/Vac Figure 4.2 - Switch Input 232DRIO EXTERNAL CIRCUIT Opto Isolated Input 5-30 Vdc/Vac Figure 4.3 - Solid State Input 232DRIO-0308 Manual B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350 PH (815) 433-5100 -- FAX (815) 433-5104...
  • Page 19: Relay Outputs

    232DRIO Opto Isolated Input 5-30 Vdc/Vac Figure 4.4 - Isolated Mechanical Input Relay Outputs Relay outputs are used to turn external devices on or off. Relay outputs are CMOS/TTL compatible and can also operate between 0- 24Vdc and 0-115Vac. Outputs can be used to control solid state output modules, CMOS and TTL logic circuits.
  • Page 20 Figures 4.5 - 4.6 show examples of some typical output interfaces. EXTERNAL CIRCUIT 232DRIO +12 Vdc +5 Vdc 0-30 Vdc @ 8A max. 0-120 Vac @ 10A max. Common Figure 4.5 – Isolated Connection to External Circuit EXTERNAL CIRCUIT 232DRIO +12 Vdc Common Common...
  • Page 21: Chapter 5 - Software

    Chapter 5 - Software This chapter will be divided into two sections. The first section covers programming techniques for opening/closing a com port, receiving data, and manipulating data in QuickBasic and C/C++. The second section discusses how to install and run the demonstration program on an IBM PC or compatible.
  • Page 22: Quickbasic

    QuickBasic (DEMO232.EXE and DEMO232.BAS) This section shows steps and examples of programming the 232DRIO in QuickBasic. If you are programming in another language, this section can be helpful as a guideline for programming the 232DRIO. Using the 232DRIO.LIB with QuickBasic: Using this library will make it easier to program the 232DRIO module and allows greater flexibility in choosing serial ports.
  • Page 23: C/C

    C/C++ (DEMO232.EXE and DEMO232.CPP) DEMO232.CPP is a demonstration program for use with B&B Electronics model 232DRIO module. Much of the work associated with using COM ports in C/C++ has been made easier by including the 232DRIO.LIB with this program. Including “232DRIO.H” in the pre-processor directive and compiling your .cpp file as a project along with the 232DRIO.LIB file will enable you to use the following functions in your program.
  • Page 24: Hard Drive Installation

    Demonstration Program The Demonstration Programs (IBM PC or Compatible) provide the user with examples of how to receive and transmit commands to the 232DRIO. The DEMO232.EXE is the executable program and the DEMO232.BAS file is the source code in QuickBasic. The DEMO232.EXE is the executable program and the DEMO232.CPP file is the source code in C/C++.
  • Page 25: Appendix A

    APPENDIX A ASCII Character Codes 232DRIO-0308 Manual Appendix A B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350 PH (815) 433-5100 -- FAX (815) 433-5104...
  • Page 26 DECIMAL to HEX to ASCII CONVERSION TABLE DEC HEX ASCII KEY DEC HEX ASCII DEC HEX ASCII DEC HEX ASCII ctrl @ ctrl A ctrl B “ ctrl C ctrl D ctrl E ctrl F & ctrl G ctrl H ctrl I ctrl J ctrl K...
  • Page 27: Appendix B

    APPENDIX B Hexadecimal/Decimal Conversions The decimal (base 10) numbering system represents each position in successive powers of 10, with each decimal symbol having a value from 0 to 9. The hexadecimal (base 16) numbering system represents each position in successive powers of 16 with each hex symbol having a value of 0 to 15.
  • Page 28 Decimal = (1st Hex digit x 4096) + (2nd Hex digit x 256) + (3rd Hex digit x 16) + (4th Hex digit) Each "Hex digit" is the decimal equivalent value of the hexadecimal symbol. Example: Convert 10FC hexadecimal to decimal. 4096 10FC hex equals 4348 decimal.

Table of Contents