mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
nodetype:uldaq started integration for example
This commit is contained in:
parent
57b410f968
commit
a87a89d96c
2 changed files with 15 additions and 13 deletions
|
@ -41,15 +41,16 @@ extern "C" {
|
|||
|
||||
struct uldaq {
|
||||
struct {
|
||||
int sample_count;
|
||||
double sample_rate;
|
||||
ScanOption scan_options;
|
||||
AInScanFlag flags;
|
||||
AiQueueElement queues;
|
||||
AiInputMode inputMode;
|
||||
DaqDeviceDescriptor devDescriptor;
|
||||
DaqDeviceInterface interfaceType = ANY_IFC;
|
||||
DaqDeviceHandle daqDeviceHandle = 0;
|
||||
int sample_count;
|
||||
double sample_rate;
|
||||
ScanOption scan_options;
|
||||
AInScanFlag flags;
|
||||
AiQueueElement queues;
|
||||
AiInputMode inputMode;
|
||||
DaqDeviceDescriptor devDescriptor;
|
||||
DaqDeviceInterface interfaceType;
|
||||
DaqDeviceHandle daqDeviceHandle
|
||||
double* buffer;
|
||||
} in;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -136,12 +136,9 @@ int uldaq_start(struct node *n)
|
|||
|
||||
|
||||
Range ranges[MAX_RANGE_COUNT];
|
||||
DaqDeviceDescriptor u->devDescriptors[MAX_DEV_COUNT];
|
||||
DaqDeviceInterface u->interfaceType = ANY_IFC;
|
||||
DaqDeviceHandle u->daqDeviceHandle = 0;
|
||||
int numRanges = 0;
|
||||
int descriptorIndex = 0;
|
||||
unsigned int numDevs = MAX_DEV_COUNT;
|
||||
unsigned int numDevs = 1;
|
||||
UlError err = ERR_NO_ERROR;
|
||||
AiInputMode u->inputMode = AI_SINGLE_ENDED;
|
||||
int chanCount = 1;//change this to use more than one channel
|
||||
|
@ -216,6 +213,9 @@ int uldaq_stop(struct node *n)
|
|||
struct uldaq *u = (struct uldaq *) n->_vd;
|
||||
|
||||
|
||||
// get the current status of the acquisition
|
||||
err = ulAInScanStatus(u->daqDeviceHandle, &status, &transferStatus);
|
||||
UlError err = ERR_NO_ERROR;
|
||||
// stop the acquisition if it is still running
|
||||
if (status == SS_RUNNING && err == ERR_NO_ERROR)
|
||||
ulAInScanStop(u->daqDeviceHandle);
|
||||
|
@ -232,6 +232,7 @@ int uldaq_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re
|
|||
int avail;
|
||||
struct uldaq *u = (struct uldaq *) n->_vd;
|
||||
|
||||
UlError err = ERR_NO_ERROR;
|
||||
if (status == SS_RUNNING && err == ERR_NO_ERROR) {
|
||||
// get the current status of the acquisition
|
||||
err = ulAInScanStatus(u->daqDeviceHandle, &status, &transferStatus);
|
||||
|
|
Loading…
Add table
Reference in a new issue