PROCESS CONTROL TECHNOLOGY, INC.


COMPUTER SYSTEMS AND SOFTWARE FOR AUTOMATED CONTROL

HOME   PRODUCTS   SERVICES   COMPANY INFO   FEEDBACK  

SOFTWARE

DATA ACQUISITION LIBRARY (DAQLIB)

FOR UNIX

PROGRAM AND LIBRARY DESCRIPTION

The DAQLIB software package provides an interface between a UNIX Real-Time Operating System and Tustin data acquisition hardware. This package facilitates hardware integration and development of data acquisition software.

DAQLIB configuration requirements include a UNIX Real-Time Operating System, a Tustin Data System 2100, and a DR11W interface board to communicate with the Tustin System. The DAQLIB user should be familiar with the operation of the computer and its operating system, the Tustin data acquisition hardware and the interface hardware and driver.

The DAQLIB software package consists of three modules:

Both the Interface Library Routines and the Driver Library Routines are configured as data acquisition libraries based on a tightly coupled set of parameters which includes the computer and operating system version, interface type and driver, and Tustin data acquisition hardware.

The Interface Library includes routines to build and download scan lists, specify filter settings, set channel gains and/or calibration modes, etc. The Driver Library includes routines to initialize the data acquisition hardware, read/write to the device, acquire status, etc.

Source code for sample test programs is provided to assist the programmer in using the DAQLIB routines. DAQLIB also includes debugging features which enable or disable debug tracking dynamically. The debug data can be saved to a file or output to the screen.

Installation instructions and Reference Manual based on customer configuration are provided with DAQLIB package.

SAMPLE TEST PROGRAMS AND UTILITIES

DAQLIB includes test programs specific to the Tustin data acquisition hardware which enable the programmer to perform initial checking of the data acquisition system. Each program uses various DAQLIB library calls. In most instances, all subroutines associated with a single function are used in the test program.

Source code is included for all sample test programs to provide the programmer with coding examples of how to use the library calls, both individually and in association with other subroutines.

Table 1 contains a list of test programs provided for the Tustin Data System 2100 and a brief description of each program.

TABLE 1

SAMPLE TEST PROGRAMS AND UTILITIES

Program Name Description
test_cals Tests DAQLIB calibration subroutines and Tustin calibration registers.
test_default Provided as an example of how to set default values to be used by other subroutines.
test_filters Tests functionality of DAQLIB filter routines and Tustin filter registers.
test_gains Tests functionality of DAQLIB input gain subroutines and Tustin input gain registers.
test_regs Tests communications between the host computer and Tustin front-end by loading and reading back the contents of the Tustin registers.
test_scans Downloads the neccessary data and reads in scan data from the Tustin.
test_scanlist Builds a super-commutated scanlist, downloads the information, and reads back scanned data from the Tustin.

INTERFACE LIBRARY ROUTINES

The DAQLIB Interface Library Routines are library routines specific to the Tustin data acquisition hardware. These routines control the Tustin 2100 hardware, are independent of the host computer and the interface hardware, and provide the interface between the main module code and the driver level described below.

The Interface Library Routines are provided as a library module, interface.a. See Table 2 for a complete list of programs in the Interface Library.

DRIVER LIBRARY ROUTINES

The DAQLIB Driver Library Routines are a set of low level subroutines designed to control the communications interface device and its software driver. These routines are highly dependent upon the host computer and its operating system, and the interface device and its driver.

Some of the driver level subroutines are specifically written to handle communication with the Tustin data acquisition front end hardware in a manner that is host and interface dependent. Others are written to control the interface device itself and provide a level of separation between the programmer and lower level system calls.

The Driver Library Routines are provided in a library, dr11w.a. See Table 3 for a complete list of programs in the DR11W Driver Library.

TABLE 2

INTERFACE LIBRARY ROUTINES

Routine Name Calling Sequence Description
set_tustin_cal_voltage (tustin_fd, mvolts, tones) Set calibration supply to a standard voltage and enable tones
set_tustin_cal_mode (tustin_fd, no_chnls, mode) Set calibration mode
set_tustin_vcal (tustin_fd, no_chnls) Set all channels in scan list to Vcal state
set_tustin_all_vcal (tustin_fd) Set all input channels system wide to Vcal state
reset_tustin_cal (tustin_fd) Reset calibration supply and calibration bus
readback_tustin_cal (tustin_fd, no_cals, cal_words)R:7 C:2 Upload Tustin calibration memory
conv_tustin_cnts_mvs (no_cnts, counts, gains, mvolts) Convert values from counts to millivolts
conv_tustin_mvs_cnts (no_mvs, mvolts, gains, counts) Convert values from millivolts to counts
load_tustin_csr (tustin_fd, fcr, scr) Loads the Function Control Register (FCR) and the Serial Control Register (SCR)
read_tustin_csr (tustin_fd, fcr, rsr, ssr, scr) Request contents of the status registers: FCR, SCR, Run Status Register (RSR), and Setup Status Register (SSR)
daq_err (msg, action) Append and/or display messages
set_tustin_mode_bits (bit_mask) Set mode bits that augment the mode word sent to the Tustin
set_tustin_gains (pga_gains, input_gains, custom_gains) Specify which gains are enabled, how and what their values are
set_tustin_filters (prog_filters, base_filter, custom_filters) Set filter cutoff frequencies, their numbers and values
set_tustin_hardware (front_panel, rs232, cal_supply, max_slm, id_memory, pacer_freq) Set hardware options
set_tustin_converts (full_scale, adc_res, dac_res, max_conv_rate) Set data conversion values
set_tustin_defaults ( ) Use above routines to set default conditions
encode_tustin_gain (gain) Encode Tustin gain
decode_tustin_gain (code) Decode Tustin gain
encode_tustin_filters (filter) Encode Tustin filter
decode_tustin_filters (code) Decode Tustin filter
encode_tustin_cal (millivolts) Encode Tustin calibration value
decode_tustin_cal (code) Decode Tustin calibration value
download_tustin_filters (tustin_fd, no_filters, filters) Download cutoff filter frequency codes
readback_tustin_filters (tustin_fd, no_filters, filters) Readback filter frequency codes
set_all_tustin_filters (tustin_fd, filter) Set cutoff filter frequency for all channels in current scanlist to same value
reset_all_tustin_filters (tustin_fd) Set cutoff filter frequency for all channels in current scanlist to lowest available frequency
download_tustin_input_gains (tustin_fd, no_gains, gains) Download input gain codes
readback_tustin_input_gains (tustin_fd, no_gains, gains) Readback contents of the input gain memory
set_all_tustin_input_gains (tustin_fd, gain) Set the input gains for all channels in the current scanlist to same gain
reset_all_tustin_input_gains (tustin_fd) Set the input amplifiers for all channels in current scanlist to unity
set_tustin_idle (tustin_fd) Place Tustin in idle mode and set appropriate mode bits
set_tustin_output_control (tustin_fd) Enable Tustin for output control
load_tustin_pacer (tustin_fd, pacer_flags, frame_rate, burst_rate, frame_count) Load the Tustin pacer registers
set_tustin_pacer (tustin_fd, pacer_flags, frame_rate, burst_rate, frame_count) Similar to load_tustin_pacer, it will calculate the divisor values for the frame and burst rate registers
readback_tustin_pacer (tustin_fd, pacer_flags, lwr, hwr, brr, fcr) Read the Tustin pacer register information
read_tustin_scan (tustin_fd, buffer, bfr_len) Read Tustin scan data
reset_tustin (tustin_fd) Software reset of Tustin and set default flags
download_tustin_scanlist (tustin_fd, no_chnls, start_addr, channels, gains, sub_frame) Download scan list information needed to acquire data
readback_tustin_scanlist (tustin_fd, start_addr, no_chnls, channels, gains, sub_frames) Read back the contents of the scan list memory, starting address register and scan list size register
build_tustin_scanlist (channels, rates, gains, size, scanlist, gainlist, sub_frames, frame_counts, no_frames, burst, pace) Build a scan list with sub-frames
start_tustin_scans (tustin_fd) Send command to begin scanning of input data corresponding to previously downloaded information
stop_tustin_scans (tustin_fd) Send command to stop data input scanning
tustin_pause (msecs) Brief wait, pause for msecs before returning
wait_for_tustin_on_line (tustin_fd) Wait for Tustin to go to on-line status

TABLE 3

DRIVER LIBRARY ROUTINES

Routine Name Calling Sequence Description
init_tustin_port (device, fd, time) Initialize communications port
tustin_mode_write (tustin_fd, out_str, str_size) Send mode word data to the Tustin
tustin_write (tustin_fd, out_str, str_size) Send data to the Tustin
tustin_read (tustin_fd, in_str, str_size) Read data from the Tustin
check_tustin_off_line (tustin_fd) Determine on/off-line status of Tustin
set_tustin_word_mode (tustin_fd) Toggle the mode word flag, indicating next word transferred is a mode word
set_dr11w_funct (tustin_fd, reset_bits. set_bits) Set and reset DR11W function lines
get_dr11w_status (tustin_fd, csr, status_bits) Read the Control/Status Register and return the contents of csr and the weighted status bits
send_dr11w_cmd (tustin_fd, cmd) Send specified command
set_dr11w_dma (tustin_fd,dma) Set DMA single or multi mode
set_dr11w_timeout (tustin_fd, cmd, timeout) Set timeout period
wait_dr11w_attn (tustin_fd, status) Wait for attention, return 8 word status if non-null pointer passed
set_dr11w_attn (tustin_fd, read_attn, write_attn) Set read/write wait attention flag
set_dr11w_rfnc (tustin_fd, func_bits, func1, func2, func3) Set read function flags for 1, 2, and/or 3 as specified by func_bits
set_dr11w_wfnc (tustin_fd, func_bits, func1, func2, func3) Set write function flags for 1, 2, and/or 3 as specified by func_bits
set_dr11w_pio (tustin_fd, pio) Set single pio flag

Technical Specification Data for DAQLIB Version 1.0

Hardware Requirements:

  • Real-Time UNIX Operating System
  • DR11W Emulator Board
  • Tustin Data System 2100 (120K)
  • Cartridge Tape Device
  • 1800 blocks free disk space

    NOTE: PCT can port DAQLIB to most Unix Real-Time Operating Systems upon request.

    Software Requirements:

  • DR11W Driver DAQLIB/PC
    PROGRAM AND LIBRARY DESCRIPTION

    The DAQLIB software package provides an interface between an MS/DOS Operating System and Tustin data acquisition hardware. This package facilitates hardware integration and development of data acquisition software.

    DAQLIB configuration requirements include an IBM compatible PC with MS/DOS 3.3 or later, a, a Tustin Data System 2100, and a DR11W interface board to communicate with the Tustin System. The DAQLIB user should be familiar with the operation of the computer and its operating system, the Tustin data acquisition hardware and the interface hardware and driver.

    The DAQLIB software package consists of three modules:

  • Sample Test Programs and Utilities
  • Interface Library Routines
  • Driver Library Routines

    Both the Interface Library Routines and the Driver Library Routines are configured as data acquisition libraries based on a tightly coupled set of parameters which includes the computer and operating system version, interface type and driver, and Tustin data acquisition hardware.

    The Interface Library includes routines to build and download scan lists, specify filter settings, set channel gains and/or calibration modes, etc. The Driver Library includes routines to initialize the data acquisition hardware, read/write to the device, acquire status, etc.

    Source code for sample test programs is provided to assist the programmer in using the DAQLIB routines. DAQLIB also includes debugging features which enable or disable debug tracking dynamically. The debug data can be saved to a file or output to the screen.

    Installation instructions and Reference Manual based on customer configuration are provided with DAQLIB package.

    SAMPLE TEST PROGRAMS AND UTILITIES

    DAQLIB includes test programs specific to the Tustin data acquisition hardware which enable the programmer to perform initial checking of the data acquisition system. Each program uses various DAQLIB library calls. In most instances, all subroutines associated with a single function are used in the test program.

    Source code is included for all sample test programs to provide the programmer with coding examples of how to use the library calls, both individually and in association with other subroutines.

    Table 1 contains a list of test programs provided for the Tustin Data System 2100 and a brief description of each program.