B&B Electronics 485SDD16 #addrRD, Msb~ I/O msbI/O lsb ~ I/O lsb, 00FF01FE, Comp = not x and &HFF

Page 27

APPENDIX D

Adding Data Field Comfirmation

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 485SDD16 receives a error in one or more of the first four command characters (“!0xx”), the unit will not execute the command. However, if the 485SDD16 receives an 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 485SDD16 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 D-1. With these commands every data byte that is transmitted or received is followed by its complement. For example: To read I/O lines:

Command syntax:

#{addr}RD

Response syntax:

{I/O msb}{~ I/O msb}{I/O lsb} {~ I/O lsb}

Where “~” is used to indicate the “complement of.” If I/O 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

485SDD16-1005 Manual

Appendix D

D-1

D-2

Appendix D

485SDD16-1005 Manual

B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350

B&B Electronics -- 707 Dayton Road -- Ottawa, IL 61350

PH (815) 433-5100 -- FAX (815) 433-5104

PH (815) 433-5100 -- FAX (815) 433-5104

Image 27
Contents Sales@bb-elec.com Support@bb-elec.com Electronics Mfg. Co. IncDesigned and Manufactured Ottawa, Illinois InternetTable of Contents 485SDD16 Features 485SDD16 SpecificationsIntroduction Power Supply CommunicationsSize Serial Port Connections ConnectionsDigital I/O Connections 485SDD16 I/O Port PinoutExample of Multi-Node Network Syntax Commands485SDD16 Commands Equivalent ValuesRead I/O Lines Command Set Output Lines CommandBit Assignments for I/O Lines Command AddrSC Argument Set Module Address CommandSet Turn-around Delay Command Define I/O Lines CommandCommand AddrRC Argument None Response Set Power-up States CommandRead Configuration Command Read Configuration command returns the modules I/ODigital Inputs InterfacingDigital Outputs Isolated Solid State InputSoftware Programming TechniquesDigital I/O Mask Values MSstates = MSstates or mask LSstates = LSstates or mask Set Output States CommandMSdefs = MSdefs and mask LSdefs = LSdefs and mask MSpups = MSpups and mask LSpups = LSpups and maskMaddr = Define I/O Lines CommandSet Power-up States Command Cmnd$ = ! + CHR$Maddr + SO + CHR$MSstates + CHR$LSstatesLSpups = LSpups or &H20 Set Module Address CommandMSpups = MSpups and NOTmask LSpups = LSpups and NOTmask Cmnd$ = ! + CHR$Maddr + SS + CHR$MSpups + CHR$LSpupsRunning Demonstration Program Demonstration Program485SDD16-1005 Manual Appendix a Decimal485SDD16-1005 Manual Appendix a 119 120 121 122 123 124 125 126 127485SDD16-1005 Manual Appendix B Appendix B240 4th Hex digit Decimal equals 10FC hexadecimal Decimal to Hexadecimal Conversion252 3rd Hex digitAppendix C Table C.1 DTB25 Connections Table C.2 DBM16 I/O ConnectionsDBM16 Interfacing 485SDD16-1005 Manual Appendix C Figure C.4 Solid State InputConnections Size DBM16 Specifications LinesPower Supply Input Voltage TotalFigure C.10 DBM16 Schematic Comp = not x and &HFF #addrRDMsb~ I/O msbI/O lsb ~ I/O lsb 00FF01FE485SDD16-1005 Manual Appendix D Table D-1 Extended Commands