B&B Electronics RS-485 manual Reading Digital I/O Command, AddrRD, States

Page 19

Reading Digital I/O Command

The Read Digital I/O command returns a byte which represents the states of the 3 digital input and 3 digital output states. Bits 3-5 correspond to the states of digital inputs 0-2. Bits 0-2 correspond to the states of digital outputs 0-2. If a bit is a 0 then the digital state of that digital I/O is LOW. If a bit is a 1 then the digital state of the I/O is HIGH. Refer to Table 3.4 and 3.5.

Command Syntax

!{addr}RD

Unit Response

{states}

Where {states} is a byte in which Bits 0-2 corresponds to the current states of Digital Outputs 0-2 and Bits 3-5 corresponds to the current states of Digital Inputs 0-2.

Table 3.4 - Read Digital I/O Response for Outputs

 

 

Response Byte

 

 

 

Digital Outputs

 

 

 

Bit 2

 

Bit 1

 

Bit 0

 

#2

 

#1

 

#0

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

0

 

0

 

LOW

 

LOW

 

LOW

 

 

0

 

0

 

1

 

LOW

 

LOW

 

HIGH

 

 

0

 

1

 

0

 

LOW

 

HIGH

 

LOW

 

 

0

 

1

 

1

 

LOW

 

HIGH

 

HIGH

 

 

1

 

0

 

0

 

HIGH

 

LOW

 

LOW

 

 

1

 

0

 

1

 

HIGH

 

LOW

 

HIGH

 

 

1

 

1

 

0

 

HIGH

 

HIGH

 

LOW

 

 

1

 

1

 

1

 

HIGH

 

HIGH

 

HIGH

 

 

 

Table 3.5 - Read Digital I/O Response for Inputs

 

 

Response Byte

 

 

 

Digital Inputs

 

 

 

Bit 5

 

Bit 4

 

Bit 3

 

#2

 

#1

 

#0

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

0

 

0

 

LOW

 

LOW

 

LOW

 

 

0

 

0

 

1

 

LOW

 

LOW

 

HIGH

 

 

0

 

1

 

0

 

LOW

 

HIGH

 

LOW

 

 

0

 

1

 

1

 

LOW

 

HIGH

 

HIGH

 

 

1

 

0

 

0

 

HIGH

 

LOW

 

LOW

 

 

1

 

0

 

1

 

HIGH

 

LOW

 

HIGH

 

 

1

 

1

 

0

 

HIGH

 

HIGH

 

LOW

 

 

1

 

1

 

1

 

HIGH

 

HIGH

 

HIGH

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

485SDA103798 Manual

 

 

 

 

 

 

15

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

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

Image 19 Contents
Designed and Manufactured Ottawa, Illinois Electronics Mfg. Co. IncInternet Table of Contents Tables Software485SDA103798 Manual Table of Contents Iii 485SDA10 Unit 485SDA10 FeaturesPacking List Software InstallationWindows 9x and Windows NT UninstallGetting Started WindowsA/D with Variable Resistor 485SDA10 Specifications Ref Input + Inputs #0-10Analog Ground Ref InputTypical Connections Digital Outputs #0-2 Digital I/O Connections485SDA10 I/O Port Pinout Digital Inputs #0-2Typical Digital I/O Connections Digital GroundRS-485 Terminal Block Connections Serial Port ConnectionsTypical RS-485 2-wire Connection Power Supply Connections485SDA10 Commands CommandsSyntax Reading A/D Channels CommandEquivalent Values Ch#MSBch#LSBch#-1MSB...ch0MSBch0LSB AddrRA#Read A/D Response Read Digital I/O Response for Outputs Reading Digital I/O CommandAddrRD StatesSet Digital Output Data Byte Values Set Digital Output CommandSet Module Address Command AddrSOstatesSet Turn-around Delay Command Set Power-up States CommandRead Module Configuration Command Addressstatesdelay Input Range Sampling RateReference Inputs Converting Data Data RangePage MSB$ = INPUT$1, #1 LSB$ = INPUT$1, #1 Read A/D CommandCommand$ = ! + CHR$addr + RA + CHR$channel Print #1, Command$Command$ = ! + CHR$addr + RD Read Digital I/O CommandReply$ = INPUT$ 1, #1 Digital I/O Mask Values Set Digital Output StatesAddr = Command$ = !0SO + CHR$statesCommand$ = ! + CHR$addr + SO + CHR$newaddr Set Module AddressAddr = 5 states = States = states and NOTmaskCommand$ = ! + CHR$addr + SC + CHR$delay Set Turn-around DelayRead Module Configuration 00FF01FE #addrRA00FFComp = 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