22 #include "libpruio/pruio.h"
25 int main(
int argc,
char **argv)
31 const char *
NamFil =
"output.%u";
33 mSec.tv_nsec = 1000000;
36 printf(
"constructor failed (%s)\n",
io->Errr);
return 1;}
40 printf(
"step 9 configuration failed: (%s)\n",
io->Errr);
break;}
42 printf(
"step 10 configuration failed: (%s)\n",
io->Errr);
break;}
44 printf(
"step 11 configuration failed: (%s)\n",
io->Errr);
break;}
54 printf(
"config failed (%s)\n",
io->Errr);
break;}
57 printf(
"rb_start failed (%s)\n",
io->Errr);
break;}
65 printf(
"Creating file %s\n", fName);
66 FILE *oFile = fopen(fName,
"wb");
73 while(
io->DRam[0] <
iEnd) nanosleep(&mSec,
NULL);
82 else while(
io->DRam[0] >
half) nanosleep(&mSec,
NULL);
83 printf(
" writing samples %u-%u\n",
i-
half,
i-1);
90 printf(
"Finished file %s\n", fName);
VAR io
create new driver UDT
unsigned short uint16
16 bit unsigned integer data type.
unsigned int uint32
32 bit unsigned integer data type.
char * pruio_config(pruIo *Io, uint32 Samp, uint32 Mask, uint32 Tmr, uint16 Mds)
Wrapper function for PruIo::config().
pruIo * pruio_new(uint16 Act, uint8 Av, uint32 OpD, uint8 SaD)
Wrapper function for the constructor PruIo::PruIo().
char * pruio_adc_setStep(pruIo *Io, uint8 Stp, uint8 ChN, uint8 Av, uint8 SaD, uint32 OpD)
Wrapper function for AdcUdt::setStep().
char * pruio_rb_start(pruIo *Io)
Wrapper function for PruIo::rb_start().
void pruio_destroy(pruIo *Io)
Wrapper function for the destructor PruIo::~PruIo().
@ PRUIO_DEF_ACTIVE
Activate all subsystems.
const ANY_PTR NULL
The NULL pointer.
const tmr
The sampling rate in ns (20000 -> 50 kHz).
const NoStep
The number of active steps (must match setStep calls and mask).
VAR iEnd
The last byte of the rest.
VAR mask
The active steps (9 to 11).
VAR rest
The rest of the buffer (in bytes)
VAR samp
The number of samples (per step).
const tSamp
The number of samples in the files (per step).
VAR half
The maximum index of the half ring buffer.
VAR tInd
The maximum total index.
VAR p0
A pointer to the start of the ring buffer.
const NamFil
The output file names.
VAR p1
A pointer to the middle of the ring buffer.
const NoFile
The number of files to write.
int main(int argc, char **argv)
The main function.
Wrapper structure for PruIo.