B&B Electronics RS-485 manual Set Turn-around Delay, Command$ = ! + CHR$addr + SC + CHR$delay

Page 31

Clear bit 2 of states to make digital output 2 LOW states = states AND (NOT(4))

Command$ = “!” + CHR$(addr) + “SS” + CHR$(states) Print #1, Command$

At power-up digital output 0 will be HIGH, digital output 1 will be HIGH, and digital output 2 will be LOW.

Set Turn-around Delay

The Set Turn-around Delay command sets the amount of time the 485SDA10 waits to respond after executing a command. This delay is necessary when two RS-485 transmitters are sharing a pair of wires to ensure that two transmitters are not enabled at the same time. Refer to B&B Electronics’ free RS-422/RS-485 Application Note for more information on RS-422/485. The turn-around delay is stored in non-volatile memory. This command requires a data byte. The data byte is used to specify the turn-around delay. One unit of turn-around delay is equal to the transmission time of one character. This transmission time can be computed as follows:

time = (1 / baud rate) * 10

The steps to setting a module’s turn-around delay are given below:

1)Constructing the command string:

Command$ = “!” + CHR$(addr) + “SC” + CHR$(delay)

Where addr is the module’s address and delay is the turn- around delay. Refer to Chapter 3 for more information on turn-around delay.

2)Transmitting the command string:

Print #1, Command$

Example 5.6 – Set the turn-around delay on the module with address 5 to 100 character transmission times.

addr = 5 delay = 100

Command$ = “!” + CHR$(addr) + “SC” + CHR$(delay) Print #1, Command$

The module at address 5 will now have a turn-around delay of 100 character transmission times.

485SDA103798 Manual

27

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

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

Image 31 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