38 int value_offset, delta_index, nmax, i;
41 if(
shmheader == NULL)
return "DAQ_ERROR: shmheader==NULL";
42 if(strcmp(
shmheader->
ident,
"daq") != 0)
return "DAQ_ERROR: shmheader->ident is false";
50 if(strcmp(cptr,variable) == 0)
52 return cptr + value_offset;
57 return "DAQ_ERROR: variable not found in shared memory";
69 sscanf(cptr,
"%d",&ret);
81 if(isdigit(*cptr) || *cptr ==
'-')
84 sscanf(cptr,
"%f",&ret);
130 if(
shmheader == NULL)
return "DAQ_ERROR";
139 int value_offset, delta_index, nmax, i;
143 if(
shmheader == NULL)
return "DAQ_ERROR";
150 for(i=0; i<nmax; i++)
173 if(
shm == NULL)
return -1;
179 if(
shm == NULL)
return -1;
const char * nextVariable()
const char * stringValue(const char *variable)
float floatValue(const char *variable)
rlDataAcquisition(const char *mailbox="c:\utomation\bx\ataacquisition.mbx", const char *shared_memory="c:\utomation\hm\ataacquisition.shm", long shared_memory_size=65536)
int writeStringValue(const char *variable, const char *value)
int printf(const char *format,...)
const char * firstVariable()
int intValue(const char *variable)
int writeIntValue(const char *variable, int value)
int writeFloatValue(const char *variable, float value)
virtual ~rlDataAcquisition()