testing wf behaviour thru ca gateway

This commit is contained in:
2023-07-06 10:01:36 +02:00
parent 33bbcde48a
commit b00167016e
19 changed files with 344 additions and 318 deletions

Binary file not shown.

View File

@@ -13,7 +13,7 @@
#define PV_X1 "ARIDI-BPM-01LE:X-AVG"
#define PV_Y1 "ARIDI-BPM-01LE:Y-AVG"
#define PV_WF "ARIDI-BPM-01LE:WF-INT-2" //256 elements
#define PV_WF "ARIDI-BPM-01LE:WF-INT-1" //256 elements
#define PV_MBBI "ARIDI-BPM-01LE:GET-ENABLE" //mmbi
#define PV_X1_DESC "ARIDI-BPM-01LE:X-AVG.DESC" //dbr_string_t
#define PV_JOKE "PV:JOKE"
@@ -197,6 +197,35 @@ int main( int argc, char *argv[] )
cout << "---------------------------------------------------------------------" << endl;
//reset Number of elements to native value for get operation
cafe->getHandleHelper().setNelem(hArray[2], cafe->getNelemNative(hArray[2]) );
//Allocate
double * dwf2 = new double[cafe->getNelemNative(hArray[2])];
status=cafe->get(PV_WF, dwf2);
if (status != ICAFE_NORMAL)
{
cout << "Status = " << status << "; indicates an error at " << __METHOD__ << "//" << __LINE__ << endl;
cafe->getCafeStatus().report(status);
}
else
{
cout << PV_WF << " successfully read out " << endl;
cout << "First five elements have values: " << endl;
for (int i=0; i<std::min(10,(int) cafe->getNelemRequest(hArray[2])); ++i)
{
cout << dwf2[i] << " [" << i << "] ";
}
cout << endl;
}
;
//------------------------------------------------------------
//(2) Basic Single Channel Operations
//------------------------------------------------------------
@@ -474,8 +503,10 @@ int main( int argc, char *argv[] )
//------------------------------------------------------------
//Data retrieval methods returning a waveform array
//------------------------------------------------------------
ChannelRequestPolicy channelRequestPolicyGetWF;
channelRequestPolicyGetWF.setPolicy(CAFENUM::FLUSH_AFTER_EACH_MESSAGE,
CAFENUM::WAIT, CAFENUM::WITHOUT_CALLBACK); //Wait!!
status=cafe->getPolicyHelper().setChannelRequestPolicyGet(hArray[2], channelRequestPolicyGetWF);
//inwf array of 20 doubles previous defined
//copy to vector to illustrate other possibilities
@@ -546,6 +577,7 @@ int main( int argc, char *argv[] )
cout << endl;
}
//reset offset for read and the nelemtonative
cout << "Resetting nelem for wf to native value: " << cafe->getHandleHelper().setNelemToNative(hArray[2])
<< " and resetting offset to: " << cafe->getHandleHelper().setOffset(hArray[2], 0) << endl;
@@ -1124,7 +1156,7 @@ int main( int argc, char *argv[] )
MonitorPolicy mp, mp2;
mp.setUserArgs((void *) pvArray[0].c_str());
mp.setHandler(callbackHandlerMoqnitor);
mp.setHandler(callbackHandlerMonitor);
mp.setCafeDbrType(CAFENUM::DBR_TIME);
mp.setDataType(DBR_STS_FLOAT); //THis will overwrite DBR_TIME above
mp.setMask(DBE_VALUE | DBE_LOG | DBE_ALARM);

View File

@@ -8,8 +8,8 @@
#-py37- libcafe.so: undefined reference to `cy_event_handler_wrapper
#CAFE version to link to
#CAFE_VERSION=cafe-1.14.4-sls2-gcc-7.3.0
#CAFE_VERSION=cafe-1.15.0-py37-gcc-10.3.0
CAFE_VERSION=cafe-1.15.0-gcc-10.3.0
CAFE_VERSION=cafe-1.19.1-gcc-7.3.0
#CAFE_VERSION=cafe-1.15.0-gcc-10.3.0
PYTHON_INCLUDE=/opt/gfa/python-3.7/latest/include/python3.7m
PYTHON_LIB=/opt/gfa/python-3.7/latest/lib