B&B Electronics 232DRIO manual Running Demonstration Program, QuickBasic

Page 24

Demonstration Program

The Demonstration Programs (IBM PC or Compatible) provide the user with examples of how to receive and transmit commands to the 232DRIO. The DEMO232.EXE is the executable program and the DEMO232.BAS file is the source code in QuickBasic. The DEMO232.EXE is the executable program and the DEMO232.CPP file is the source code in C/C++. The source codes provide an illustration of how to send and receive commands from the 232DRIO.

NOTE: This is a demonstration program only and not intended for system applications.

Running Demonstration Program

Before you can run the demonstration program you must run the install program in the Hard Drive Installation section. If you are running Windows, exit Windows to DOS.

To run the program follow these steps from the DOS prompt:

QuickBasic

1.Type CD \BASIC and press the <ENTER> key.

2.Type DEMO232 and press the <ENTER> key.

C/C++

1.Type CD \BC and press the <ENTER> key.

2.Type DEMO232 and press the <ENTER> key.

22

232DRIO-0308 Manual

B&B Electronics --

PO Box 1040 -- Ottawa, IL 61350

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

Image 24
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 GroundRS232 Connector Pinout 232DRIO Terminal BlocksSerial Port Connections Power Supply Connections 232DRIO To DTE Connections232DRIO To DCE Connections #0R 01FEComp = not x and &HFF 232DRIO Commands Function Command ResponseEquivalent Values SyntaxBit Assignments for I/O Lines Data BytesExample Set Output Lines Data Byte Relays Binary Decimal Relay #2 Relay #1Input #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