B&B Electronics RS-485 manual #addrRA00FF, 00FF01FE, Comp = not x and &HFF

Page 33

Appendix A: Adding Data Field Confirmation

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 485SDA10 receives an error in one or more of the first four command characters (“!0xx”), the unit will not execute the command. However, if the 485SDA10 receives a communication error on a data byte (channel byte for Read Analog 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 485SDA10 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 A-1. With these commands every data byte that is transmitted or received is followed by its complement.

Example A.1 - To read A/D channel zero: Command syntax:

#{addr}RA{00}{FF}

Response syntax:

{ch0 msb}{~ ch0 msb}{ch0 lsb} {~ ch0 lsb} Where “~” is used to indicate the “complement of.”

If A/D channel 0 has a reading of 1, the following would be received:

{00}{FF}{01}{FE}

Where FFh is the complement of 0 and FEh is the complement of 1. The complement of number “x” can be calculated in QuickBasic as follows:

comp = (NOT x) AND &HFF

485SDA103798 Manual

Appendix A

A-1

B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350

PH (815) 433-5100 -- FAX (815) 434-7094

Image 33 Contents
Electronics Mfg. Co. Inc Designed and Manufactured Ottawa, IllinoisInternet Table of Contents Tables Software485SDA103798 Manual Table of Contents Iii 485SDA10 Unit 485SDA10 FeaturesPacking List Software InstallationGetting Started UninstallWindows Windows 9x and Windows NTA/D with Variable Resistor 485SDA10 Specifications Ref Input + Inputs #0-10Ref Input Analog GroundTypical Connections 485SDA10 I/O Port Pinout Digital I/O ConnectionsDigital Inputs #0-2 Digital Outputs #0-2Typical Digital I/O Connections Digital GroundRS-485 Terminal Block Connections Serial Port ConnectionsTypical RS-485 2-wire Connection Power Supply Connections485SDA10 Commands CommandsReading A/D Channels Command SyntaxEquivalent Values AddrRA# Ch#MSBch#LSBch#-1MSB...ch0MSBch0LSBRead A/D Response AddrRD Reading Digital I/O CommandStates Read Digital I/O Response for OutputsSet Module Address Command Set Digital Output CommandAddrSOstates Set Digital Output Data Byte ValuesSet Power-up States Command Set Turn-around Delay CommandRead Module Configuration Command Addressstatesdelay Sampling Rate Input RangeReference Inputs Converting Data Data RangePage Command$ = ! + CHR$addr + RA + CHR$channel Read A/D CommandPrint #1, Command$ MSB$ = INPUT$1, #1 LSB$ = INPUT$1, #1Read Digital I/O Command Command$ = ! + CHR$addr + RDReply$ = INPUT$ 1, #1 Digital I/O Mask Values Set Digital Output StatesCommand$ = ! + CHR$addr + SO + CHR$newaddr Command$ = !0SO + CHR$statesSet Module Address Addr =Addr = 5 states = States = states and NOTmaskCommand$ = ! + CHR$addr + SC + CHR$delay Set Turn-around DelayRead Module Configuration #addrRA00FF 00FF01FEComp = not x and &HFF Table A-1 Extended Commands Appendix B Analog Input Impedance 1 2 LSB = R s + 1k Ω × 60pF × ln2048 Simplified Analog Input Analysis485SDA103798 Manual Appendix B Table C-1 Decimal to HEX to Ascii Table Appendix C Decimal to HEX to Ascii TableClass a Equipment
Related manuals
Manual 39 pages 36.61 Kb Manual 46 pages 1.37 Kb