B&B Electronics 232DRIO manual Read I/O Lines Command, Set Output Lines Command, 0R00000000

Page 15

Read I/O Lines Command

The Read I/O Lines command returns one data byte (with the “!”) and two data bytes (data and its complement with the “#”) that reflects the state of the I/O lines. Bit 2 is Input #1, Bit 1 is Relay #2, and finally Bit 0 corresponds to Relay #1. If a bit is a "0" then the state of that I/O line is LOW. If a bit is a "1" then the state of that I/O line is HIGH.

Command: !0R

Argument: none

Response: the state of input and 2 relays (shown in bold face)

ASCII Example: !0R<NUL>

Dec. Example: !0R<0>

Hex. Example: !0R<0>

Bin. Example:

!0R<00000000>

Description:

This indicates that the input and both relays are

 

“0”s or LOW.

Command: #0R

Argument: none

Response: data and its complement, state of the input and 2 relays

(shown in bold face)

ASCII Example: #0R<NUL><blank ‘FF’>

Dec. Example: #0R<0><255>

Hex. Example: #0R<00><FF>

Bin. Example:

#0R<00000000><11111111>

Description:

This indicates that the input and both relays are “0”s

 

or LOW. Note that the complement is returned

 

immediately following the data byte.

Set Output Lines Command

The Set Output Lines command is used to set the states of the relay outputs. This command requires one data byte (in normal environment with “!”) or two data bytes (in harsh environment with “#”), data and its complement. This data byte specifies the output state of each relay output. Bit 1 is Relay #2, and Bit 0 is Relay #1. If a bit position is set to a "0" then the state of that output line will be set LOW. If a bit position is set to a "1" then the state of that output line will be set HIGH.

232DRIO-0308 Manual

13

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

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

Image 15
Contents Internet Model 232DRIOElectronics Mfg. Co. Inc Designed and Manufactured Ottawa, IllinoisPage Table of Contents Appendix B Table of Contents 232DRIO-0308 ManualIntroduction 232DRIO FeaturesNon-polarized, Optically Isolated Input 232DRIO-0308 Manual 232DRIO SpecificationsEnvironment Power SupplyRelay Outputs CommunicationsGround ConnectionsOpto-isolated Input black terminal blocks Relay Outputs blue terminal blocksRS232 Connector Pinout 232DRIO Terminal BlocksSerial Port Connections Power Supply Connections 232DRIO To DTE Connections232DRIO To DCE Connections #0R 01FEComp = not x and &HFF Syntax 232DRIO CommandsFunction Command Response Equivalent ValuesData Bytes Bit Assignments for I/O LinesExample Set Output Lines Data Byte Relays Binary Decimal Relay #2 Relay #1Input #1 Relay #2 Relay #1 Shown in bold face Read I/O Lines CommandSet Output Lines Command 0R00000000…~… shown in bold face Argument … shown in bold face0S03 0S00000011Board Layout Opto-isolated Input Switch Input Isolated Mechanical Input Relay Outputs 232DRIO External Circuit Closing a COM Port SymbolDigital I/O Mask Values Opening a COM PortQuickBasic DEMO232.EXE and DEMO232.BAS Using the 232DRIO.LIB with QuickBasicRead I/O States Command Set Output States Command#include232DRIO.H void main ++ DEMO232.EXE and DEMO232.CPPQuickBasic Running Demonstration ProgramAppendix a Decimal to HEX to Ascii Conversion Table Appendix a 232DRIO-0308 ManualAppendix B Appendix B 232DRIO-0308 Manual Decimal to Hexadecimal Conversion