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, INCIDENT AL,
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.
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
l
Preface
The ASO-CTM Quick Start User’s Guide describes how to get started
writing programs for CTM-10 and CTM-05/A boards using the
CTM-05/CTM-10 Function Call Driver. A 16-bit version of the
CTM-05/CTM-10 Function Call Driver is part of the CTM-05/A & 10
Advanced SW software (for Windows 3.1 and Windows 3.11 for
Workgroups). A 32-bit version of the CTM-05/CTM-10 Function Call
Driver is part of the ASO-CTM Win 95 32-Bit Drivers software (for
Windows 95 only).
The ASO-CTM Quick Start User’s Guide is intended for programmers
using a CTM-10 or CTM-05/A board in an IBM
PC AT
or compatible
computer. It is assumed that users are familiar with counter/timer and
digital I/O principles and have read the CTM-10 and CTM-05/A User’s
Guide to familiarize themselves with the board’s features.
The ASO-CTM Quick Start User’s Guide is organized as follows:
●
The CTM Disks describes the contents of the disks shipped with the
CTM-10 and CTM-05/A boards.
●
Setup and Installation describes how to install the software, how to
configure the boards, and how to use the control panel to test the
boards.
●
Summary of Functions contains a brief description of each of the
CTM-05/CTM-10 Function Call Driver functions. Refer to the CTM
FCD online help for a more detailed description of the functions.
(Both the 16-bit and 32-bit drivers offer the same set of functions.)
●
Programming Flow Diagrams contains a series of flow diagrams
showing the steps required to perform each of the operations
supported by the CTM-05/CTM-10 Function Call Driver. Refer to the
CTM FCD online help for a more detailed description of the required
procedures.
CTM-10 and CTM-05/A boards are shipped with the following disks:
CTM-10/05A Mode Software - Use this disk for DOS application
●
programs and for older Windows programs that use the Port I/O
software (PORTIO.DLL). Copy the files from this disk to an
appropriate directory. For more information, refer to FILES.TXT,
which lists and describes all the copied files; PORTIO.TXT, which
describes how to use the Port I/O software; and README.TXT. The
ASO-CTM Quick Start User’s Guide is not intended for use with this
software package.
CTM-05/A & 10 Advanced SW (16-bit software package) - Use
●
this disk for all 16-bit programs that use the CTM-05/CTM-10
Function Call Driver. The ASO-CTM Quick Start User’s Guide is
intended for use with this software package.
●
ASO-CTM Win95 32-Bit Drivers (32-bit software package) - Use
these two disks for all 32-bit, Windows 95-based programs that use
the CTM-05/CTM-10 Function Call Driver. The ASO-CTM Quick
Start User’s Guide is intended for use with this software package.
The CTM-05/A & 10 Adv anced SW package is intended for programmers
using the following 16-bit, Windows-based programming languages
running under Windows 3.1, Windows 3.11 for Workgroups, or Windows
95:
●
Microsoft
Borland
●
Microsoft Visual Basic
●
Visual C++ (Version 1.5x)
C/C++ (Versions 4.0 and 4.5)
for Windows, Version 3.0 and Version 4.0
(16-bit version, available only with the Professional and Enterprise
Editions)
1
The ASO-CTM Win95 32-Bit Drivers package is intended for
programmers using the following 32-bit, Windows − based programming
languages running under Windows 95:
Microsoft Visual C++ (Version 4.1)
●
Borland C/C++ (Version 5.0)
●
●
Microsoft Visual Basic for Windows, Version 4.0 (32-bit version,
available with all editions)
Note:
Unless otherwise noted, references to the CTM-05/CTM-10
Function Call Driver include both the 16-bit and 32-bit drivers.
2The CTM Disks
Setup and Installation
Before you use the CTM-05/CTM-10 Function Call Driver to program
your CTM-10 and CTM-05/A boards, perform the following tasks:
1. Unpack and inspect your CTM-10 and CTM-05/A boards. Refer to
the CTM-10 and CTM-05/A User’s Guide for information.
2. Install the software package that is appropriate to your operating
system and programming environment. Refer to the next section,
"Installing the Software," for installation instructions.
3. Configure your CTM-10 and CTM-05/A boards by specifying the
appropriate configuration options in the CTM-05/CTM-10
Configuration Utility and by setting the jumpers and switches on the
boards appropriately . Refer to “Configuring the Boards” on page 5 for
information.
4. Install the CTM-10 and CTM-05/A boards in your computer and
attach the appropriate signals. Refer to the CTM-10 and CTM-05/A
User’s Guide for information.
5. Test the functions of the CTM-10 and CTM-05/A boards using the
CTM-05/CTM-10 Control Panel. Refer to “Using the Control Panel”
on page 9 for information.
6. Look at the example programs provided with your software package.
Refer to the FILES.TXT file in the installation directory for a list and
description of the example programs.
Installing the Software
To install the software, perform the following steps:
1. Make a back-up copy of the appropriate disk (CTM-05/A & 10
Advanced SW for 16-bit programs or ASO-CTM Win95 32-Bit
Drivers for 32-bit programs). Use the copy as your working disk and
store the original as a backup disk.
2. Insert the disk into the disk drive.
3
3. Start Windows, if necessary.
4. Invoke the SETUP.EXE installation utility.
Assuming that you are using disk drive A, click Run on the File menu
(for Windows 3.1 or Windows 3.11 for Workgroups) or on the Start
menu (for Windows 95), type the following at the command line in
the Run dialog box, and click OK :
A:SETUP
The installation program prompts you for your installation
preferences, including which languages you will be using and the
drive and directory where you want to copy the software.
Note:
If you want to use both the 16-bit and 32-bit software
packages, make sure that you install them in different directories
because the file names are exactly the same for both versions . The
installation programs assign different titles only to the program
groups.
5. Respond to the prompts, as appropriate.
When the installation program prompts you for a drive designation,
enter the appropriate drive or accept the default drive C. When the
installation program prompts you for a directory name, enter the
appropriate name or accept the default name.
The installation program creates a directory on the specified drive and
copies all files, expanding any compressed files. The installation
program also creates a program group for the software package,
which contains icons for the CTM-05/CTM-10 Configuration Utility ,
CTM-05/CTM-10 Control Panel, example Windows programs, and
CTM-05/CTM-10 Function Call Driver online help.
6. When the installation program notifies you that the installation is
complete, review the following:
–Files.Txt lists and describes all the files copied to the hard disk by
the installation program.
–Readme.Txt contains last-minute information that was not
included in the online help file.
4Setup and Installation
–CTM FCD Help provides the information needed to write
programs for CTM-10 and CTM-05/A boards using the
CTM-05/CTM-10 Function Call Driver.
Configuring the Boards
You can configure the following items for CTM-10 and CTM-05/A
boards:
Board name
●
●
Base address
Time base
●
●
Interrupt level(s)
Table 1 lists the items that are configurable for each CTM-10 or
CTM-05/A board, the available options, and whether you set the options
by using the CTM-05/CTM-10 Configuration Utility, by setting switches
and jumpers on the boards, or by both.
Table 1. Configuring CTM-10 and CTM-05/A Boards
Where Options are Set
AttributeOptions
Board nameCTM-05/A, CTM-104
Base address
1
100h to 3F8h44
Time base1 MHz, 5 MHz4
Interrupt level(s)
2
Utility: 0 (disabled), 3, 5, 7, 10, 11, 15
Onboard: X (disabled), 2, 3, 4, 5, 6, 7
Notes
1
For a CTM-10, the base address is the first of eight consecutive address locations; for a CTM-05/A,
the base address is the first of four consecutive address locations. The setting in the configuration
utility must match the setting of the Base Address DIP switch (S1) on the board.
2
For a CTM-10, you set two interrupt levels - one for each counter/timer device on the board. If you
are not using interrupts, you must disable them in the configuration utility and on the IRQ Level
jumper (J3) on the board. If you are using interrupts, you must set a level in the utility and on the
board; however, the levels do not have to match.
UtilityOnboard
44
5
Using the Configuration Utility
The CTM-05/CTM-10 Function Call Driver requires that you specify the
configuration options for each CTM-10 or CTM-05/A board you are
using in the CTM-05/CTM-10 Configuration Utility. The configuration
utility is provided in the 16-bit and 32-bit software packages.
The configuration utility differentiates between physical boards and
logical boards. The first physical board (CTM-10 or CTM-05/A) that you
configure with the configuration utility is physical board 1, the second
physical board that you configure is physical board 2, and so on. Each
counter/timer device (Unit A or Unit B) and each digital I/O port (Port A
or Port B) on a physical board is a separate logical board. For example, if
you are using three CTM-10 boards, you configure three physical boards
(1, 2, and 3) and six logical boards. Unit/Port A on physical board 1 is
logical board 0, Unit/Port B on physical board 1 is logical board 1,
Unit/Port A on physical board 2 is logical board 2, and so on.
By default, the configuration utility assumes that you are using one
CTM-05/A, configured as shown in Table 2.
Table 2. Default Configuration
AttributeDefault Configuration
Physical board number1
Board nameCTM-05/A
Base address 300h
Unit/Port ALogical board 0
Unit/Port BNot applicable
Time base 1 MHz
Interrupt level (Unit/Port A) 0 (disabled)
Interrupt level (Unit/Port B) Not applicable
6Setup and Installation
If you are using one CTM-05/A board and the default options are
appropriate for your application, you can skip the rest of this section. If
you are using additional boards and/or if the default options are not
appropriate for your application, you must use the CTM-05/CTM-10
Configuration Utility (CFGCTM05.EXE) to modify the configuration
options.
To use the configuration utility, perform the following steps:
1. Invoke the CTM-05/CTM-10 Configuration Utility as appropriate to
your operating system:
– Windows 3.1 or Windows 3.11 for Workgroups - From the
ASO-CTM program group in Windows Program Manager,
double-click the CTM-05/CTM-10 Configuration Utility icon.
– Windows 95 - Click Start , point to Programs and then to the
appropriate CTM-05/CTM-10 program folder. Click the
CTM-05/CTM-10 Configuration Utility icon.
The software displays the CTM-05/CTM-10 Configuration panel
with the default configuration options shown.
2. Modify the configuration options for physical board 1. The physical
board number is displayed next to Number . The logical board
number(s) are displayed in the Logical Brd Assignment box.
For more information about the meaning of the configuration options,
refer to the online help.
3. If you want to configure another physical board, click the Number
up-arrow. The software asks you to confirm that you want to
configure another physical board; go to step 4.
If you do not want to configure another physical board, go to step 7.
4. Click Yes . The software updates the physical and logical board
numbers.
5. Modify the configuration options for the next physical board.
6. Repeat steps 3 to 5 for any additional boards you want to configure.
Note:
At any time, you can click New on the File menu to return all
options to their default settings.
7
7. To save the new settings without exiting the configuration utility,
click Save on the File menu.
To save the new settings and exit the configuration utility, click Save
and exit .
To exit the configuration utility without saving the new settings, click
Exit .
Note:
store your configuration options. Do not modify CTSHELL.INI directly.
Always use the configuration utility to change your configuration options,
when necessary.
The configuration utility creates a file called CTSHELL.INI to
Setting Switches and Jumpers on the Boards
Use the Base Address DIP switch (S1) to specify a base address from
100h to 3F8h. For a CTM-10, the base address is the first of eight
consecutive address locations; for a CTM-05/A, the base address is the
first of four consecutive address locations. The setting of the Base
Address DIP switch must match the base address setting in the
CTM-05/CTM-10 Configuration Utility.
If desired, you can use the Show Switch button in the configuration utility
to display the switch setting corresponding to the setting you selected in
the configuration utility. You can use this display as a reference when
setting the switch on the board.
If you are planning to use interrupts, use the IRQ Level jumper (J3) to set
an interrupt level of 2, 3, 4, 5, 6, or 7. Note that the interrupt le vel does not
have to match the interrupt level setting in the CTM-05/CTM-10
Configuration Utility.
If you are not planning to use interrupts, you can disable interrupts by
setting the IRQ Level jumper to the X position.
Refer to the CTM-10 and CTM-05/A User’s Guide for more information
about setting switches and jumpers on the boards.
8Setup and Installation
Using the Control Panel
The CTM-05/CTM-10 Control Panel, shipped with the ASO-CTM
software packages, is a utility program that allows you to test the
functions of your CTM-10 and CTM-05/A boards.
To use the control panel, perform the following steps:
1. Invoke the CTM-05/CTM-10 Control Panel as appropriate to your
operating system:
– Windows 3.1 or Windows 3.11 for Workgroups - From the
ASO-CTM program group in Windows Program Manager,
double-click the CTM-05/CTM-10 Control Panel icon.
– Windows 95 - Click Start , point to Programs and then to the
appropriate CTM-05/CTM-10 program folder. Click the
CTM-05/CTM-10 Control Panel icon.
The software displays the Setup Information panel for logical board
0. The board name, base address, interrupt level, and time base for
logical board 0 are shown.
2. Under Board Number , click the number of the logical board you
want to test. The software updates the board information as
appropriate.
3. At the bottom of the control panel, click the tab that indicates the
operation you want to perform ( EC for event counting, FM for
frequency measurement, PO for pulse output, or DIO for digital I/O).
The software displays the panel for the operation you selected.
4. Set up the operation appropriately. For more information, refer to the
online help.
5. Click Start to perform the operation. The results of the operation are
displayed on the panel.
6. If necessary, click Stop to stop the operation.
7. If you want to perform another operation, repeat steps 3 through 6.
If you want to test another board, click the Setup tab at the bottom of
the control panel and then repeat steps 2 through 6.
8. To exit the control panel, click Exit on the File menu.
9
Summary of Functions
The functions included in the CTM-05/CTM-10 Function Call Driver are
described in Table 3. These functions are included in both the 16-bit and
32-bit drivers. Refer to the CTM FCD online help for details.
Table 3. Summary of Functions
Type of Function Name of FunctionDescription
Initialization CT_OpenDriver Initializes a Function Call
Driver.
CT_CloseDriver Closes a Function Call
Driver.
CT_GetDevHandle Initializes a board.
CT_FreeDevHandle Frees a device handle.
CT_DevInit Reinitializes a board.
Frame management CT_GetECFrame Accesses an event counting
frame.
CT_GetFMFrame Accesses a frequency
measurement frame.
CT_GetPOFrame Accesses a pulse output
frame.
CT_FreeFrame Frees a frame.
CT_ClearFrame Sets frame elements to
default values.
11
Table 3. Summary of Functions (cont.)
Type of Function Name of FunctionDescription
Operation CT_Start Starts a single-frame
counter/timer operation.
CT_StatusGets the status and value of a
single-frame counter/timer
operation.
CT_Stop Stops a single-frame
counter/timer operation.
CT_StartMultiple Starts a multiple-frame
counter/timer operation.
CT_StatusMultiple Gets the status and value of a
multiple-frame counter/timer
operation.
CT_StopMultiple Stops a multiple-frame
counter/timer operation.
Interrupt CT_IntEnable Enables the generation of a
Windows event.
CT_IntDisable Disables the generation of a
Windows event.
Event counting CT_SetChn Specifies the counter/timer
channel used to count events.
CT_SetEdgePol Specifies the type of events
to count.
CT_SetECMode Specifies the event counting
mode (continuous or
counted), the size of the
counter (16 bits or 32 bits),
and the number of events to
count (counted mode only).
CT_SetGateEnable Enables/disables an external
gate.
CT_SetGatePol Specifies the gate polarity.
CT_SetStartTrigEnable Enables/disables an external
trigger.
CT_SetStartTrigPol Specifies the trigger polarity.
12Summary of Functions
Table 3. Summary of Functions (cont.)
Type of Function Name of FunctionDescription
13
Frequency
measurement
CT_SetChn Specifies the counter/timer
channel used to count events.
CT_SetFMPeriodChn Specifies the counter/timer
channel used to keep track of
the sampling period.
CT_SetEdgePol Specifies the type of events
to count.
CT_SetFMMode Specifies the frequency
measurement mode (single or
continuous).
CT_SetPeriod Specifies the sampling
period.
CT_GetPeriod Gets the sampling period.
CT_SetGateEnable Enables/disables an external
gate.
CT_SetGatePol Specifies the gate polarity.
CT_SetStartTrigEnable Enables/disables an external
trigger.
CT_SetStartTrigPol Specifies the trigger polarity.
Pulse output CT_SetChn Specifies the counter/timer
channel from which pulses
are generated.
CT_SetPOMode Specifies the type of pulse
output (continuous or single).
CT_SetPOHigh Specifies the length of the
first (high) pulse.
CT_SetPeriod Specifies the length of the
period.
CT_GetPOHigh Gets the length of the first
(high) pulse.
CT_GetPeriod Gets the length of the period.
CT_SetGateEnable Enables/disables an external
gate.
Table 3. Summary of Functions (cont.)
Type of Function Name of FunctionDescription
Pulse output
(continued)
Digital input/outputCT_DIReadReads a single digital input
Miscellaneous CT_GetErrMsg Gets the address of an error
CT_SetGatePol Specifies the gate polarity.
CT_SetStartTrigEnable Enables/disables an external
trigger.
CT_SetStartTrigPol Specifies the trigger polarity.
value.
CT_DOWriteWrites a single digital output
value.
message string.
CT_GetVer Gets revision numbers.
CT_GetShellVer Gets the current shell
version.
14Summary of Functions
Programming Flow Diagrams
This section contains a series of programming flow diagrams showing the
steps required to perform each of the operations supported by the
CTM-05/CTM-10 Function Call Driver. Although error checking is not
shown in the flow diagrams, it is recommended that you check the
error/status code returned by each function used in your application
program.
Preliminary Steps for All Operations
Install all required files
Declare and initialize
program variables
Initialize the driver
(CT_OpenDriver)
Initialize a board
(CT_GetDevHandle)
Using
another
board?
No
Perform the steps appropriate to
your operation (see the
operation-specific flow diagrams)
Yes
15
Steps for Event Counting Operations
Access a frame
(CT_GetECFrame)
Performing
another event
counting
operation?
No
Specify the event counting mode for each frame (operation)
(CT_SetECMode)
Specify the channel for each frame (operation)
(CT_SetChn)
Specify the type of events to count f or each frame (oper ation)
(CT_SetEdgePol)
Using an
external
gate?
No
Yes
Yes
Enable the external gate
and specify the polarity
(CT_SetGateEnable and
CT_SetGatePol)
Using an
external
trigger?
No
Continued on next
page
Yes
Enable the external trigger and
specify the polarity
(CT_SetStartTrigEnable and
CT_SetStartTrigPol)
16Programming Flow Diagrams
Steps for Event Counting Operations (cont.)
From previous page
17
Generating
a Windows
event?
No
Performing
multiple
operations
simultaneously?
No
Declare variable to store
number of events counted
Start the operation
(CT_Start)
Monitor the status and read
current number of events
(CT_Status)
Yes
Yes
Enable Windows events
(CT_IntEnable)
Dimension frame, status,
and value arrays
Load frame handles into
frame array
Start operations
(CT_StartMultiple)
Monitor status and read
current number of events
(CT_StatusMultiple)
Using
continuous
mode?
No
Free frames
(CT_FreeFrame)
Yes
Stop operations
(CT_Stop or
CT_StopMultiple)
Steps for Frequency Measurement Operations
Access a frame
(CT_GetFMFrame)
Performing
another
frequency
operation?
No
Specify the measurement channel for each frame (operation)
(CT_SetChn)
Using next
channel as
period
channel?
No
Specify the period channel for each frame (operation)
(CT_SetFMPeriodChn)
Specify the polarity for each frame (operation)
(CT_SetEdgePol)
Yes
Yes
Specify the frequency measurement mode for each frame (operation)
(CT_SetFMMode)
Continued on next
page
18Programming Flow Diagrams
Steps for Frequency Measurement Operations (cont.)
Continued from
previous page
Specify the sampling period for each frame (operation)
(CT_SetPeriod)
19
Using an
external
gate?
No
Using an
external
trigger?
No
Generating
a Windows
event?
No
Continued on
next page
Yes
Yes
Yes
Enable the external gate
and specify the polarity
(CT_SetGateEnable and
CT_SetGatePol)
Enable the external trigger
and specify the polarity
(CT_SetStartTrigEnable and
CT_SetStartTrigPol)
Enable Windows events
(CT_IntEnable)
Steps for Frequency Measurement Operations (cont.)
Continued from
previous page
Performing
multiple
operations
simultaneously?
No
Yes
Dimension frame, status,
and value arrays
Load frame handles into
frame array
Declare variable to
store the frequency
Start the operation
(CT_Start)
Monitor the status and read
the frequency
(CT_Status)
Using
continuous
mode?
No
Free frames
(CT_FreeFrame)
Yes
Start operations
(CT_StartMultiple)
Monitor status and read
the frequency
(CT_StatusMultiple)
Stop operations
(CT_Stop or
CT_StopMultiple
20Programming Flow Diagrams
Steps for Pulse Output Operations
Access a frame
(CT_GetPOFrame)
Performing
another
pulse output
operation?
No
Specify the pulse output mode for each frame (operation)
(CT_SetPOMode)
Specify the channel for each frame (operation)
(CT_SetChn)
Specify the length of the first (high) pulse
(CT_SetPOHigh)
Using
continuous
mode?
No
Yes
Yes
Specify the length of the period for
each frame (operation)
(CT_SetPeriod)
Continued on next
page
21
Steps for Pulse Output Operations (cont.)
Continued from
previous page
Using an
external
gate?
No
Enable the external gate and specify the
Yes
polarity
(CT_SetGateEnable and CT_SetGatePol)
Using an
external
trigger?
No
Performing
multiple
operations
simultaneously?
No
Start the operation
(CT_Start)
Monitor the operation
(CT_Status)
Using
continuous
mode?
Yes
Yes
Enable the external trigger and
specify the polarity
(CT_SetStartTrigEnable and
CT_SetStartTrigPol)
Yes
Dimension frame and
status arrays
Load frame handles into
Start operations
(CT_StartMultiple)
Monitor operations
(CT_StatusMultiple)
Stop operations
(CT_Stop or
CT_StopMultiple)
frame array
No
Free frames
(CT_FreeFrame)
22Programming Flow Diagrams
Steps for Digital Input and Digital Output Operations
Digital Input Operations
Declare a variable to store
input value
Perform the operation
(CT_DIRead)
Read the input value
Digital Output Operations
Declare a variable to store
output value
Load variable with
digital output value
Perform the operation
(CT_DOWrite)
23
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.