|
ACQ2XX_API
|
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 () |
| Transport * | getTransport () |
| 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 | |
| Transport * | transport |
| acq2xx_VRange * | ranges |
| int | ai |
| int | ao |
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.
| 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.
| STATUS Acq2xx::getAvailableChannels | ( | int & | maxChannels | ) |
get the number of channels on the card.
| maxChannels | - output available channels. |
| maxChannels | get 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.
| ranges | - user allocated buffer to hold values. index from 1 |
| maxRanges | - length of user buffer |
| maxRanges | get 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 | ) |
| STATUS Acq2xx::getNumSamples | ( | int * | total, |
| int * | pre = 0, |
||
| int * | post = 0, |
||
| int * | elapsed = 0 |
||
| ) |
query 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 |
| elapsed | query 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.
| channelMask | - outputs the actual mask |
| count | - outputs selected channel count |
| count | get 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.
| state | - output state value. |
| state | output 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
| channel | - channel number 1..N |
| data | - caller's buffer |
| nsamples | - max samples to read |
| start | - start sample in data set |
| stride | - stride [subsample] value |
| stride | read 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 |
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
| 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 |
| stride | read 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 |
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.
| frame | - caller buffer to fill with data |
| id | - previous frame # - id=0 means "start streaming" |
| id | For streaming data, read the frame |
| frame | - caller buffer to fill with data |
| id | - previous frame # - id=0 means "start streaming" |
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.
| channelMask | - mask selects active channels 1=> enabled |
| channelMask | set 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.
| dix | - the signal |
| div | - integer divide of dix |
| dox | - optional output for divided signal |
| dox | set 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.
| hz | - frequency in Hz |
| dox | - output the clock on this line |
| dox | set 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.
| prelen | - number of samples before trigger |
| postlen | - number of samples after trigger |
| dix | - signal line for trigger |
| edge | - sense of the signal |
| edge | configure 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
| dx | - the signal |
| in | - source: input port (one only) |
| out | - sink: output port (up to 3). |
| out3 | make 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.
| 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
| 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
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
| state | - state to wait for |
| timeout | - timeout in msec |
| timeout | wait 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.
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().
acq2xx_VRange* Acq2xx::ranges [protected] |
Definition at line 130 of file acq2xx_api.h.
Referenced by readChannelVolts().
Transport* Acq2xx::transport [protected] |
Definition at line 129 of file acq2xx_api.h.
Referenced by getAvailableChannels(), getChannelRanges(), getInternalClock(), getNumSamples(), getSelectedChannels(), getState(), getTransport(), readChannel(), readStreamingFrame(), selectChannels(), setAbort(), setArm(), setInternalClock(), setPrePostMode(), setRoute(), and stopStreaming().
1.7.4