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

Page 26

Appendix D

Adding Data Field Confirmation

232SDD16-1005 Manual

Appendix D

D-1

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 232SDD16 receives a error in one or more of the first four command characters (“!0xx”), the unit will not execute the command. However, if the 232SDD16 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 232SDD16 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 it’s complement. For example: To read I/O lines:

Command syntax:

#0RD

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

D-2

Appendix D

232SDD16-1005 Manual

B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350

B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350

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

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

Image 26
Contents Internet Electronics Mfg. Co. IncDesigned and Manufactured Ottawa, Illinois Table of Contents 232SDD16-1005 Manual 232SDD16 FeaturesIntroduction Size 232SDD16 SpecificationsCommunications 232SDD16 I/O Port Pinout ConnectionsDigital I/O Connections Serial Port Connections232SDD16 To DTE Connections RS-232 Connector PinoutPower Supply Connections 232SDD16 To DCE ConnectionsEquivalent Values Commands232SDD16 Commands SyntaxBit Assignments for I/O Lines Read I/O Lines CommandSet Output Lines Command Read Configuration Command Define I/O Lines CommandSet Power-up States Command Bin. Example !0RC01010101010000010101000001000000 Interfacing Digital InputsIsolated Solid State Input Digital I/O Mask Values SoftwareProgramming Techniques MSpups = MSpups and mask LSpups = LSpups and mask Set Output States CommandMSdefs = MSdefs and mask LSdefs = LSdefs and mask MSstates = MSstates or mask LSstates = LSstates or maskMSdefs = MSdefs or mask LSdefs = LSdefs or mask Define I/O Lines CommandSet Power-up States Command MSdefs = MSdefs and NOTmask LSdefs = LSdefs and NOTmaskDemonstration Program Running Demonstration ProgramAppendix a Appendix B Decimal to Hexadecimal Conversion Figure C.1 DTB25 Outline Drawing 232SDD16-1005 Manual Appendix CTable C.1 DTB25 Connections Table C.2 DBM16 I/O ConnectionsFigure C.2 DBM16 Outline Drawing DBM16 InterfacingFigure C.6 Isolated Solid State Input Outputs DBM16 Specifications LinesInputs 232SDD16-1005 Manual Appendix C 00FF01FE #0RDMsb~ I/O msbI/O lsb ~ I/O lsb Comp = not x and &HFFTable D-1 Extended Commands 232SDD16-1005 Manual Appendix D