ACQ2XX_API
Public Member Functions | Protected Attributes
Acq2xx Class Reference

Acq2xx class wraps all ACQ2xx functionality. More...

#include <acq2xx_api.h>

Public Member Functions

 Acq2xx (Transport *transport)
 Create a transport independent ACQ protocol object.
virtual ~Acq2xx ()
TransportgetTransport ()
STATUS setRoute (enum acq2xx_Dx dx, enum acq2xx_RoutePort in, enum acq2xx_RoutePort out, enum acq2xx_RoutePort out2=R_NONE, enum acq2xx_RoutePort out3=R_NONE)
 make a signal routing (connection).
STATUS setExternalClock (enum acq2xx__DIx dix, int div=1, enum acq2xx__DOx dox=DO_NONE)
 set External Clock definition.
STATUS setInternalClock (int hz, enum acq2xx__DOx dox=DO_NONE)
 set Internal Clock defiition.
STATUS getInternalClock (int &hz)
 get the actual Internal Clock frequency.
STATUS getAvailableChannels (int &maxChannels)
 get the number of channels on the card.
STATUS selectChannels (const char *channelMask)
 set the active channel mask.
STATUS getSelectedChannels (char *channelMask, int *count)
 get the actual effective channel mask.
STATUS getChannelRanges (acq2xx_VRange *ranges, int maxRanges)
 get a list of calibrated range values for each channel.
STATUS setPrePostMode (int prelen, int postlen, enum acq2xx__DIx dix=DI3, enum acq2xx__EDGE edge=EDGE_FALLING)
 configure the capture Mode.
STATUS setTriggeredPostMode (int postlen)
 configure a capture with POST samples only and a hard trigger
STATUS setSoftTriggeredMode (int postlen)
 configure a capture with SOFT TRIGGER.
STATUS setArm ()
 arm the card to start the capture.
STATUS setAbort ()
 abort a capture
STATUS getState (enum STATE &state)
 output card state.
STATUS waitState (enum STATE state, int timeout=10000)
 wait for selected State to occur, or timeout
STATUS getNumSamples (int *total, int *pre=0, int *post=0, int *elapsed=0)
 query current capture state.
STATUS readChannel (int channel, short *data, int nsamples, int start=0, int stride=1)
 read and output raw data for channel
STATUS readChannelVolts (int channel, float *data_volts, int nsamples, int start=0, int stride=1)
 read and output calibrated data for channel
STATUS readStreamingFrame (Frame *frame, unsigned id)
 For streaming data, read the frame.
STATUS stopStreaming (void)
 stops and clears up a previous streaming connection

Protected Attributes

Transporttransport
acq2xx_VRangeranges
int ai
int ao

Detailed Description

Acq2xx class wraps all ACQ2xx functionality.

Acq2xx uses a Transport instance to take care of communications, so the same Acq2xx class works with any Transport.

Definition at line 126 of file acq2xx_api.h.


Constructor & Destructor Documentation

Acq2xx::Acq2xx ( Transport transport)

Create a transport independent ACQ protocol object.

Definition at line 146 of file acq2xx_api.cpp.

virtual Acq2xx::~Acq2xx ( ) [inline, virtual]

Definition at line 136 of file acq2xx_api.h.


Member Function Documentation

STATUS Acq2xx::getAvailableChannels ( int &  maxChannels)

get the number of channels on the card.

Parameters:
maxChannels- output available channels.
Parameters:
maxChannelsget the number of channels on the card.
maxChannels- output available channels.

Definition at line 227 of file acq2xx_api.cpp.

References Transport::acqcmd(), ai, ao, ERR_SCAN2, REPLY, RETERR, STATUS_OK, and transport.

Referenced by main(), and readChannelVolts().

STATUS Acq2xx::getChannelRanges ( acq2xx_VRange ranges,
int  maxRanges 
)

get a list of calibrated range values for each channel.

Parameters:
ranges- user allocated buffer to hold values. index from 1
maxRanges- length of user buffer
Parameters:
maxRangesget a list of calibrated range values for each channel.
ranges- user allocated buffer to hold values.
maxRanges- length of user buffer

Definition at line 291 of file acq2xx_api.cpp.

References Transport::acq2sh(), ERR_SCAN2, RETERR, STATUS_OK, and transport.

Referenced by readChannelVolts().

STATUS Acq2xx::getInternalClock ( int &  hz)

get the actual Internal Clock frequency.

Parameters:
hz- output value
Parameters:
hzget the actual Internal Clock frequency.
hz- output value

Definition at line 211 of file acq2xx_api.cpp.

References Transport::acqcmd(), ERR_SCAN1, REPLY, RETERR, STATUS_OK, and transport.

Referenced by main().

STATUS Acq2xx::getNumSamples ( int *  total,
int *  pre = 0,
int *  post = 0,
int *  elapsed = 0 
)

query current capture state.

Parameters:
total- output total samples
pre- output pre trigger samples
post- output post- trigger samples
elapsed- output samples since arm NB: any param can be null, and is then ignored
Parameters:
elapsedquery current capture state.
total- output total samples
pre- output pre trigger samples
post- output post- trigger samples
elapsed- output samples since arm NB: any param can be null, and is then ignored

Definition at line 394 of file acq2xx_api.cpp.

References Transport::acqcmd(), response, RETERR, STATUS_OK, and transport.

Referenced by main().

STATUS Acq2xx::getSelectedChannels ( char *  channelMask,
int *  count 
)

get the actual effective channel mask.

Parameters:
channelMask- outputs the actual mask
count- outputs selected channel count
Parameters:
countget the actual effective channel mask.
channelMask- outputs the actual mask
count- outputs selected channel count

Definition at line 266 of file acq2xx_api.cpp.

References Transport::acqcmd(), ERR_SCAN1, REPLY, RETERR, STATUS_OK, and transport.

Referenced by main().

STATUS Acq2xx::getState ( enum STATE state)

output card state.

Parameters:
state- output state value.
Parameters:
stateoutput card state.
state- output state value.

Definition at line 366 of file acq2xx_api.cpp.

References Transport::acqcmd(), ERR_SCAN1, REPLY, RETERR, STATUS_OK, and transport.

Referenced by main().

Transport* Acq2xx::getTransport ( ) [inline]

Definition at line 140 of file acq2xx_api.h.

References transport.

Referenced by AcqType::getAcqType(), and main().

STATUS Acq2xx::readChannel ( int  channel,
short *  data,
int  nsamples,
int  start = 0,
int  stride = 1 
)

read and output raw data for channel

Parameters:
channel- channel number 1..N
data- caller's buffer
nsamples- max samples to read
start- start sample in data set
stride- stride [subsample] value
Returns:
actual samples returned or STATUS_ERR
Parameters:
strideread and output raw data for channel
channel- channel number 1..N
data- caller's buffer
nsamples- max samples to read
start- start sample in data set
stride- stride [subsample] value
Returns:
actual samples returned or STATUS_ERR

Definition at line 425 of file acq2xx_api.cpp.

References Transport::readChannel(), and transport.

Referenced by FetchesRaw::readChannel(), and readChannelVolts().

STATUS Acq2xx::readChannelVolts ( int  channel,
float *  data_volts,
int  nsamples,
int  start = 0,
int  stride = 1 
)

read and output calibrated data for channel

Parameters:
channel- channel number 1..N
data_volts- caller's buffer
nsamples- max samples to read
start- start sample in data set
stride- stride [subsample] value
Returns:
actual samples returned or STATUS_ERR
Parameters:
strideread and output calibrated data for channel
channel- channel number 1..N
data_volts- caller's buffer
nsamples- max samples to read
start- start sample in data set
stride- stride [subsample] value
Returns:
actual samples returned or STATUS_ERR

Definition at line 439 of file acq2xx_api.cpp.

References getAvailableChannels(), getChannelRanges(), nsamples, R1, ranges, readChannel(), RR, STATUS_ERR, STATUS_IS_OK, acq2xx_VRange::vmax, and acq2xx_VRange::vmin.

Referenced by FetchesVolts::readChannel().

STATUS Acq2xx::readStreamingFrame ( Frame frame,
unsigned  id 
)

For streaming data, read the frame.

Parameters:
frame- caller buffer to fill with data
id- previous frame # - id=0 means "start streaming"
Returns:
STATUS_OK or STATUS_ERR
Parameters:
idFor streaming data, read the frame
frame- caller buffer to fill with data
id- previous frame # - id=0 means "start streaming"
Returns:
STATUS_OK or STATUS_ERR

Definition at line 496 of file acq2xx_api.cpp.

References Transport::readStreamingFrame(), and transport.

Referenced by ConcreteDataStreamer< T >::streamData().

STATUS Acq2xx::selectChannels ( const char *  channelMask)

set the active channel mask.

NB not all masks are valid, hardware will select nearest mask that includes all channels.

Parameters:
channelMask- mask selects active channels 1=> enabled
Parameters:
channelMaskset the active channel mask. NB not all masks are valid, hardware will select nearest mask that includes all channels.
channelMask- mask selects active channels 1=> enabled

Definition at line 249 of file acq2xx_api.cpp.

References Transport::acqcmd(), CMD, REPLY, RETERR, STATUS_OK, and transport.

Referenced by main().

STATUS Acq2xx::setAbort ( )

abort a capture

Definition at line 356 of file acq2xx_api.cpp.

References Transport::acqcmd(), REPLY, RETERR, STATUS_OK, and transport.

Referenced by main().

STATUS Acq2xx::setArm ( )

arm the card to start the capture.

Definition at line 346 of file acq2xx_api.cpp.

References Transport::acqcmd(), REPLY, RETERR, STATUS_OK, and transport.

Referenced by main().

STATUS Acq2xx::setExternalClock ( enum acq2xx__DIx  dix,
int  div = 1,
enum acq2xx__DOx  dox = DO_NONE 
)

set External Clock definition.

Parameters:
dix- the signal
div- integer divide of dix
dox- optional output for divided signal
Parameters:
doxset External Clock definition.
dix- the signal
div- integer divide of dix
dox- optional output for divided signal

Definition at line 179 of file acq2xx_api.cpp.

References STATUS_WORKTODO.

STATUS Acq2xx::setInternalClock ( int  hz,
enum acq2xx__DOx  dox = DO_NONE 
)

set Internal Clock defiition.

Parameters:
hz- frequency in Hz
dox- output the clock on this line
Parameters:
doxset Internal Clock defiition.
hz- frequency in Hz
dox- output the clock on this line

Definition at line 190 of file acq2xx_api.cpp.

References Transport::acqcmd(), CMD, DO_NONE, REPLY, RETERR, STATUS_OK, toString(), and transport.

Referenced by main().

STATUS Acq2xx::setPrePostMode ( int  prelen,
int  postlen,
enum acq2xx__DIx  dix = DI3,
enum acq2xx__EDGE  edge = EDGE_FALLING 
)

configure the capture Mode.

Parameters:
prelen- number of samples before trigger
postlen- number of samples after trigger
dix- signal line for trigger
edge- sense of the signal
Parameters:
edgeconfigure the capture Mode.
prelen- number of samples before trigger
postlen- number of samples after trigger
dix- signal line for trigger
edge- sense of the signal

Definition at line 322 of file acq2xx_api.cpp.

References Transport::acq2sh(), CMD, DI_NONE, REPLY, RETERR, STATUS_OK, toString(), and transport.

Referenced by main(), setSoftTriggeredMode(), and setTriggeredPostMode().

STATUS Acq2xx::setRoute ( enum acq2xx_Dx  dx,
enum acq2xx_RoutePort  in,
enum acq2xx_RoutePort  out,
enum acq2xx_RoutePort  out2 = R_NONE,
enum acq2xx_RoutePort  out3 = R_NONE 
)

make a signal routing (connection).

"signal" is a digital control signal

Parameters:
dx- the signal
in- source: input port (one only)
out- sink: output port (up to 3).
Parameters:
out3make a signal routing (connection). "signal" is a digital control signal
dx- the signal
in- source: input port (one only)
out- sink: output port(s)

Definition at line 153 of file acq2xx_api.cpp.

References Transport::acq2sh(), CMD, REPLY, RETERR, STATUS_OK, toString(), and transport.

Referenced by main().

STATUS Acq2xx::setSoftTriggeredMode ( int  postlen) [inline]

configure a capture with SOFT TRIGGER.

Parameters:
postlen- number of samples to capture

Definition at line 221 of file acq2xx_api.h.

References DI_NONE, and setPrePostMode().

Referenced by main().

STATUS Acq2xx::setTriggeredPostMode ( int  postlen) [inline]

configure a capture with POST samples only and a hard trigger

Parameters:
postlen- number of samples after trigger

Definition at line 214 of file acq2xx_api.h.

References setPrePostMode().

Referenced by main().

STATUS Acq2xx::stopStreaming ( void  )

stops and clears up a previous streaming connection

Returns:
STATUS_OK or STATUS_ERR

Definition at line 506 of file acq2xx_api.cpp.

References Transport::stopStreaming(), and transport.

STATUS Acq2xx::waitState ( enum STATE  state,
int  timeout = 10000 
)

wait for selected State to occur, or timeout

Parameters:
state- state to wait for
timeout- timeout in msec
Parameters:
timeoutwait for selected State to occur, or timeout
state- state to wait for
timeout- timeout in msec

Definition at line 385 of file acq2xx_api.cpp.

References STATUS_WORKTODO.


Field Documentation

int Acq2xx::ai [protected]

Definition at line 131 of file acq2xx_api.h.

Referenced by getAvailableChannels().

int Acq2xx::ao [protected]

Definition at line 131 of file acq2xx_api.h.

Referenced by getAvailableChannels().

Definition at line 130 of file acq2xx_api.h.

Referenced by readChannelVolts().


The documentation for this class was generated from the following files: