diff --git a/src/ecmcDAQChannelItem.h b/src/ecmcDAQChannelItem.h index c189490..5b5671e 100644 --- a/src/ecmcDAQChannelItem.h +++ b/src/ecmcDAQChannelItem.h @@ -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); diff --git a/src/ecmcDAQDataArray.cpp b/src/ecmcDAQDataArray.cpp index 61334bf..92ad296 100644 --- a/src/ecmcDAQDataArray.cpp +++ b/src/ecmcDAQDataArray.cpp @@ -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; } }