Tektronix RISCom-8 Windows Function Call Driver Users Guide

RISCom-8 Windows Function Call Driv er
USER’S GUIDE
RISCom-8
Windows Function Call Driver
Revision A - July 1994
Part Number: 77890
New Contact Information
Keithley Instruments, Inc.
28775 Aurora Road
Cleveland, OH 44139
Technical Support: 1-888-KEITHLEY
Monday – Friday 8:00 a.m. to 5:00 p.m (EST)
Fax: (440) 248-6168
Visit our website at http://www.keithley.com
The information contained in this manual is believed to be accurate and reliable. However, Keithley Instruments, Inc., assumes no responsibility for its use or for any infringements of patents or other rights of third parties that may result from its use. No license is granted by implication or otherwise under any patent rights of Keithley Instruments, Inc.
KEITHLEY INSTRUMENTS, INC., SHALL NO T BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RELATED TO THE USE OF THIS PRODUCT. THIS PRODUCT IS NOT DESIGNED WITH COMPONENTS OF A LEVEL OF RELIABILITY SUITABLE FOR USE IN LIFE SUPPORT OR CRITICAL APPLICATIONS.
Refer to your Keithley Instruments license agreement for specific warranty and liability information.
MetraByte is a trademark of Keithley Instruments, Inc. All other brand and product names are trademarks or registered trademarks of their respective companies.
© Copyright Keithley Instruments, Inc., 1994.
All rights reserved. Reproduction or adaptation of any part of this documentation beyond that permitted by Section 117 of the 1976 United States Copyright Act without permission of the Copyright owner is unlawful.
Keithley MetraByte Division
Keithley Instruments, Inc.
440 Myles Standish Blvd. Taunton, MA 02780
FAX: (508) 880-0179
Telephone: (508) 880-3000
Preface
The RISCom-8 Windows Function Call Driver User’s Guide describes how to write application programs for the RISCom-8 board using Windows  DLL function calls. The RISCom-8 Function Call Driver supports the following Windows-based languages:
Microsoft QuickC
for Windows (Version 1.0)
Microsoft Visual C++  (Version 1.0)
Borland
Borland Turbo Pascal for Windows (Version 1.0 and higher)
Microsoft Visual Basic for Windows (Version 2.0 and higher)
C/C++ (Version 3.1 and higher)
The manual is intended for application programmers using a RISCom-8 board in an IBM
PC/XT
, PC AT
, or compatible computer. It is assumed that users have read the RISCom-8 User’s Guide to familiarize themselves with the board’s features, and that they have completed the appropriate hardware setup and installation.
It is also assumed that users are experienced in programming in their selected language and that they are familiar with serial communication principles.
v
The RISCom-8 Windows Function Call Driver User’s Guide is organized as follows:
Chapter 1 contains the information needed to install the RISCom-8 Windows Function Call Driver, use the configuration program, and get help, if required.
Chapter 2 provides background information about the functions included in the RISCom-8 Windows Function Call Driver.
Chapter 3 describes how to create application programs in the
supported languages.
Chapter 4 contains detailed descriptions of the functions, arranged in alphabetical order.
An index completes this manual.
vi
Table of Contents
Preface
1
Getting Started
Quick Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
Running the Configuration Program . . . . . . . . . . . . . . . . . . . . . .1-3
Getting Help. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
Available Operations
2
Initialization Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
Initializing the Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
Initializing a Communication Port . . . . . . . . . . . . . . . . . . . . .2-2
Resetting all Communication Ports. . . . . . . . . . . . . . . . . . . . .2-3
Setting the Communication Protocol . . . . . . . . . . . . . . . . . . .2-3
Data Movement Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
Reading Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
Writing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
Port Control Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
Controlling the Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
Controlling the Transmitter. . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
Controlling the Modem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
Buffer Management Operations. . . . . . . . . . . . . . . . . . . . . . . . . .2-6
Managing the Receive Buffer . . . . . . . . . . . . . . . . . . . . . . . . .2-6
Managing the Transmission Buffer . . . . . . . . . . . . . . . . . . . . .2-6
3
Programming with the Function Call Driver
Programming in Microsoft QuickC for Windows . . . . . . . . . . . .3-1
Programming in Microsoft Visual C++ for Windows . . . . . . . . .3-2
Programming in Borland C++ for Windows . . . . . . . . . . . . . . . .3-3
Programming in Borland Turbo Pascal for Windows . . . . . . . . .3-4
Programming in Microsoft Visual Basic for Windows . . . . . . . .3-4
iii
iv
Function Call Reference
4
K_R8ClearRecBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3
K_R8ClearTransBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-4
K_R8DevOpen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5
K_R8GetModSignals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7
K_R8GetNumRecChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-9
K_R8GetStatus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-11
K_R8HandShakeProt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-13
K_R8Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-15
K_R8ReadString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-18
K_R8ReceiveChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-20
K_R8Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-21
K_R8RXDisable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-22
K_R8RXEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-23
K_R8SendChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-24
K_R8SetBaudRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-26
K_R8SetModSignals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-28
K_R8SetParity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-30
K_R8SetStopBits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-32
K_R8SetWordLen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-34
K_R8TransBufAvail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-36
K_R8TXDisable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-38
K_R8TXEnable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-39
K_R8WriteString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-40
K_R8XOFFChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-42
K_R8XONChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-44
K_R8XONProt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-46
Index
List of Figures
Figure 2-1. Status of the Communication Port. . . . . . . . . . . . .2-2
Figure 4-1. Value Returned by K_R8GetStatus. . . . . . . . . . .4-11
Figure 4-2. Value Returned by K_R8Init. . . . . . . . . . . . . . . .4-16
Figure 4-3. Value Returned by K_R8SendChar. . . . . . . . . . .4-24
List of Tables
Table 2-1. Supported Operations . . . . . . . . . . . . . . . . . . . . . .2-1
Table 4-1. RISCom-8 DLL Functions. . . . . . . . . . . . . . . . . . .4-1
1
Getting Started
The RISCom-8 W indows Function Call Dri ver is a Dynamic Link Library (DLL) of communication functions. This Function Call Driver allo ws you to access the RISCom-8 board from the following Windows-based languages:
Microsoft QuickC
Microsoft Visual C++ Borland C++
Turbo Pascal for Windows
Microsoft Visual Basic for Windows.
Included in this software package are the following:
Support files, containing program elements, such as function prototypes and definitions of variable types, that are required by the functions.
Configuration program. Language-specific example programs that loop back data on the first
port of the RISCom-8. Note that you must attach a loopback connector on the communication port of the RISCom-8 or use a standard RISCom-8 Octal cable with a loopback plug to read the characters.
The following sections describe how to install the Function Call Driver, how to use the configuration program, and how to get additional assistance, if required.
1-1
Quick Setup
To install the RISCom-8 Windows Function Call Driver, perform the following steps:
1. Install the RISCom-8 boards as described in the RISCom-8 User’s
Guide , making sure that all boards have a unique base address and
interrupt setting.
2. Insert the RISCom-8 software diskette into a floppy disk driv e of your
computer.
3. Run Windo ws.
4. From the Program Manager File menu, select Run.
5. In the Command Line text box, type the letter of the drive containing
your RISCom-8 diskette, then type SETUP.EXE. For example, if you diskette is in drive A, type the following:
A:SETUP.EXE
6. Select OK.
7. Respond to the installation prompts, as necessary.
8. Run the CFGR8W.EXE configuration program, described in the next
section, and answer the prompts as they appear to configure the driver from the Windows program group.
Once you complete this procedure, you can write Windows application programs that use the functions described in Chapters 2 and 4 to communicate with the RISCom-8 boards. Refer to Chapter 3 for language-specific programming information.
1-2 Getting Started
Running the Configuration Program
You can use multiple RISCom-8 boards in one computer. If you use four boards, the ports are accessed as ports 0 to 31.
Run the configuration program, CFGR8W.EXE, every time you add a new RISCom-8 board to your system. The program creates and/or edits a configuration file you specify. You can name the configuration file any name you like, such as RISCOM8.CFG.
Specify the following parameters in the configuration file:
Number of RISCom-8 boards used
Base address of each RISCom-8 board
Getting Help
Interrupt (IRQ) setting of each RISCom-8 board
Interface type (such as, RS-232, RS-422/485) of each RISCom-8
board
The following is an example of a configuration file:
[RISCOM8] BOARD1=P 544, I 11, R RS232 BOARD2=P 576, I 10, R RS232
In this example, two RISCom-8, RS-232 boards are configured in the system. One board is set up with a base address of 220h (544 decimal) and an IRQ of 11; the other board is set up with a base address of 240h (576 decimal) and an IRQ of 10.
If you need help installing or using the RISCom-8 Windows Function Call Driver, call your local sales office or the Keithley MetraByte Applications Engineering Department at:
(508) 880-3000 Monday - Friday, 8:00
A.M.
- 6:00
P.M.
, Eastern Time
1-3
An applications engineer will help you diagnose and resolve your problem over the telephone. Please make sure that you hav e the follo wing information available before you call:
RISCom-8 board configuration
Computer
Operating system
Software package
Model Serial # Revision code Base address setting Interrupt level setting
Manufacturer CPU type Clock speed (MHz) KB of RAM Video system BIOS type
Windows version Windows mode
Name Serial # Version Invoice/Order #
___________________ ___________________ ___________________ ___________________ ___________________ _____
___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ______
___________________ ___________________ ___________________ ___
___________________ ___________________ ___________________ ___________________ ____
Compiler (if applicable)
Accessories
1-4 Getting Started
Language Manufacturer Version
Type Type Type Type Type Type Type Type
___________________ ___________________ ___________________ ___
___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ________
2
Available Operations
This chapter provides the background information you need to use the functions to perform communication operations on the RISCom-8 board. The supported operations are listed in Table 2-1.
Table 2-1. Supported Operations
Operation Page Reference
Initialization page 2-1 Data Movement page 2-4 Port Control page 2-5 Buffer Management page 2-6
Initialization Operations
This section describes the functions provided in the RISCom-8 Windows Function Call Driver to perform the following initialization operations:
Initializing the driver
Initializing a communication port
Resetting all communication ports Setting the communication protocol
2-1
Initializing the Driver
Before you can use any of the functions included in the RISCom-8 Windows Function Call Driver, you must initialize the driver using the
K_R8DevOpen function. K_R8DevOpen initializes the driver according to a configuration file you
specify and returns an error/status code indicating whether the driver was initialized successfully. Refer to page 1-3 for more information about creating a configuration file for RISCom-8 boards; refer to page 4-5 for information on the error/status codes.
Initializing a Communication Port
If you use four RISCom-8 boards, the communication ports are accessed as ports 0 to 31. To initialize a specified communication port, you can use the following functions:
Bit 7 = 1; Timed Out
Bit 7 = 1; RCD On
Bit 6 = 1; TxSR Empty
Bit 6 = 1; RI On
K_R8Init - Initializes the specified communication port with a
specified parity (none, even, or odd), number of stop bits (one or two), number of bits in the word to transfer (five to eight bits), and baud rate (110 to 76800). This function also returns the status of the communication port. The status consists of two bytes, as shown in Figure 2-1.
Low Byte, Port Status
Bit 5 = 1; TxHR Empty
Bit 5 = 1; DSR On
Bit 4 = 1; Break On
High Byte, Modem Status
Bit 4 = 1; CTS On
Bit 3 = 1; Frame Error
Bit 3 = 1; DCD Changed
Bit 2 = 1; Parity Error
Bit 2 = 1; RI Changed
Figure 2-1. Status of the Communication Por t
Bit 1 = 1; Overrun Error
Bit 1 = 1; DSR Changed
Bit 0 = 1; Data Ready
Bit 0 = 1; CTS Changed
2-2 Available Operations
K_R8SetParity - Sets the parity for a specified communication port
to either none, even, or odd. This function also returns the previously programmed parity value.
K_R8SetStopBits - Sets the number of stop bits for a specified
communication port to either one or two. This function also returns the previously programmed stop bits value.
K_R8SetWordLen - Sets the number of bits in the word to transfer
(the word length) for the specified communication port to either five, six, seven, or eight bits. This function also returns the previously programmed word length.
K_R8SetBaudRate - Sets the baud rate for the specified
communication port to either 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, or 76800. This function also returns the previously programmed baud rate.
Resetting all Communication Ports
To reset all communication ports on the RISCom-8 boards, use the
K_R8Reset function. This function returns the number of RISCom-8
boards present.
Setting the Communication Protocol
T o set a communication protocol for a specified communication port, you can use the following functions:
K_R8HandShakeProt - Specifies whether CTS and RTS (hardware
handshaking signals) are enabled or disabled for transmit operations.
K_R8XONProt - Specifies whether XON is enabled or disabled for
receive operations.
K_R8XONChar - Specifies the ASCII character that enables the
XON operation.
K_R8XOFFChar - Specifies the ASCII character that enables the
XOFF operation.
2-3
Data Movement Operations
This section describes the functions provided in the RISCom-8 Windows Function Call Driver to perform the following data movement operations:
Reading data Writing data
Reading Data
To read data from a specified communication port, you can use the following functions:
K_R8ReceiveChar - Returns one character. This function also
returns the status of the communication port, shown in Figure 2-1.
Writing Data
K_R8ReadString - Reads a specified number of characters from a
string. This function also returns the number of characters read from the receive buffer..
K_R8GetStatus - Returns the status of the communication port and
the modem as two bytes, shown in Figure 2-1.
To write data to a specified communication port, you can use the following functions:
K_R8SendChar - Writes one character. This function also returns
the status of the communication port. Refer to Figure 2-1 for the format of the value returned.
K_R8WriteString - Writes a specified number of characters in a
string. This function also returns the actual number of characters written to the transmission buffer.
2-4 Available Operations
Port Control Operations
This section describes the functions provided in the RISCom-8 Windows Function Call Driver to perform the following operations:
Controlling the receiver Controlling the transmitter
Controlling the modem
Controlling the Receiver
T o control the recei ver of a specified communication port, you can use the following functions:
K_R8RXEnable - Enables the receiver. K_R8RXDisable - Disables the receiver.
Controlling the Transmitter
To control the transmitter of a specified communication port, you can use the following functions:
K_R8TXEnable - Enables the transmitter. K_R8TXDisable - Disables the transmitter.
Controlling the Modem
T o control the modem on a specified communication port, you can use the following functions:
K_R8SetModSignals - Sets the RTS and DTR signals on or off.
K_R8GetModSignals - Returns the state of the RTS and DTR
signals.
2-5
Buffer Management Operations
This section describes the functions provided in the RISCom-8 Windows Function Call Driver to perform the following buffer management functions:
Managing the receive buffer
Managing the transmission buffer
Managing the Receive Buffer
To manage the receive buffer of a specified communication port, you can use the following functions:
K_R8ClearRecBuf - Clears the receive buffer.
K_R8GetNumRecChar - Returns the number of characters in the
receive buffer.
Managing the Transmission Buffer
To manage the transmission buffer of a specified communication port, you can use the following functions:
K_R8ClearTransBuf - Clears the transmission buffer.
K_R8TransBufAvail - Returns the space available in terms of the
number of characters that can be sent to the transmission buffer before an overflow error occurs.
2-6 Available Operations
3
Programming with the
Function Call Driver
This chapter describes how to create an application program in each of the supported languages using the RISCom-8 Windows Function Call Driver.
Programming in Microsoft QuickC for Windows
To program in Microsoft QuickC for Windows, you need the following files:
File Description
RISCOM8.DLL Dynamic Link Library. RISCOM8.H Include file.
To create an executable file in Microsoft QuickC for Windows, perform the following steps:
1. Load filename .c into the QuickC for Windows environment, where
filename indicates the name of your application program.
2. Create a project file. The project file should contain all necessary
files, including filename .c, filename .rc, filename .def, filename .h, and RISC8IMP.LIB, where filename indicates the name of your application program.
3-1
3. From the Project menu, choose Build to create a stand-alone
executable file (.EXE) that you can execute from within Windows.
3-2 Programming with the Function Call Driver
Programming in Microsoft Visual C++ for Windows
To program in Microsoft Visual C++, you need the following files:
File Description
RISCOM8.DLL Dynamic Link Library. RISCOM8.H Include file for C. RISCOM8.HPP Include file for C++.
To create an executable file in Visual C++, perform the following steps:
1. Create a project file by choosing New from the Project menu. The
project file should contain all necessary files, including filename .c,
filename .rc, filename .def, and RISC8IMP.LIB, where filename
indicates the name of your application program.
2. From the Project menu, choose Rebuild All FILENAME.EXE to
create a stand-alone executable file (.EXE) that you can execute from within Windo ws.
3-3
Programming in Borland C++ for Windows
To program in Borland C++, you need the following files:
File Description
RISCOM8.DLL Dynamic Link Library. RISCOM8.H Include file for C. RISCOM8.HPP Include file for C++.
To create an executable file in Borland C++, perform the following steps:
1. Create a project file by choosing Open from the Project menu and
entering a project name. The project file should contain all necessary files, including filename .c, filename .rc, filename .def, and RISC8IMP.LIB, where filename indicates the name of your application program.
2. From the Compile menu, choose Build All FILENAME.EXE to
create a stand-alone executable file (.EXE) that you can execute from within Windo ws.
3-4 Programming with the Function Call Driver
Programming in Borland Turbo Pascal for Windows
To program in Borland Turbo Pascal for Windows, you need the following files:
File Description
RISCOM8.DLL Dynamic Link Library. RISCOM8.INC Include file.
To create an executable file in Borland Turbo Pascal for Windows, perform the following steps:
1. Load filename .pas into the Borland Turbo Pascal for Windows
environment, where filename indicates the name of your application program.
2. From the Compile menu, choose Make.
Programming in Microsoft Visual Basic for Windows
To program in Microsoft Visual Basic for Windows, you need the following files:
File Description
RISCOM8.DLL Dynamic Link Library. VBWDECL.BAS Include file.
To create an executable file from the Microsoft Visual Basic for Windows environment, choose Make EXE File from the Run menu.
3-5
4
Function Call Reference
This chapter describes the functions supported by the RISCom-8 Windows Function Call Driver, in alphabetical order.
Table 4-1 lists the specific functions associated with each type of operation as well as the page number where the function is described.
Table 4-1. RISCom-8 Functions
Operation Type Function Page Number
Initialization K_R8DevOpen page 4-5
K_R8Reset page 4-21 K_R8Init page 4-15 K_R8SetBaudRate page 4-26 K_R8SetStopBits page 4-32 K_R8SetWordLen page 4-34 K_R8SetParity page 4-30 K_R8XONProt page 4-46 K_R8XONChar page 4-44 K_R8XOFFChar page 4-42 K_R8HandShakeProt page 4-13
. 4-1
Table 4-1. RISCom-8 Functions (cont.)
Operation Type Function Page Number
Data Movement K_R8SendChar page 4-24
K_R8ReceiveChar page 4-20 K_R8GetStatus page 4-11 K_R8ReadString page 4-18 K_R8WriteString page 4-40
Port Control K_R8RXEnable page 4-23
K_R8RXDisable page 4-22 K_R8TXEnable page 4-39 K_R8TXDisable page 4-38
Buffer Management
K_R8GetModSignals page 4-7 K_R8SetModSignals page 4-28 K_R8ClearRecBuf page 4-3 K_R8GetNumRecChar page 4-9 K_R8ClearTransBuf page 4-4 K_R8TransBufAvail page 4-36
4-2 Function Call Reference
K_R8ClearRecBuf
Purpose
Prototype C/C++
Clears the receive buffer of the specified communication port.
void pascal far K_R8ClearRecBuf (int ComNum );
Turbo Pascal
procedure K_R8ClearRecBuf ( ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8ClearRecBuf Lib "RISCOM8.DLL" (ByVal ComNum As Integer)
Parameters
Return Value
See Also
Usage C/C++
ComNum
None
K_R8ClearTransBuf
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8ClearRecBuf (0);
Communication port. Valid values: 0 to 31
Turbo Pascal
{$I RISCOM8.INC} ... K_R8ClearRecBuf (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8ClearRecBuf (0)
4-3
K_R8ClearTransBuf
Purpose
Prototype C/C++
Clears the transmission buffer of the specified communication port.
void pascal far K_R8ClearTransBuf (int ComNum );
Turbo Pascal
procedure K_R8ClearTransBuf ( ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8ClearTransBuf Lib "RISCOM8.DLL" (ByVal ComNum As Integer)
Parameters
Return Value
See Also
Usage C/C++
ComNum
None
K_R8ClearRecBuf
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8ClearTransBuf (0);
Communication port. Valid values: 0 to 31
Turbo Pascal
{$I RISCOM8.INC} ... K_R8ClearTransBuf (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8ClearTransBuf (0)
4-4 Function Call Reference
K_R8DevOpen
Purpose
Opens the specified configuration file, reads the data in the file, and performs initialization tests.
Your program must call this function before calling any other function in this library.
Prototype C/C++
unsigned int pascal far K_R8DevOpen (char far * CfgFileName );
Turbo Pascal
function K_R8DevOpen (var CfgFileName : char) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8DevOpen Lib "RISCOM8.DLL" (ByVal CfgFileName As String) As Integer
Parameters
Return Value
CfgFileName
K_R8DevOpen returns one of the following error/status codes:
Configuration file name. Valid values: The name of a configuration file.
Error/Status Code
0 No error 1 General error 2 Cannot open file or file not found 3 Invalid file format 4 Base address error 5 Interrupt level error 6 RS type error 7 Board not found at the specified address
Description
4-5
K_R8DevOpen (cont.)
See Also
Usage C/C++
K_R8Init
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int R_Err; ... R_Err = K_R8DevOpen ("RISCOM8.CFG");
Turbo Pascal
{$I RISCOM8.INC} szCfgName : string; R_Err : word; ... szCfgName := 'RISCOM8.CFG' + #0; ... R_Err := K_R8DevOpen (szCfgName[1]);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM R_Err AS INTEGER ... R_Err = K_R8DevOpen ("riscom8.cfg")
4-6 Function Call Reference
K_R8GetModSignals
Purpose
Returns the status of the modem signals from the specified communication port.
Prototype C/C++
unsigned int pascal far K_R8GetModSignals (int ComNum );
Turbo Pascal
procedure K_R8GetModSignals ( ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Function K_R8GetModSignals Lib "RISCOM8.DLL" (ByVal ComNum As Integer) As Integer
Parameters
Return Value
ComNum
K_R8GetModSignals returns the status of the modem signals . Values are as follows:
Communication port. Valid values: 0 to 31
See Also
Bit Value Description
0 0 RTS Off
1 RTS On
1 0 DTR Off
1 DTR On
K_R8SetModSignals
4-7
K_R8GetModSignals (cont.)
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int ModSignals; ... ModSignals = K_R8GetModSignals (0);
Turbo Pascal
{$I RISCOM8.INC} ModSignals : Integer; ... ModSignals := K_R8GetModSignals (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM ModSignals AS INTEGER ... ModSignals = K_R8GetModSignals (0)
4-8 Function Call Reference
K_R8GetNumRecChar
Purpose
Returns the number of characters in the receive buffer of the specified communication port.
Prototype C/C++
unsigned int pascal far K_R8GetNumRecChar (int ComNum );
Turbo Pascal
function K_R8GetNumRecChar ( ComNum : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8GetNumRecChar Lib "RISCOM8.DLL" (ByVal ComNum As Integer) As Integer
Parameters
Return Value
ComNum
K_R8GetNumRecChar returns the number of characters currently in the receive buffer .
See Also
K_R8ClearRecBuf
Communication port. Valid values: 0 to 31
4-9
K_R8GetNumRecChar (cont.)
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int NumofChar; ... NumofChar = K_R8GetNumRecChar (0);
Turbo Pascal
{$I RISCOM8.INC} NumofChar : word; ... NumofChar := K_R8GetNumRecChar (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM NumofChar AS INTEGER ... NumofChar = K_R8GetNumRecChar (0)
4-10 Function Call Reference
K_R8GetStatus
Purpose
Returns the status of the specified communication port.
Prototype C/C++
unsigned int pascal far K_R8GetStatus (int ComNum);
Turbo Pascal
function K_R8GetStatus (ComNum : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8GetStatus Lib "RISCOM8.DLL" (ByVal ComNum As Integer) As Integer
Parameters
Return Value
ComNum Communication port.
K_R8GetStatus returns the status of the communication port. The status consists of two bytes, as shown in Figure 4-1.
Valid values: 0 to 31
Low Byte, Port Status
Bit 7 = 1; Timed Out
Bit 7 = 1; RCD On
Bit 6 = 1; TxSR Empty
Bit 6 = 1; RI On
Bit 5 = 1; TxHR Empty
Bit 5 = 1; DSR On
Bit 4 = 1; Break On
High Byte, Modem Status
Bit 4 = 1; CTS On
Bit 3 = 1; Frame Error
Bit 3 = 1; DCD Changed
Bit 2 = 1; Parity Error
Bit 2 = 1; RI Changed
Figure 4-1. Value Returned by K_R8GetStatus
Bit 1 = 1; Overrun Error
Bit 1 = 1; DSR Changed
Bit 0 = 1; Data Ready
Bit 0 = 1; CTS Changed
4-11
K_R8GetStatus (cont.)
See Also
Usage C/C++
K_R8Init, K_R8SendChar
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int Status; ... Status = K_R8GetStatus (0);
Turbo Pascal
{$I RISCOM8.INC} Status : word; ... Status := K_R8GetStatus (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM Status AS INTEGER ... Status = K_R8GetStatus (0)
4-12 Function Call Reference
K_R8HandShakeProt
Purpose
Specifies whether hardware handshaking is enabled or disabled for transmit operations.
Prototype C/C++
unsigned int pascal far K_R8HandShakeProt (int ComNum, int ProtoCall);
Turbo Pascal
function K_R8HandShakeProt (ComNum : integer; ProtoCall : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8HandShakeProt Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal ProtoCall As Integer) As Integer
Parameters
ComNum Communication port.
ProtoCall Status of hardware handshaking.
Valid values: 0 to 31
Valid values:
Return Value
See Also
Bit Value Description
0 0 CTS disabled
1 CTS enabled
1 0 RTS disabled
1 RTS enabled
K_R8HandShakeProt returns the previously programmed protocol. See the description of ProtoCall above for more information.
K_R8XONProt
4-13
K_R8HandShakeProt (cont.)
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldProtoCall; ... OldProtoCall = K_R8HandShakeProt (0, 2);
Turbo Pascal
{$I RISCOM8.INC} OldProtoCall : word; ... OldProtoCall := K_R8HandShakeProt (0, 2);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldProtoCall AS INTEGER ... OldProtoCall = K_R8HandShakeProt (0, 2)
4-14 Function Call Reference
K_R8Init
Purpose
Initializes the specified communication port with the specified parity, number of stop bits, number of bits in the word, and baud rate.
Prototype C/C++
unsigned int pascal far K_R8Init (int ComNum, int Parity, int StopBits, int WordLen, int BaudRate);
Turbo Pascal
function K_R8Init (ComNum : integer; P arity : inte ger; StopBits : integer; WordLen : integer; BaudRate : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8Init Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal Parity As Integer, ByVal StopBits As Integer, ByVal WordLen As Integer, ByVal BaudRate As Integer) As Integer
Parameters
ComNum Communication port.
Parity Type of parity checking.
Valid values: 0 to 31
Valid values: 0 = No Parity
1 = Even Parity 2 = Odd Parity
StopBits Number of stop bits.
Valid values: 0 = one stop bit
1 = two stop bits
WordLen Number of bits in the word.
Valid values: 0 = five bits
1 = six bits 2 = seven bits 3 = eight bits
4-15
K_R8Init (cont.)
BaudRate Baud rate.
Valid values:
Code Baud Rate Code Baud Rate
0 110 6 4800 1 150 7 9600 2 300 8 19200 3 600 9 38400 4 1200 10 57600 5 2400 11 76800
Return Value
Bit 7 = 1; Timed Out
Bit 7 = 1; RCD On
K_R8Init returns the previously programmed status of the communication port. The status consists of two bytes, as shown in Figure 4-2.
Low Byte, Port Status
Bit 6 = 1; TxSR Empty
Bit 6 = 1; RI On
Bit 5 = 1; TxHR Empty
Bit 5 = 1; DSR On
Bit 4 = 1; Break On
High Byte, Modem Status
Bit 4 = 1; CTS On
Bit 3 = 1; Frame Error
Bit 3 = 1; DCD Changed
Bit 2 = 1; Parity Error
Bit 2 = 1; RI Changed
Figure 4-2. Value Returned by K_R8Init
Bit 1 = 1; Overrun Error
Bit 1 = 1; DSR Changed
Bit 0 = 1; Data Ready
Bit 0 = 1; CTS Changed
4-16 Function Call Reference
K_R8Init (cont.)
See Also
K_R8SetParity, K_R8SetStopBits, K_R8SetWordLen, K_R8SetBaudRate
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldSettings; ... OldSettings = K_R8Init (0, 0, 0, 3, 7);
Turbo Pascal
{$I RISCOM8.INC} OldSettings : word; ... OldSettings := K_R8Init (0, 0, 0, 3, 7);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldSettings AS INTEGER ... OldSettings = K_R8Init (0, 0, 0, 3, 7)
4-17
K_R8ReadString
Purpose
Prototype
Parameters
Reads the characters in a string from the specified communication port.
C/C++
unsigned int pascal far K_R8ReadString (int ComNum, char far *String, int NumOfChar);
Turbo Pascal
function K_R8ReadString (ComNum : integer; Var RdString : char; NumOfChar : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8ReadString Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal StringBuffer As String, ByVal NumOfChar As Integer) As Integer
ComNum Communication port.
Valid values: 0 to 31
String String to read. NumOfChar Number of characters in the string to read.
Return Value
K_R8ReadString returns the actual number of characters read from the receive buffer.
See Also
4-18 Function Call Reference
K_R8WriteString
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int NumofChar; char Data[128]; ... NumofChar = K_R8ReadString (0, Data, 10);
Turbo Pascal
{$I RISCOM8.INC} szdata : array[0..79] of char; NumofChar : integer; ... NumofChar := K_R8ReadString (0, szdata[0] ,10);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM szdata AS STRING DIM NumofChar AS INTEGER ... NumofChar = K_R8ReadString (0, szdata, 10)
K_R8ReadString (cont.)
4-19
K_R8ReceiveChar
Purpose
Prototype C/C++
Returns one character from the specified communication port.
char pascal far K_R8ReceiveChar (int ComNum);
Turbo Pascal
function K_R8ReceiveChar (ComNum : integer) : char; far; external 'riscom8';
Visual Basic
Declare Function K_R8ReceiveChar Lib "RISCOM8.DLL" (ByVal ComNum As Integer) As Integer
Parameters
Return Value
ComNum Communication port.
K_R8ReceiveChar returns the status of the communication port and the character read. If the upper byte is 0, then the lower byte is the character received. If the upper byte is nonzero, no character was received.
See Also
K_R8SendChar
Valid values: 0 to 31
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ char CharToRec; ... CharToRec = K_R8ReceiveChar (0);
Turbo Pascal
{$I RISCOM8.INC} CharToRec : char; ... CharToRec := K_R8ReceiveChar (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM CharToRec AS STRING CharToRec(0) = K_R8ReceiveChar (0)
4-20 Function Call Reference
K_R8Reset
Purpose
Prototype C/C++
Initializes all the communication ports that are available.
unsigned int pascal far K_R8Reset ();
Turbo Pascal
function K_R8Reset : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8Reset Lib "RISCOM8.DLL" () As Integer
Parameters
Return Value
See Also
Usage C/C++
None
K_R8Reset returns the number of boards present.
K_R8Init
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int NumofBds; ... NumofBds = K_R8Reset ();
Turbo Pascal
{$I RISCOM8.INC} NumofBds : word; ... NumofBds := K_R8Reset ();
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM NumofBds AS INTEGER ... NumofBds = K_R8Reset ()
4-21
K_R8RXDisable
Purpose
Prototype C/C++
Disables the receiver.
void pascal far K_R8RXDisable (int ComNum);
Turbo Pascal
procedure K_R8RXDisable (ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8RXDisable Lib "RISCOM8.DLL" (ByVal ComNum As Integer)
Parameters
Return Value
See Also
Usage C/C++
ComNum Communication port.
None
K_R8RXEnable
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8RXDisable (0);
Valid values: 0 to 31
Turbo Pascal
{$I RISCOM8.INC} ... K_R8RXDisable (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8RXDisable (0)
4-22 Function Call Reference
K_R8RXEnable
Purpose
Prototype C/C++
Enables the receiver.
void pascal far K_R8RXEnable (int ComNum);
Turbo Pascal
procedure K_R8RXEnable (ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8RXEnable Lib "RISCOM8.DLL" (ByVal ComNum As Integer)
Parameters
Return Value
See Also
Usage C/C++
ComNum Communication port.
None
K_R8RXDisable
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8RXEnable (0);
Valid values: 0 to 31
Turbo Pascal
{$I RISCOM8.INC} ... K_R8RXEnable (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8RXEnable (0)
4-23
K_R8SendChar
Purpose
Writes a specified character to the specified communication port.
Prototype C/C++
unsigned int pascal far K_R8SendChar (int ComNum, char CharToSend);
Turbo Pascal
function K_R8SendChar (ComNum : integer; CharToSend : char) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8SendChar Lib "RISCOM8.DLL" Alias "K_R8SendBasicChar" (ByVal ComNum As Integer, ByVal CharToSend As String) As Integer
Parameters
ComNum Communication port.
CharToSend Character to send.
Return Value
K_R8SendChar returns the status of the communication port. The status consists of two bytes, as shown in Figure 4-3.
Valid values: 0 to 31
Low Byte, Port Status
Bit 7 = 1; Timed Out
Bit 7 = 1; RCD On
Bit 6 = 1; TxSR Empty
Bit 6 = 1; RI On
Bit 5 = 1; TxHR Empty
Bit 5 = 1; DSR On
Bit 4 = 1; Break On
High Byte, Modem Status
Bit 4 = 1; CTS On
Bit 3 = 1; Frame Error
Bit 3 = 1; DCD Changed
Bit 2 = 1; Parity Error
Bit 2 = 1; RI Changed
Bit 1 = 1; Overrun Error
Bit 1 = 1; DSR Changed
Bit 0 = 1; Data Ready
Bit 0 = 1; CTS Changed
Figure 4-3. Value Returned by K_R8SendChar
4-24 Function Call Reference
K_R8SendChar (cont.)
See Also
Usage C/C++
K_R8ReceiveChar
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int status; char CharToSend; ... status = K_R8SendChar (0, CharToSend);
Turbo Pascal
{$I RISCOM8.INC} status : word; CharToSend : char; ... status := K_R8SendChar (0, CharToSend);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM status AS INTEGER DIM CharToSend AS STRING ... status = K_R8SendChar (0, CharToSend(0))
4-25
K_R8SetBaudRate
Purpose
Prototype C/C++
Sets the baud rate for the specified communication port.
unsigned int pascal far K_R8SetBaudRate (int ComNum, int BaudRate);
Turbo Pascal
function K_R8SetBaudRate (ComNum : integer; BaudRate : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8SetBaudRate Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal BaudRate As Integer) As Integer
Parameters
ComNum Communication port.
BaudRate Baud rate.
Valid values: 0 to 31
Valid values:
Code Baud Rate Code Baud Rate
0 110 6 4800 1 150 7 9600 2 300 8 19200 3 600 9 38400 4 1200 10 57600 5 2400 11 76800
Return Value
See Also
4-26 Function Call Reference
K_R8SetBaudRate returns the previously programmed baud rate.
K_R8Init
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldRate; ... OldRate = K_R8SetBaudRate (0, 7);
Turbo Pascal
{$I RISCOM8.INC} OldRate : word; ... OldRate := K_R8SetBaudRate (0, 7);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldRate AS INTEGER ... OldRate = K_R8SetBaudRate (0, 7)
K_R8SetBaudRate (cont.)
4-27
K_R8SetModSignals
Purpose
Prototype C/C++
Sets the state of the modem signals on the specified communication port.
void pascal far K_R8SetModSignals (int ComNum, int ModemSignals);
Turbo Pascal
procedure K_R8SetModSignals (ComNum : integer; ModemSignals : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8SetModSignals Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal ModemSignals As Integer)
Parameters
ComNum Communication port.
ModemSignals State of the modem signals.
Valid values: 0 to 31
Valid values:
Bit Value Description
0 0 RTS Off
1 RTS On
1 0 DTR Off
1 DTR On
Return Value
See Also
4-28 Function Call Reference
None
K_R8GetModSignals
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8SetModSignals (0, 2);
Turbo Pascal
{$I RISCOM8.INC} ... K_R8SetModSignals (0, 2);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8SetModSignals (0, 2)
K_R8SetModSignals (cont.)
4-29
K_R8SetParity
Purpose
Prototype C/C++
Sets the parity for the specified communication port.
unsigned int pascal far K_R8SetParity (int ComNum, int Parity);
Turbo Pascal
function K_R8SetParity (ComNum : integer; Parity : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8SetParity Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal Parity As Integer) As Integer
Parameters
ComNum Communication port.
Parity Type of parity checking.
Return Value
K_R8SetParity returns the previously programmed parity value.
Valid values: 0 to 31
Valid values: 0 = No Parity
1 = Even Parity 2 = Odd Parity
See Also
4-30 Function Call Reference
K_R8Init
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldParity; ... OldParity = K_R8SetParity (0, 0);
Turbo Pascal
{$I RISCOM8.INC} OldParity : word; ... OldParity := K_R8SetParity (0, 0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldParity AS INTEGER ... OldParity = K_R8SetParity (0, 0)
K_R8SetParity (cont.)
4-31
K_R8SetStopBits
Purpose
Prototype C/C++
Sets the number of stop bits for the specified communication port.
unsigned int pascal far K_R8SetStopBits (int ComNum, int StopBits);
Turbo Pascal
function K_R8SetStopBits (ComNum : integer; StopBits : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8SetStopBits Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal StopBits As Integer) As Integer
Parameters
ComNum Communication port.
StopBits Number of stop bits.
Return Value
K_R8SetStopBits returns the previously programmed number of stop bits.
Valid values: 0 to 31
Valid values: 0 = one stop bit
1 = two stop bits
See Also
4-32 Function Call Reference
K_R8Init
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldStopBits; ... OldStopBits = K_R8SetStopBits (0, 1);
Turbo Pascal
{$I RISCOM8.INC} OldStopBits : word; ... OldStopBits := K_R8SetStopBits (0, 1);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldStopBits AS INTEGER ... OldStopBits = K_R8SetStopBits (0, 1)
K_R8SetStopBits (cont.)
4-33
K_R8SetWordLen
Purpose
Sets the number of bits in the word to transfer for the specified communication port.
Prototype C/C++
unsigned int pascal far K_R8SetWordLen (int ComNum, int WordLen);
Turbo Pascal
function K_R8SetWordLen (ComNum : integer; WordLen : integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8SetWordLen Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal WordLen As Integer) As Integer
Parameters
ComNum Communication port.
WordLen Number of bits in the word
Valid values: 0 to 31
Valid values: 0 = five bits
1 = six bits 2 = seven bits 3 = eight bits
Return Value
See Also
4-34 Function Call Reference
K_R8SetWordLen returns the previously programmed word length.
K_R8Init
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldLen; ... OldLen = K_R8SetWordLen (0, 3);
Turbo Pascal
{$I RISCOM8.INC} OldLen : word; ... OldLen := K_R8SetWordLen (0, 3);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldLen AS INTEGER ... OldLen = K_R8SetWordLen (0, 3)
K_R8SetWordLen (cont.)
4-35
K_R8TransBufAvail
Purpose
Returns the number of characters that are available in the transmission buffer of the specified communication port.
Prototype C/C++
unsigned int pascal far K_R8TransBufAvail (int ComNum);
Turbo Pascal
procedure K_R8TransBufAvail (ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Function K_R8TransBufAvail Lib "RISCOM8.DLL" (ByVal ComNum As Integer) As Integer
Parameters
Return Value
ComNum Communication port.
K_R8TransBufAvail returns the remaining number of characters available in the transmission buffer (before an overflow occurs).
See Also
K_R8ClearTransBuf
Valid values: 0 to 31
4-36 Function Call Reference
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int CharLeft; ... CharLeft = K_R8ClearTransBuf (0);
Turbo Pascal
{$I RISCOM8.INC} CharLeft : Integer; ... CharLeft := K_R8ClearTransBuf (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM CharLeft AS INTEGER ... CharLeft = K_R8ClearTransBuf (0)
K_R8TransBufAvail (cont.)
4-37
K_R8TXDisable
Purpose
Prototype C/C++
Disables the transmitter.
void pascal far K_R8TXDisable (int ComNum);
Turbo Pascal
procedure K_R8TXDisable (ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8TXDisable Lib "RISCOM8.DLL" (ByVal ComNum As Integer)
Parameters
Return Value
See Also
Usage C/C++
ComNum Communication port.
None
K_R8TXEnable
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8TXDisable (0);
Valid values: 0 to 31
Turbo Pascal
{$I RISCOM8.INC} ... K_R8TXDisable (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8TXDisable (0)
4-38 Function Call Reference
K_R8TXEnable
Purpose
Prototype C/C++
Enables the transmitter.
void pascal far K_R8TXEnable (int ComNum);
Turbo Pascal
procedure K_R8TXEnable (ComNum : integer); far; external 'riscom8';
Visual Basic
Declare Sub K_R8TXEnable Lib "RISCOM8.DLL" (ByVal ComNum As Integer)
Parameters
Return Value
See Also
Usage C/C++
ComNum Communication port.
None
K_R8TXDisable
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ ... K_R8TXEnable (0);
Valid values: 0 to 31
Turbo Pascal
{$I RISCOM8.INC} ... K_R8TXEnable (0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
... K_R8TXEnable (0)
4-39
K_R8WriteString
Purpose
Prototype C/C++
Writes the characters in a string to the specified communication port.
unsigned int pascal far K_R8WriteString (int ComNum, char far *String, int NumOfChar);
Turbo Pascal
function K_R8WriteString (ComNum : integer; var WrtString: char; NumOfChar: integer); far; external 'riscom8';
Visual Basic
Declare Function K_R8WriteString Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal StringToOutput As String, ByVal NumOfChar As Integer) As Integer
Parameters
ComNum Communication port.
String String to write. NumOfChar Number of characters in the string to write.
Valid values: 0 to 31
Return Value
K_R8WriteString returns the actual number of characters written to the transmission buffer.
See Also
4-40 Function Call Reference
K_R8ReadString
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int NumofChar; char Data[80]; ... NumofChar = K_R8WriteString (0, Data, 10);
Turbo Pascal
{$I RISCOM8.INC} NumofChar : Integer; szdata : array[0..79] of char; ... NumofChar := K_R8WriteString (0, szdata[0], 10);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM NumofChar AS INTEGER DIM szdata AS STRING ... NumofChar = K_R8WriteString (0, szdata, 10)
K_R8WriteString (cont.)
4-41
K_R8XOFFChar
Purpose
Prototype C/C++
Specifies the character that enables the XOFF operation.
unsigned int pascal far K_R8XOFFChar (int ComNum, int XOFFChar);
Turbo Pascal
function K_R8XOFFChar (ComNum : integer; XOFFChar: integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8XOFFChar Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal XOFFChar As Integer) As Integer
Parameters
ComNum Communication port.
XOFFChar XOFF character.
Return Value
See Also
K_R8XOFFChar returns the previously programmed protocol.
K_R8XONChar
Valid values: 0 to 31
4-42 Function Call Reference
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldProtoCall; ... OldProtoCall = K_R8XOFFChar (0, 1);
Turbo Pascal
{$I RISCOM8.INC} OldProtoCall : word; ... OldProtoCall:= K_R8XOFFChar (0, 1);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldProtoCall AS INTEGER ... OldProtoCall:= K_R8XOFFChar (0, 1)
K_R8XOFFChar (cont.)
4-43
K_R8XONChar
Purpose
Prototype C/C++
Specifies the character that enables the XON operation.
unsigned int pascal far K_R8XONChar (int ComNum, int XONChar);
Turbo Pascal
function K_R8XONChar (ComNum : integer; XONChar: integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8XONChar Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal XONChar As Integer) As Integer
Parameters
ComNum Communication port.
XONChar XON character.
Return Value
See Also
K_R8XONChar returns the previously programmed protocol.
K_R8XOFFChar
Valid values: 0 to 31
4-44 Function Call Reference
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldProtoCall; ... OldProtoCall = K_R8XONChar (0, 0);
Turbo Pascal
{$I RISCOM8.INC} OldProtoCall : word; ... OldProtoCall:= K_R8XONChar (0, 0);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldProtoCall AS INTEGER ... OldProtoCall:= K_R8XONChar (0, 0)
K_R8XONChar (cont.)
4-45
K_R8XONProt
Purpose
Prototype C/C++
Specifies whether XON is enable or disabled for receive operation.
unsigned int pascal far K_R8XONProt (int ComNum, int ProtoCall);
Turbo Pascal
function K_R8XONProt (ComNum : integer; ProtoCall: integer) : word; far; external 'riscom8';
Visual Basic
Declare Function K_R8XONProt Lib "RISCOM8.DLL" (ByVal ComNum As Integer, ByVal ProtoCall As Integer) As Integer
Parameters
ComNum Communication port.
ProtoCall Status of XON.
Valid values: 0 to 31
Valid values:
Bit Value Description
0 0 Tx disabled
1 Tx enabled
1 0 Rx disabled
1 Rx enabled
Return Value
K_R8XONProt returns the previously programmed protocol. See the description of ProtoCall above for more information.
See Also
4-46 Function Call Reference
K_R8HandShakeProt
Usage C/C++
#include "RISCOM8.H" // Use "RISCOM8.HPP for C++ unsigned int OldProtoCall; ... OldProtoCall = K_R8XONProt (0, 2);
Turbo Pascal
{$I RISCOM8.INC} OldProtoCall : word; ... OldProtoCall:= K_R8XONProt (0, 2);
Visual Basic
(Include VBWDECL.BAS in your program make file)
DIM OldProtoCall AS INTEGER ... OldProtoCall:= K_R8XONProt (0, 2)
K_R8XONProt (cont.)
4-47
communication port
Index
A
Applications Engineering Department
B
base address baud rate bits
stop
word Borland C++ Borland Turbo Pascal for Windows buffer
receive
transmission buffer management operations
C
C languages
Borland C++
Microsoft QuickC
Microsoft Visual C++ C++
see Microsoft Visual C++ for Windows
CFGR8W.EXE character
reading
writing clearing the receive buffer clearing the transmission buffer
1-3
2-3
4-15
,
,
2-3
4-15
,
4-15
4-32
,
,
,
2-3
3-3
2-6
4-9
,
2-6
3-3
and Borland C++
,
1-2
2-4
4-20
,
2-4
4-24
,
4-26
4-34
4-4
,
3-1
1-3
4-36
,
3-2
2-6
2-6
4-3
,
2-6
3-4
,
1-3
4-4
initializing resetting
status of communication protocol configuration file
opening configuration program controlling the modem controlling the receiver controlling the transmitter creating an executable file
Borland C++
Borland Turbo Pascal for Windows
Microsoft QuickC
Microsoft Visual Basic for Windows
Microsoft Visual C++ CTS
2-3
2-3
2-2
2-2
2-2
,
,
,
2-4 1-3
4-5
3-3
4-15
,
4-11
1-3
2-5
3-1
,
2-3
2-5
4-21
2-5
3-2
D
2-3
2-5
,
2-5
2-4
4-13
,
4-22
,
2-3
4-38
,
data movement operations disabling handshaking disabling the receiver disabling the transmitter disabling XON operations
2-5
DTR
E
2-3
2-5
,
2-5
4-13
,
4-23
,
2-3
2-3
4-39
,
,
enabling handshaking enabling the receiver enabling the transmitter enabling XOFF operations enabling XON operations examples
1-1
4-46
4-42
4-44
,
4-46
3-4
3-4
X-1
F
functions
K_R8ClearRecBuf K_R8ClearTransBuf K_R8DevOpen K_R8GetModSignals K_R8GetNumRecChar K_R8GetStatus K_R8HandShakeProt K_R8Init 2-2, 4-15 K_R8ReadString 2-4, 4-18 K_R8ReceiveChar 2-4, 4-20 K_R8Reset 2-3, 4-21 K_R8RXDisable 2-5, 4-22 K_R8RXEnable 2-5, 4-23 K_R8SendChar 2-4, 4-24 K_R8SetBaudRate 2-3, 4-26 K_R8SetModSignals 2-5, 4-28 K_R8SetParity 2-3, 4-30 K_R8SetStopBits 2-3, 4-32 K_R8SetWordLen 2-3, 4-34 K_R8TransBufAvail 2-6, 4-36 K_R8TXDisable 2-5, 4-38 K_R8TXEnable 2-5, 4-39 K_R8WriteString 2-4, 4-40 K_R8XOFFChar 2-3, 4-42 K_R8XONChar 2-3, 4-44 K_R8XONProt 2-3, 4-46
2-2
2-4
2-6
4-5
,
,
4-11
2-6
H
handshaking 2-3, 4-13 help 1-3
,
2-5
2-6
2-3
4-3
,
4-4
,
,
4-7
,
4-9
4-13
I
initialization operations 2-1 initializing a communication port 2-2, 4-15,
4-21
initializing the driver 2-2 installing a RISCom-8 board 1-2 installing the software 1-2 interface type 1-3 interrupts 1-3 IRQ setting 1-3
K
K_R8ClearRecBuf 2-6, 4-3 K_R8ClearTransBuf 2-6, 4-4 K_R8DevOpen 2-2, 4-5 K_R8GetModSignals 2-5, 4-7 K_R8GetNumRecChar 2-6, 4-9 K_R8GetStatus 2-4, 4-11 K_R8HandShakeProt 2-3, 4-13 K_R8Init 2-2, 4-15 K_R8ReadString 2-4, 4-18 K_R8ReceiveChar 2-4, 4-20 K_R8Reset 2-3, 4-21 K_R8RXDisable 2-5, 4-22 K_R8RXEnable 2-5, 4-23 K_R8SendChar 2-4, 4-24 K_R8SetBaudRate 2-3, 4-26 K_R8SetModSignals 2-5, 4-28 K_R8SetParity 2-3, 4-30 K_R8SetStopBits 2-3, 4-32 K_R8SetWordLen 2-3, 4-34 K_R8TransBufAvail 2-6, 4-36 K_R8TXDisable 2-5, 4-38 K_R8TXEnable 2-5, 4-39 K_R8WriteString 2-4, 4-40 K_R8XOFFChar 2-3, 4-42 K_R8XONChar 2-3, 4-44 K_R8XONProt 2-3, 4-46
X-2 Index
L
Q
loopback connector 1-1 loopback plug 1-1
M
managing the receive buffer 2-6 managing the transmission buffer 2-6 Microsoft QuickC 3-1 Microsoft Visual Basic for Windows 3-4 Microsoft Visual C++ 3-2 modem signals
reading the status setting the state 2-5, 4-28
2-2, 2-4, 4-7
O
opening the configuration file 2-2, 4-5 operations
buffer management data movement 2-4 initialization 2-1 port control 2-5
2-6
P
Quick C
see Microsoft QuickC for Windows quick setup
1-2
R
reading a character 2-4, 4-20 reading a string 2-4, 4-18 reading data 2-4 reading the characters in the receive buffer
2-6
reading the characters in the transmission
buffer
reading the communication status 2-4 reading the status of the modem signals 2-5 receive buffer
clearing
reading the number of characters 2-6,
receiver
disabling
enabling 2-5, 4-23 resetting all communication ports 2-3 RS-232 1-3 RS-422/485 1-3 RTS 2-3, 2-5 running the configuration program 1-3
2-6, 4-36
2-6, 4-3
4-9
2-5, 4-22
parity 2-3, 4-15, 4-30 port control operations 2-5 programming
Borland C++ Borland Turbo Pascal for Windows 3-4 Microsoft QuickC 3-1 Microsoft Visual Basic for Windows 3-4 Microsoft Visual C++ 3-2
protocol 2-3
3-3
S
sending a character
see writing a character setting the base address setting the baud rate 2-3, 4-15, 4-26 setting the communication protocol 2-3 setting the interface type 1-3 setting the interrupt 1-3
1-3
X-3
setting the parity 2-3, 4-15, 4-30 setting the state of modem signals 2-5, 4-28 setting the stop bits 2-3, 4-15, 4-32 setting the word length 2-3, 4-15, 4-34 setting up the software 1-2 status
communication port modem signals 2-2, 2-4, 2-5, 4-7
stop bits 2-3, 4-15, 4-32 string
reading writing 2-4, 4-40
2-4, 4-18
2-2, 2-4, 4-11
T
technical support 1-3 transmission buffer
clearing reading the number of characters 2-6,
transmitter
disabling enabling 2-5, 4-39
Turbo Pascal
see Borland Turbo Pascal for Windows
2-6, 4-4
4-36
2-5, 4-38
W
word bits 4-15, 4-34 word length 2-3 writing a character 2-4, 4-24 writing a string 2-4, 4-40 writing data 2-4
X
XOFF
enabling XON
disabling
enabling 2-3, 4-44, 4-46
2-3, 4-42
2-3, 4-46
V
Visual Basic
see Microsoft Visual Basic for Windows
Visual C++
see Microsoft Visual C++ for Windows
X-4 Index
Loading...