ACQ2XX_API
Data Structures | Defines | Enumerations | Functions | Variables
acqread.cpp File Reference

channel upload example using API. More...

#include "local.h"
#include <errno.h>
#include "acq2xx_api.h"
#include "acq_transport.h"
#include "popt.h"

Go to the source code of this file.

Data Structures

class  FetchesData
class  FetchesRaw
class  FetchesVolts
class  ChannelReader

Defines

#define MAXBUF   1024
#define DBUF   0x100000

Enumerations

enum  IARG { I_CHANNEL, I_LENGTH, I_START, I_STRIDE }

Functions

static void channel_decode (const char *range)
int main (int argc, const char **argv)

Variables

int acq200_debug
char * device
poptContext opt_context
char command [MAXBUF] = {}
char response [MAXBUF] = {}
short dbuf [DBUF]
int channel1 = 1
int channel2 = 1
int start = 0
int length = 0
int stride = 1
const char * outfile = "-"

Detailed Description

channel upload example using API.

usage: acqread [opts] ch1[..chN] [length] [start] [stride]

example:


# localhost:10009 is an ssh port-forward tunnel to target:53504

# read raw data channels 1-8, 1000 samples

./x86/bin/acqread -o /tmp/data.%02d -f localhost:10009 1-8 1000
ls -l /tmp/data.0?
-rw-rw-r-- 1 pgm pgm 2000 2008-05-12 11:38 /tmp/data.01
..
-rw-rw-r-- 1 pgm pgm 2000 2008-05-12 11:38 /tmp/data.08

hexdump -e '4/2 "%04x " "\n"' </tmp/data.01 | head
ffd2 ffd3 ffd0 ffd0
ffd4 ffcd ffd0 ffd1
ffd4 ffd2 ffd7 ffd0

# read volts channels 1-8, 1000 samples

./x86/bin/acqread -o /tmp/volts.%02d -V -f localhost:10009 1-8 1000

ls -l /tmp/volts.0?
-rw-rw-r-- 1 pgm pgm 4000 2008-05-12 11:45 /tmp/volts.01
..
-rw-rw-r-- 1 pgm pgm 4000 2008-05-12 11:45 /tmp/volts.08

hexdump -e '4/4 "%f " "\n"' </tmp/volts.01 | head
0.149466 0.149778 0.148840 0.148840
0.150091 0.147902 0.148840 0.149153
0.150091 0.149466 0.151030 0.148840

Definition in file acqread.cpp.


Define Documentation

#define DBUF   0x100000

Definition at line 89 of file acqread.cpp.

Referenced by ChannelReader::read_channel().

#define MAXBUF   1024

Definition at line 85 of file acqread.cpp.


Enumeration Type Documentation

enum IARG
Enumerator:
I_CHANNEL 
I_LENGTH 
I_START 
I_STRIDE 

Definition at line 98 of file acqread.cpp.


Function Documentation

static void channel_decode ( const char *  range) [static]

Definition at line 107 of file acqread.cpp.

References channel1, and channel2.

Referenced by main().

int main ( int  argc,
const char **  argv 
)

Variable Documentation

Definition at line 81 of file acqread.cpp.

int channel1 = 1

Definition at line 92 of file acqread.cpp.

Referenced by channel_decode(), and main().

int channel2 = 1

Definition at line 93 of file acqread.cpp.

Referenced by channel_decode(), and main().

char command[MAXBUF] = {}

Definition at line 86 of file acqread.cpp.

short dbuf[DBUF]

Definition at line 90 of file acqread.cpp.

Referenced by ChannelReader::read_channel().

char* device

Definition at line 82 of file acqread.cpp.

int length = 0

Definition at line 95 of file acqread.cpp.

Referenced by main(), and ChannelReader::read_channel().

poptContext opt_context

Definition at line 83 of file acqread.cpp.

const char* outfile = "-"

Definition at line 105 of file acqread.cpp.

Referenced by ChannelReader::getoutfile(), and main().

char response[MAXBUF] = {}

Definition at line 87 of file acqread.cpp.

int start = 0
int stride = 1