Instruction manual
Table Of Contents
- INTRODUCTION
- GETTING STARTED
- MAKING THE CONNECTIONS
- USING THE PC215E
- STRUCTURE AND ASSIGNMENTS OF THE REGISTERS
- Register Assignments
- Register Groups
- The Register Details
- Programmable Peripheral Interface PPI-X Data Register Port A
- Programmable Peripheral Interface PPI-X Data Register Port B
- Programmable Peripheral Interface PPI-X Data Register Port C
- Programmable Peripheral Interface PPI-X Command Register
- Programmable Peripheral Interface PPI-Y Data Register Port A
- Programmable Peripheral Interface PPI-Y Data Register Port B
- Programmable Peripheral Interface PPI-Y Data Register Port C
- Programmable Peripheral Interface PPI-Y Command Register
- Z1 Counter 0 Data Register
- Z1 Counter 1 Data Register
- Z1 Counter 2 Data Register
- Counter/Timer Z1 Control Register
- Z1 Counter/Timer Status Register
- Z2 Counter 0 Data Register
- Z2 Counter 1 Data Register
- Z2 Counter 2 Data Register
- Counter/Timer Z2 Control Register
- Z2 Counter/Timer Status Register
- Group Z Clock Connection Register
- Group Z Gate Connection Register
- Interrupt Source Selection Register
- Interrupt Status Register
- PROGRAMMING THE PC215E
- Copyright
- Files installed from the Distribution Diskette
- Windows DLL and Examples
- DOS 'C' Library and Examples
- Using the Dynamic Link Library
- Windows and DOS Library Functions
- Initialisation Functions
- Interrupt Control Functions
- Data Buffer Functions
- Timer/Counter Functions
- Differential Counter Functions
- Frequency Generation Functions
- Millisecond Stopwatch Functions
- Frequency Input and Output Functions
- Digitally- and Voltage-Controlled Oscillator Functions
- Digital Input/Output Functions
- Switch Scanner Matrix Functions
- Bi-Directional Data Bus Functions
- PC215E Library Error Codes
- PC215E Interface Guide For LABTECH NOTEBOOK
- Guide to User Programming
- Signal Centre
- CONTENTS
- DECLARATION OF CONFORMITY

Page
57
PC215E
• Double-click on the empty Form1 design window to bring up the code window for the
Form_Load() subroutine. At runtime, this routine will get called when the program first
starts up.
• Type the following lines into the Form_Load() subroutine:
hBoard = ERRSUPPORT
Load REGISTER
REGISTER.Show modal
Unload REGISTER
These lines of code will cause the Board Registration dialog box to pop up so that the
PC215E board can be registered with the DLL.
• Put away the code window, and select the Form1 design window
• Select 'Window|Menu Design...' to bring up the dialog box from which you design the
form's menubar. Type 'Exit' as the caption and 'mnuExit' as the name for the first
menu bar item, then click on OK to put the dialog box away.
• The menubar will now appear in the Form1 design window. Click on the 'Exit' item to
bring up the code window for the mnuExit_Click() subroutine. At runtime, this routine
will get called whenever the 'Exit' menu is selected.
• Type the following lines into the mnuExit_Click() subroutine:
Dim e As Integer
e = freeBoard( hBoard )
if e <> OK then
Call ReportError( e )
End If
End
These lines of code un-registers the board from the DLL as the program closes.
These eight steps will create the shell of a VB application that can now be run. The program at
this stage does nothing more than register a PC215E board (or any other board in the PC214E,
PC215E, PC212E, PC218E and PC272E series) with the DLL on start-up, and free that board
on exit.
Section 6.6 describes the library functions available. Where arguments to functions are
described as pointers, the address of a user-declared variable is required. This is taken care of
automatically by Visual Basic because all arguments to the DLL functions are passed by
reference, unless the 'ByVal' prefix is used on an argument in the function declaration in the
DLL's Visual Basic include file, DIO_TC.BAS. For example, function
TCgetCount
requires a
pointer to a variable declared as long, into which the count value result will be placed. A typical
VB code example for displaying the Z1 Counter 0 count value would be
Dim count As Long ' declare count as long
i = TCgetCount( h, Z1, 0, count )
Text1.Text = Str$( count ) ' count now contains new value