cpci_init

Synopsis

    
    #include "analogic.h"
    
    Server_Def *cpci_init( char *name );
    int cpci_setup( Server_Def *cpci, analogic_setup_t *setup );
    int cpci_stop( Server_Def *cpci );
    int cpci_quit( Server_Def *cpci );
    

Description

These functions provide an API for controlling the drivers for the Analogic high-speed A/D boards. The boards we are supporting are called the CPCI-16 and the CPCI-14, so I have used the 'cpci' prefix for these functions. Of course 'cpci' refers to the form factor, "Compact PCI", and is not specific to Analogic or A/D conversion, but I'll ignore that for lack of a better short mnemonic.

Since we anticipate supporting more than one board in a system, we will likewise anticipate more than one server in a system. Whereas other client APIs in nortlib can maintain a single static Server_Def structure out of view, we'll need to create them dynamically. cpci_init() performs this dynamic creation, taking a single argument, the server's short name, e.g. "cpci14". The programmer may choose to call CltInit() after callingcpci_init(), although that is optional.

cpci_setup() requests that the driver configure the board for data acquisition using the parameters in the setup structure. The structure is defined as:

    typedef struct {
      unsigned long FSample;
      unsigned long NSample;
      unsigned long NReport;
      unsigned long NAvg;
      unsigned short NCoadd;
      unsigned short FTrigger;
      unsigned short Options;
    } analogic_setup_t;

FSample is the sample frequency in Hz. This rate must be supported by the selected board.

NSample is the number of samples to take per trigger at the specified sample frequency.

NReport is how many points to report. This should be equal to or evenly divide NSample.

NAvg applies when Fit Analysis is selected. It defines the number of sequential reduced data points that are averaged together into each report bin. NAvg*NReport*NCoadd*NSample is the total number of raw points that would go into a report with Fit Analysis. Without Fit Analsys, only NCoadd*NSample raw samples are required.

NCoadd is the number of passes that should be coadded into the report before it is recorded. Coadding is essentially vector addition for summing repeating waveforms.

Options is a bit-mapped word that selects which channels should be collected and/or reported and whether a specific analysis should be performed on the data. The bits are:

    ANLG_OPT_A:   Collect Channel A
    ANLG_OPT_B:   Collect Channel B
    ANLG_OPT_C:   Collect Channel C
    ANLG_OPT_D:   Collect Channel D
    ANLG_OPT_FIT: Perform time constant analysis

OPT_FIT applies to the CPCI14 only and is used in ringdown modes to reduce the ringdowns to a single time constant. OPT_C and OPT_D are only valid with the CPCI16, since the CPCI14 only has two channels.

cpci_stop() requests the driver to suspend data acquisition. This is required before reconfiguring the board.

cpci_quit() requests the driver to terminate.

See Also

CltInit().

Source File

/usr/local/src/nortlib/analogic.c

Alphabetical List
Subject List
Return to Manuals Page
webmaster@huarp.harvard.edu
Copyright 2001 by the President and Fellows of Harvard College