B&B Electronics manual Decimal to Hexadecimal Conversion, Appendix B 232DRIO-0308 Manual

Page 28

Hexadecimal to Decimal Conversion: Decimal = (1st Hex digit x 4096) + (2nd Hex digit x 256) +

(3rd Hex digit x 16) + (4th Hex digit)

Each "Hex digit" is the decimal equivalent value of the hexadecimal symbol.

Example: Convert 10FC hexadecimal to decimal.

1

x

4096

=

4096

0

x

256

=

0

15

x

16

=

240

12

x

1

=

12

 

 

 

 

4348

10FC hex equals 4348 decimal.

Decimal to Hexadecimal Conversion:

Example: Convert 4348 decimal to hexadecimal.

4096

4348

=

1

=

1

(1st Hex digit)

256

4096

=

0

=

0

(2nd Hex digit)

252

16

0

=

15

=

F

(3rd Hex digit)

252

1

240

=

12

=

C

(4th Hex digit)

12

 

12

 

 

 

 

 

0

4348 decimal equals 10FC hexadecimal.

B-2

Appendix B

232DRIO-0308 Manual

 

B&B Electronics -- PO Box 1040 --

Ottawa, IL 61350

 

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

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