Seems to work.. Need also tyo add ec time in fiorst element

This commit is contained in:
2024-03-05 09:36:56 +01:00
parent bbb86ce3b4
commit d4844066dc
2 changed files with 8 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ class ecmcDAQChannelItem {
bytesPerElement_ = dataItemInfo_->dataElementSize;
dataElementCount_ = dataItemInfo_->dataSize / bytesPerElement_;
dataType_= dataItemInfo_->dataType;
// Execute here to be sure that startup.cmd of ecmc(cfg) has been executed.
switch(format_) {
case ecmcDAQDataFormat::time_micro_s_minus_period:
@@ -97,6 +98,7 @@ class ecmcDAQChannelItem {
sampleTimeCompensation_ = 0;
break;
}
printf("Connected to data item %s (elements %zu)\n",cstrName_,dataElementCount_);
}
void resetIndex(int reset) {
@@ -201,6 +203,11 @@ class ecmcDAQChannelItem {
return ERROR_MEM_INVALID_DATA_TYPE;
break;
}
//if(dataIndexToReturn_>0) {
// printf("%s[%zu] data = %lf\n",cstrName_,dataIndexToReturn_,data);
//}
dataIndexToReturn_++;
return formatData(data,time);

View File

@@ -162,6 +162,7 @@ void ecmcDAQDataArray::execute() {
first = 1;
for(size_t i = 0 ; i < (*pDataCh)->getDataElementCount(); i++) {
buffer_[index]=(*pDataCh)->getData(first);
index++;
first = 0;
}
}