B&b electronics rs-485 digital i/o module user manual (28 pages)
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...
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.
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.
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:...
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.
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.
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.
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.
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.
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.
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.
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...
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...
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.
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.
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.
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++.
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...
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.