Home

Bard FLF085D36F Furnace User Manual

image

Contents

1. Table 2 2 RS232 Connector Pinout Signal DB 9S Direction at Pin Signal 232DRIO Notes 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 power unit 232DRIO 0308 Manual 7 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Table 2 3 232DRIO To DTE Connections 232DRIO DTE DB 25 DTE DB 9 Pin Signal Connection Connection 2 Receive Data RD 3 2 3 Transmit Data TD 2 3 5 Signal Ground SG 7 5 9 Ring Indicator 22 9 Table 2 4 232DRIO To DCE Connections 232DRIO DCE DB 25 DCE DB 9 Pin Signal Connection Connection 2 Receive Data RD 2 3 3 Transmit Data TD 3 2 5 Signal Ground SG 7 5 9 Ring Indicator 22 9 Power Supply Connections The power reguirement is 12VDC at 100mA Power to the 232DRIO can be wired through the RS 232 serial port pin 9 power pin or by an external power supply through the blue terminal blocks Serial ports can not provide enough power to supply the 232DRIO s 100 milliamp requirement Chapter 3 Commands PH 815 433 5100 FAX 815 433 5104 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 There are only two basic commands required to control the 232DRIO set output lines and read I O lines For normal
2. 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 Important Note For Borland C the compiler must be set for large memory model for your program to compile properly Access this by the pulldown menu Options Compiler Code Generation to change model size and click on ok include 232DRIO H void main put your program here Read I O States Command states bbDRIO_ReadlOLines hComDev int mode Mode is 1 if harsh environment is enabled or 0 if disabled Returns 1 if an error occurred Example 5 3 Determining the status of Relay 1 If states amp 0x01 gt True if Relay 1 is on When the line is executed states will contain a byte that can by read by ANDing states with the appropriate mask Set Output States Command bbDRIO_SetOutputLines unsigned short hComDev unsigned char states int mode Example 5 4 Various ways to energized de energized Relay 1 1 A relay can be energized by ORing states with the appropriate mask states 0x01 gt Will energized Relay 1 2 A relay can be de energized by ANDing with the complement of the mask mask states amp OxFE gt Will de energized Relay 1 3 A relay can be switched by Exclusive ORing states with the appropriate mask states 0x01 gt Will energized Relay 1 if it is de energized or vice versa 232
3. ASCII KEY DEC HEX ASCII DEC HEX r o m mjoj joj m gt c Ee SIE O v p o v o z z rx Oo z Ka vo no ojd ojoj ny oy ajA NI lt x 5 lt C 4 NI lt x 5 lt C 4 A 2 Appendix A 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 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 Since each hex position must have a single symbol the symbols A through F are assigned to values 10 through 15 respectively Refer to Table 1 The information and examples to follow will explain how to convert from a decimal number to a hexadecimal number and vice versa Table 1 Decimal Hexadecimal Value Symbol sd BF ay lt pv 232DRIO 0308 Manual Appendix B B 1 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Hexadecimal to Decimal Conversion Decimal 1st Hex digit x 4096 2nd Hex digit x 256 8rd Hex digit x 16 4th Hex digit Each Hex digit is the decimal
4. HIGH and LOW states and show 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 d Row r Ground v Power 9 16 V N WW 42 hes Close j e Jl e men 2 Relay LLED 5 80 VaclVde VB ICor tiy FT d Opto Isolated 2 ee 0 Input siivo f1 Norr mon Cont nally C i it r A Kelay do iD 1Normally Clo nt c HPA os a 4 Karmen Con 2 a ye CED v S R5232 DB9F Figure 4 1 Board Layout Opto isolated Input As stated earlier the opto isolated input line is CMOS TTL compatible and can also handle voltages from 0 to 30 Vdc or Vac The isolated input is used to sense a HIGH or a LOW state This can be accomplished via switch closures contact closures or a solid state digital signal When this input senses a voltage level 5Vdc Vac or above it will be considered LOW and its input state will be read as a 0 to the PIC microcontroller Conversely when an input senses a voltage level below 1 50Vdc Vac it will be considered HIGH and its input state will be read as a 1 to the PIC microcontroller Correspondingly the PIC will then evaluate the incoming input and declare it as a HIGH if it is a O at least 5V and as a LOW if itis a 1 less than 1 5V 232DRI
5. 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 However in a harsh or an industrial environment the possibility increases A communication error occurs when a bit transmitted as a 1 is received as a 0 or vice versa If the 232DRIO receives a error in one or more of the first three command characters 0X the unit will not execute the command However if the 232DRIO receives a communication error on a data byte I O byte for Read Digital command or state byte for Set Output State command the command will be executed since the unit has no way of knowing that there was an error To provide the 232DRIO with a way of detecting errors in the data fields an additional set of commands can be used This set of commands begins with the 23h character instead of the 21h character Refer to Table 3 1 With these commands every data byte that is transmitted or received is followed by it s complement For example to read I O lines Command syntax 0R Response syntax DATA DATA Where is used to indicate the complement of If DATA has a reading of 1 the following would be received 01 FE Where FEh is the complement of 1 The complement of nu
6. 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 amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Table 2 1 232DRIO Terminal Blocks Blue Black Pin Function 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 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 The 232DRIO 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
7. equivalent value of the hexadecimal symbol Example Convert 10FC hexadecimal to decimal 1 x 4096 4096 0 x 256 0 15 x 16 240 12 x 1 12 4348 10FC hex eguals 4348 decimal Decimal to Hexadecimal Conversion Example Convert 4348 decimal to hexadecimal 4096 4348 4096 256 252 0 0 2nd Hex digit 0 16 252 240 de 12 0 4348 decimal eguals 10FC hexadecimal 1 1 1st Hex digit 15 F 8rd Hex digit 12 C 4th Hex digit B 2 Appendix B 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104
8. 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 amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 MODEL 232DRIO B B electronics MANUFACTURING COMPANY OTTAWA IL 61350 DIGITAL RELAY 1 0 MODULE Figure 1 1 232DRIO Module S GND Serial Port POWER m DB 9S RS 232 H12Vdc Transceiver TD gt O r 2 N O sl HD a 2 N C L T 5V A 2 Com a O Microcontroller E 5 3 c Vac lt SR jr 41 N O T q G 1 N C Hie Sk 4_ Isolator ca 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 amp B Electronics immediately 232DRIO Specifications Non polarized Optically Isolated Input 4 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 43
9. 0S lt 3 gt Hex Example 0S lt 03 gt Bin Example 0S lt 00000011 gt Description Relay 2 is energized 1 and Relay 1 is energized 1 Command 0S Argument shown in bold face Response none ASCII Example 0S lt ETX gt lt n gt Dec Example 0S lt 3 gt lt 252 gt Hex Example 0S lt 03 gt lt FC gt Bin Example 0S lt 00000011 gt lt 11111100 gt Description Relay 2 is energized 1 and Relay 1 is energized 1 Note that the complement is returned immediately following the data byte NOTE If any of these lines are defined as inputs the bit settings are ignored Since Bit 2 is defined as Input 1 the bit setting is ignored Two important ideas to keep in mind when sending commands back to back or in sequence are the following 1 lf the 0R is sent one character delay must follow immediately before any other commands are sent 2 lf the 0R is sent two character delay must follow immediately before any other commands are sent For example 1 0R_ 0S1 2 0R__ 0S1 Otherwise the microcontroller will miss the second or and not interpret the second command at all since it is still trying to transmit the returned data byte s to the user Chapter 4 I O Interfacing 14 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 This chapter will explain
10. 2000 gt Tell QB to set aside memory for the 232DRIO library to use Read I O States Command states bbDRIORead OLines hComDev mode When the line is executed states will contain a byte that can be read by ANDing states with the appropriate mask Example 5 1 Determining the status of Relay 1 If states AND 0x01 gt True if relay 1 is on If states amp 0x01 Set Output States Command status bbDRIOSetOutputLines unsigned short hComDev unsigned char states int mode gt Returns a negative number on error Example 5 2 Various ways to energized de energized Relay 1 1 A relay can be energized by ORing states with the appropriate mask states states OR amp H01 gt Will energized Relay 1 2 A relay can be de energized by ANDing with the complement of the mask mask states states AND amp HFE gt Will de energized Relay 1 3 A relay can be switched by Exclusive ORing states with the appropriate mask states states XOR amp H01 gt Will energized Relay 1 if it is de energized or vice versa 20 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 C C DEMO232 EXE and DEMO232 CPP DEMO232 CPP is a demonstration program for use with B amp 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
11. 3 5100 FAX 815 433 5104 Number of Channels Indication Mode Logic 0 Logic 1 1 LED on digital voltage input high LED off digital voltage input low Input Electrical Characteristic Voltage input low Voltage input high Isolation Voltage Leakage Current Relay Outputs Number of Channels Factory Default Indication Mode Logic 0 Logic 1 Relay Ratings Contact standard Max switching capacity Max operating voltage Max carrying current Min permissible load Relay Form Output Terminals Relay Life mech Relay Life load dependent Operating Time Power Supply Input Voltage Input Current Connections Communications Standard Baud Rate Format Environment Operating Temperature Operating Humidity Storage Temperature Size lt 1 5 VAC VDC 5 30 VAC VDC O 1mA to 30mA 2500 V 10 pA max 2 electromechanical relays Both relays de energized LED off Relays de energized LED on Relays energized 10A 120VAC 8A 30VDC resistive 1200VA 240W 250VAC 125VDC 10A AC 8A DC standard 100 mA 5 VDC Form C single pole double throw SPDT Normally open N O or Normally close N C 10 million operations min 100 thousand operations min 10 msec max mean 5 1ms 9 16 VDC 100 mA Blue terminal block field wiring Pin 9 Power pin of DB9F RS 232 unit is DCE 9600 8 data bits 1 stop bit no parity 0 70 C 0 95 non con
12. DRIO 0308 Manual 21 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 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 The source codes provide an illustration of how to send and receive commands from the 232DRIO NOTE This is a demonstration program only and not intended for system applications Running Demonstration Program Before you can run the demonstration program you must run the install program in the Hard Drive Installation section If you are running Windows exit Windows to DOS To run the program follow these steps from the DOS prompt QuickBasic 1 Type CD BASIC and press the lt ENTER gt key 2 Type DEMO232 and press the lt ENTER gt key C C 1 Type CD BC and press the lt ENTER gt key 2 Type DEMO232 and press the lt ENTER gt key 22 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 APPENDIX A ASCII Character Codes 232DRIO 0308 Manual Appendix A B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 A 1 DECIMAL to HEX to ASCII CONVERSION TABLE
13. O 0308 Manual 15 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Figures 4 2 4 4 show examples of some typical input interfaces 232DRIO EXTERNAL CIRCUIT Opto Isolated Input lt 1 TK 5 30 Vdc Vac Figure 4 2 Switch Input 232DRIO EXTERNAL CIRCUIT OV Dt Opto Isolated Input e 47K 5 30 Vdc Vac lt p Z S S e p N ahs Figure 4 3 Solid State Input 16 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 232DRIO EXTERNAL CIRCUIT Opto Isolated Input 5 30 Vdc Vac A 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 Caution must be taken not to exceed the power capability of the outputs Refer to the output specifications in Chapter 1 Setting an output line to a 1 forces the output HIGH and setting an output line to a 0 forces the output LOW Both relays are de energized at factory default settings NOTE The relay circuits are not UL approved for 120 Vac 10A or 30 Vdc 8A resistive maximum line service in regards to contact ratings However the printed circuit traces were followed using UL standards UL 1950 for minimum width a
14. RS 232 Digital Relay I O Model 232DRIO Documentation Number 232DRIO1005 This product Designed and Manufactured In Ottawa Illinois USA of domestic and imported parts by B amp 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 amp B Electronics January 2008 232DRIO 0308 Manual Cover Page B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Table of Contents Chapter 1 INtrOCUCHION 2 00cccsscceeeeeeeteeeeeeeeeeeeeeeeeees 3 SECHER eege EE Ek Packing List ted breton beet 232DRIO Specifications Opto Isolated Input Relay Outputs sive witli sakasa d j Power Supp i uenit anas K eee Bei ul ul et Environnient ege Mech ae ee ed Ee SIZE a utis alas a sd EE Chapter 2 Connections as 5 HO GOMMECTONS sens Opto isolated Input Relay Output i aaa Ee ue WEE Serial Port CONNECTIONS cc eeeeeeeeeceeeeeeeeeaeeeeeees Power Supply Conpechons Chapter 3 Commandes as SVS ds s tai da ii ais da 10 ebe NEE 11 Read I O Lines Commande 13 Set Output Lines Command 13 Chapter 4 VO Interfacing 15 Opto isolated Input 15 Relay QUtPUtS ee 17 Chapter 5 Software as 19 Programming Techntoues A 19 Opening a COM Port 19 Closing a COM Port 19 OC Eeer as s a Ke sealer aden 20
15. Read I O States Commande 20 Set Output States Commande 20 SEENEN la digital seth A dE 21 Read I O States Commande 21 Set Output States Commande 21 232DRIO 0308 Manual Table of Contents B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Demonstration Program ssssssssessssssserrenressseerrrne 22 Hard Drive Installaton 22 Running Demonstration Program aa 22 APPENDIX er EEN A 1 ASCII Character Codes Abee A 1 APPENDIX B cccssscccssseecnseeecnsseeesseeenseesenseesenees B 1 Hexadecimal Decimal Conversions ssccereeeces B 1 B amp 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
16. densing 20 70 C 4 60 L x 2 40 W x 1 32 H 232DRIO 0308 Manual B amp 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 OVdc 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
17. ecimal Hexadecimal 33 21h 35 23h 0 48 30h R 82 52h S 83 53h Syntax Command strings consists of three to five bytes depending on commands used for normal or harsh environments The first byte is always the start of message byte The start of message byte is either the ASCII character normal or the ASCII character harsh The second byte is the address byte This byte allows each unit to have a unique address useful in RS 485 networks Since the 232DRIO uses RS 232 communications this byte is always the ASCII 0 character and can not be changed The next byte is the command character This byte is ASCII character and 10 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 used to specify which command will be executed by the 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 0 Data Byte Data Byte 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 byte The three I O lines are represented b
18. es Mask Values I O Line Decimal Relay 1 1 Relay 2 2 Input_ 1 4 16 32 128 Symbol X Don t cares default setting should all be o Relay 1 Relay 2 input Programming Technigues 232DRIO LIB Opening a COM Port HComDev initComPort unsigned short addr unsigned char irq unsigned long baud unsigned short Portlndex The last parameter Portlndex will always be 0 for programming the 232DRIO module InitComPort gt Returns 0 on error For example the code to open COM port 1 and setting the baud rate to 9600 would be HComDev initComPort 0x03F8 4 9600 0 Closing a COM Port DeinitComPort hComDev gt No return value 232DRIO 0308 Manual 19 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 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 At the DOS prompt start QuickBasic with the 232DRIO Quick Library by typing QB program bas L 232DRIO QLB This allows you to call the 232DRIO functions from the QuickBasic editor SINCLUDE 232DRIO BI gt Include the function definitions mem SETMEM
19. mber x can be calculated in QuickBasic as follows comp NOT x AND amp HFF 232DRIO 0308 Manual 9 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Table 3 1 232DRIO Commands Function Command Response Set Output Lines lOS No response Read I O Lines IOR Set Output Lines 0S No response Read I O Lines KOR Symbol represents one byte lt gt 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 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 OR 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 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 an additional data byte to complete the command These data bytes may be represented in any of the formats listed above Refer to Appendix A for more ASCII and decimal equivalents Table 3 2 Equivalent Values ASCII D
20. nd separation For the previous reason and safety concerns we recommend a maximum continuous rating of 8 amperes In conclusion the voltage should still comply with the rated relay contact voltage of 120 Vac 30 Vdc max but recommended 8A or lower It is the customer s responsibility to determine the ultimate safety and acceptability of our products Failure to stay within these specifications could result in damage to the unit and will void warranty 232DRIO 0308 Manual 17 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Figures 4 5 4 6 show examples of some typical output interfaces 232DRIO EXTERNAL CIRCUIT oe we 5 Vdc bo Leen S g lt ii Mo S S P Se 1K C Common be S E Figure 4 5 Isolated Connection to External Circuit 232DRIO EXTERNAL CIRCUIT s C 32 o No S ee ze Common i I Common 0 30 Vdc 8A max 0 120 Vac 10A max Figure 4 6 Isolated Connection to External Devices 18 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 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 Table 5 1 Digital I O Mask Valu
21. relay 1 and 2 Example 3 2 Read I O Lines Data Byte Returned Status Binary Dec Hex ASCII Input 1 Relay 2 Relay 1 00000000 0 00 NUL low de energ de energ 00000001 1 01 SOH low de energ energ 00000010 2 02 STX low energ de energ 00000011 3 03 ETX low energ energ 00000100 4 04 EOT high de energ de energ 00000101 5 05 ENQ high de energ energ 00000110 6 06 ACK high energ de energ 00000111 7 07 BEL high energ energ Notice that the returned data byte starts at address 00000000 in binary 0 in dec 0 in hex or NUL in ASCII From left to right msb to Isb the first five bits are really XXXXX don t cares but are defaulted as 00000 The remaining three bits represent input 1 relay 2 and relay 1 respectively A 1 or a HIGH represents relay energized input present and a 0 or a LOW represents relay de energized input absent 12 232DRIO 0308 Manual B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 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 If a bit is a O 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 0R Argument none Response the state of input and 2
22. relays shown in bold face ASCII Example OR lt NUL gt Dec Example OR lt 0 gt Hex Example OR lt 0 gt Bin Example 0R lt 00000000 gt Description This indicates that the input and both relays are 0 s or LOW Command 0R Argument none Response data and its complement state of the input and 2 relays shown in bold face ASCII Example 40R lt NUL gt lt blank FF gt Dec Example 0R lt 0 gt lt 255 gt Hex Example 0R lt 00 gt lt FF gt Bin Example 0R lt 00000000 gt lt 11111111 gt Description This indicates that the input and both relays are O s or LOW Note that the complement is returned immediately following the data byte Set Output Lines Command The Set Output Lines command is used to set the states of the relay outputs This command requires one data byte in normal environment with or two data bytes in harsh environment with data and its complement This data byte specifies the output state of each relay output Bit 1 is Relay 2 and Bit O is Relay 1 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 232DRIO 0308 Manual 13 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Command 0S Argument shown in bold face Response none ASCII Example OS lt ETX gt Dec Example
23. y one data byte 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 Input gt 18 l R R Relay gt R X X X X X 41 42 1 Bit Position 7 6 5 4 3 2 1 0 Hex Weight 80 40 20 10 8 4 2 1 Decimal 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 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 232DRIO 0308 Manual 11 B amp B Electronics PO Box 1040 Ottawa IL 61350 PH 815 433 5100 FAX 815 433 5104 Example 3 1 Set Output Lines Data Byte Relays Binary Decimal Hex Relay 2 Relay 1 XXXXXX00 0 0 de energized de energized XXXXXX01 1 1 de energized energized XXXXXX10 2 2 energized de energized XXXXXX11 3 3 energized 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 Conversely to de energize the relays the corresponding bit of the data byte must be set low 00000011 3 in decimal 3 in hex energized both

Download Pdf Manuals

image

Related Search

Related Contents

MANUEL D`UTILISATION  Ateca VARIATION00376 flat panel floorstand  Manual do Utilizador ()  「カセットこんろのテスト結果」について      取扱説明書 - エー・アンド・デイ  USER MANUAL  New Buck Corporation Heater Model 80 User's Manual    

Copyright © All rights reserved.
Failed to retrieve file