B&B Electronics RS-485 manual Set Module Address, Command$ = !0SO + CHR$states, Addr =

Page 29

b)Set Appropriate Outputs LOW states = states AND (NOT(mask))

By “ANDing” the current states with the complement of the appropriate mask of a digital output (given in Table 5.1), the output’s data bit will be set to a “0” (which will be set LOW).

c)Construct the string

Command$ = “!0SO” + CHR$(states)

2)Transmitting the command string:

Print #1, Command$;

Example 5.3 - Set Digital Output #0 HIGH and Digital Output #2 LOW of the module with and address of 5.

addr = 5

Set bit 0 of states to make Digital Output #0 HIGH states = states OR 1

Clear bit 2 of states to make Digital Output #2 LOW states = states AND (NOT(4))

Command$ = “!” + CHR$(addr) + “SO” + CHR$(states)

Print #1, Command$;

Digital Output #0 will be set HIGH. Digital Output #2 will be set LOW. Digital Output #1 will not change. Note that the variable states is assumed to be value from Example 5.2.

Set Module Address

The Set Module Address command is used to change the address of a 485SDA10. This command requires a data byte. The data byte is used to specify the new address of the unit. The address of a module is stored in non-volatile memory.

The steps to setting a module address are given below:

1)Constructing the command string:

Command$ = “!” + CHR$(addr) + “SO” + CHR$(newaddr)

Where {addr} is the current address of the module and {new address} is a byte representing the new address.

2)Transmitting the command string:

Print #1, Command$

485SDA103798 Manual

25

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

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

Image 29 Contents
Internet Electronics Mfg. Co. IncDesigned and Manufactured Ottawa, Illinois 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-10Typical Connections Ref InputAnalog Ground 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 CommandsEquivalent Values Reading A/D Channels CommandSyntax Read A/D Response AddrRA#Ch#MSBch#LSBch#-1MSB...ch0MSBch0LSB 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 ValuesRead Module Configuration Command Set Power-up States CommandSet Turn-around Delay Command Addressstatesdelay Reference Inputs Sampling RateInput Range Converting Data Data RangePage Command$ = ! + CHR$addr + RA + CHR$channel Read A/D CommandPrint #1, Command$ MSB$ = INPUT$1, #1 LSB$ = INPUT$1, #1Reply$ = INPUT$ 1, #1 Read Digital I/O CommandCommand$ = ! + CHR$addr + RD 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 Comp = not x and &HFF #addrRA00FF00FF01FE 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