B&B Electronics 232DRIO Argument … shown in bold face, 0S03, 0S00000011, …~… shown in bold face

Page 16

Command: !0S

Argument: {…} (shown in bold face)

Response: none

ASCII Example: !0S<ETX>

Dec. Example:

!0S<3>

Hex. Example:

!0S<03>

Bin. Example:

!0S<00000011>

Description:

 

Relay #2 is energized (“1”), and Relay #1 is

 

 

energized (“1”).

Command: #0S

Argument:

{…}{~…} (shown in bold face)

Response:

none

ASCII Example: #0S<ETX><n>

Dec. Example:

#0S<3><252>

Hex. Example:

#0S<03><FC>

Bin. Example:

#0S<00000011><11111100>

Description:

Relay #2 is energized (“1”), and Relay #1 is

 

energized (“1”). Note that the complement is

 

returned immediately following the data byte.

NOTE: If any of these lines are defined as inputs the bit settings are ignored. Since Bit 2 is defined as Input #1 the bit setting is ignored.

Two important ideas to keep in mind when sending commands back to back or in sequence are the following:

1)If the “!0R” is sent, one character delay must follow immediately before any other commands are sent.

2)If the “#0R” is sent, two character delay must follow immediately before any other commands are sent.

For example: 1) “!0R_!0S1”

2)“#0R_ _ #0S1”

Otherwise, the microcontroller will miss the second “!” or “#” and not interpret the second command at all since it is still trying to transmit the returned data byte(s) to the user.

Chapter 4 - I/O Interfacing

14

232DRIO-0308 Manual

B&B Electronics --

PO Box 1040 -- Ottawa, IL 61350

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

Image 16
Contents Model 232DRIO Electronics Mfg. Co. IncDesigned and Manufactured Ottawa, Illinois InternetPage Table of Contents Table of Contents 232DRIO-0308 Manual Appendix B232DRIO Features Introduction232DRIO Specifications Non-polarized, Optically Isolated Input 232DRIO-0308 ManualPower Supply Relay OutputsCommunications EnvironmentConnections Opto-isolated Input black terminal blocksRelay Outputs blue terminal blocks Ground232DRIO Terminal Blocks RS232 Connector PinoutSerial Port Connections 232DRIO To DTE Connections Power Supply Connections232DRIO To DCE Connections 01FE #0RComp = not x and &HFF 232DRIO Commands Function Command ResponseEquivalent Values SyntaxBit Assignments for I/O Lines Data BytesRelay #2 Relay #1 Example Set Output Lines Data Byte Relays Binary DecimalInput #1 Relay #2 Relay #1 Read I/O Lines Command Set Output Lines Command0R00000000 Shown in bold faceArgument … shown in bold face 0S030S00000011 …~… shown in bold faceBoard Layout Opto-isolated Input Switch Input Isolated Mechanical Input Relay Outputs 232DRIO External Circuit Symbol Digital I/O Mask ValuesOpening a COM Port Closing a COM PortUsing the 232DRIO.LIB with QuickBasic Read I/O States CommandSet Output States Command QuickBasic DEMO232.EXE and DEMO232.BAS++ DEMO232.EXE and DEMO232.CPP #include232DRIO.H void mainRunning Demonstration Program QuickBasicAppendix a Appendix a 232DRIO-0308 Manual Decimal to HEX to Ascii Conversion TableAppendix B Decimal to Hexadecimal Conversion Appendix B 232DRIO-0308 Manual