preparing fro RHEL9
This commit is contained in:
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -56,8 +56,8 @@ int main( int argc, char *argv[] )
|
||||
vector<unsigned int> hV; //vector of handles
|
||||
vector<string> pvV; //corresponding vector of pvs
|
||||
vector<unsigned short> stateV;//corresponding vector of connection states
|
||||
|
||||
unsigned int handle;
|
||||
unsigned int h;
|
||||
unsigned int handle, handle_wf;
|
||||
int status;
|
||||
|
||||
//Instantaite CAFE
|
||||
@@ -86,6 +86,13 @@ int main( int argc, char *argv[] )
|
||||
// else otherwise specified.
|
||||
cafe->channelOpenPolicy.setTimeout(0.1); //pend 0.1 seconds
|
||||
|
||||
|
||||
cout << "---------------------------------------------------------------------" << endl;
|
||||
cout << "START: (1) Establishing connections to EPICS Process Variables (PVs) " << endl;
|
||||
cout << "---------------------------------------------------------------------" << endl;
|
||||
cout << pvArray[3] << endl;
|
||||
cout << pvArray[3].c_str() << endl;
|
||||
|
||||
// Open one channel
|
||||
// An exception is ***not*** thrown if the channel does not connect!
|
||||
|
||||
@@ -95,6 +102,9 @@ int main( int argc, char *argv[] )
|
||||
try
|
||||
{
|
||||
cafe->open(pvArray[0].c_str(), handle);
|
||||
cafe->open(PV_WF, handle_wf);
|
||||
cafe->open(pvArray[3].c_str(), h);
|
||||
cout << "handle " << h << flush << endl;
|
||||
}
|
||||
catch(CAFEException_open & e)
|
||||
{
|
||||
@@ -102,6 +112,10 @@ int main( int argc, char *argv[] )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cout << "---------------------------------------------------------------------" << endl;
|
||||
cout << "START: (1) Establishing connections to EPICS Process Variables (PVs) " << endl;
|
||||
cout << "---------------------------------------------------------------------" << endl;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
@@ -123,9 +137,20 @@ int main( int argc, char *argv[] )
|
||||
//However, for convenience open policy has been conveniently packaged so that
|
||||
//only the openPrepare method need be called a priori
|
||||
|
||||
cafe->openPrepare();
|
||||
cafe->open(pvArray, hArray, NHANDLES);
|
||||
cout << pvArray[5] << flush << endl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cafe->openPrepare();
|
||||
|
||||
cout << NHANDLES << flush << endl;
|
||||
|
||||
|
||||
//cafe->open(pvArray, hArray, NHANDLES);
|
||||
|
||||
cout << NHANDLES << flush << endl;
|
||||
// Vector interfaces also exist
|
||||
// vector<string> pvVector
|
||||
// vector<unsigned int> hVector
|
||||
@@ -138,6 +163,12 @@ int main( int argc, char *argv[] )
|
||||
//or
|
||||
cafe->openNowAndWait(0.5); //wait for specified time, here 0.5 seconds
|
||||
|
||||
hArray[0] = 1;
|
||||
hArray[1] = 2;
|
||||
hArray[2] = 1;
|
||||
hArray[3] = 2;
|
||||
hArray[4] = 1;
|
||||
hArray[5] = 2;
|
||||
//Is the given channel connected? Returns true/false
|
||||
bool ifYes= cafe->isChannelConnected(hArray[0]);
|
||||
|
||||
@@ -197,15 +228,19 @@ 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]) );
|
||||
|
||||
|
||||
cout << cafe->getNelemNative(hArray[2]) << flush << endl;
|
||||
|
||||
//Allocate
|
||||
double * dwf2 = new double[cafe->getNelemNative(hArray[2])];
|
||||
|
||||
status=cafe->get(PV_WF, dwf2);
|
||||
|
||||
cout << status << flush << endl;
|
||||
|
||||
if (status != ICAFE_NORMAL)
|
||||
{
|
||||
cout << "Status = " << status << "; indicates an error at " << __METHOD__ << "//" << __LINE__ << endl;
|
||||
@@ -223,7 +258,7 @@ int main( int argc, char *argv[] )
|
||||
}
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
@@ -233,7 +268,7 @@ int main( int argc, char *argv[] )
|
||||
cout << "------------------------------------------------------------" << endl;
|
||||
cout << "START: (2) Basic Single Channel Operations " << endl;
|
||||
cout << "------------------------------------------------------------" << endl;
|
||||
|
||||
cout << flush << endl;
|
||||
//------------------------------------------------------------
|
||||
//Data retrieval methods returning a scalar value
|
||||
//------------------------------------------------------------
|
||||
@@ -661,6 +696,7 @@ int main( int argc, char *argv[] )
|
||||
cout << "------------------------------------------------------------" << endl;
|
||||
|
||||
//GET INFORMATION OF ENUM PV
|
||||
|
||||
PVCtrlHolder pvCtrl;
|
||||
status=cafe->getCtrl(PV_MBBI, pvCtrl);
|
||||
|
||||
@@ -672,7 +708,7 @@ int main( int argc, char *argv[] )
|
||||
cout << i << " : " << enums[i] << endl;
|
||||
}
|
||||
cout << "-------------------------" << endl;
|
||||
|
||||
|
||||
|
||||
string enumStrVal;
|
||||
status= cafe->get(PV_MBBI, enumStrVal);
|
||||
@@ -685,7 +721,7 @@ int main( int argc, char *argv[] )
|
||||
status= cafe->get(PV_MBBI, enumShortVal);
|
||||
cout << "VALUE as int: " << enumShortVal << endl;
|
||||
|
||||
cout << "getStringFromEnum: " << pvCtrl.getStringFromEnum(enumShortVal) << endl;
|
||||
//cout << "getStringFromEnum: " << pvCtrl.getStringFromEnum(enumShortVal) << endl;
|
||||
|
||||
|
||||
PVDataHolder pvDat;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Jan Chrin
|
||||
# June 2016
|
||||
#
|
||||
# Makefile to build a simple C++ cafe client
|
||||
#
|
||||
|
||||
#-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.22.0-hipa-gcc-11.5.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
|
||||
|
||||
EPICS_BASE=${EPICS}/base-7.0.10
|
||||
|
||||
#CAFE project base
|
||||
CAFE_BASE=/psi.ch/project/cafe
|
||||
CAFE_CPP_BASE=${CAFE_BASE}/bin/cpp
|
||||
|
||||
|
||||
BOOST_BASE=${CAFE_BASE}/boost/boost_1_61_0/include
|
||||
|
||||
INCLUDE_PATH += -I$(CAFE_CPP_BASE)/$(CAFE_VERSION)/include \
|
||||
-I$(EPICS_BASE)/include -I$(EPICS_BASE)/include/compiler/gcc \
|
||||
-I$(EPICS_BASE)/include/os/Linux \
|
||||
-I$(BOOST_BASE)
|
||||
#-I${PYTHON_INCLUDE}
|
||||
#-I$(BOOST_BASE)/boost
|
||||
|
||||
LIB_DIR += -L$(EPICS_BASE)/lib/${EPICS_HOST_ARCH} \
|
||||
-Wl,-rpath,$(EPICS_BASE)/lib/${EPICS_HOST_ARCH} \
|
||||
-L$(CAFE_CPP_BASE)/$(CAFE_VERSION)/lib/${EPICS_HOST_ARCH} \
|
||||
-Wl,-rpath,$(CAFE_CPP_BASE)/$(CAFE_VERSION)/lib/${EPICS_HOST_ARCH}
|
||||
#-L/opt/psi/Programming/gcc/10.3.0/lib64 -Wl,-rpath,/opt/psi/Programming/gcc/10.3.0/lib64 \
|
||||
#-L$(PYTHON_LIB) -Wl,-rpath,$(PYTHON_LIB)
|
||||
|
||||
|
||||
LIBS += -lcafe -lca -lCom
|
||||
#-lQt5Core -lpython3.7m
|
||||
|
||||
${EPICS_HOST_ARCH}/cafeTest: cafeTest.cc callbacks.h
|
||||
g++ cafeTest.cc -o ${EPICS_HOST_ARCH}/cafeTest \
|
||||
$(INCLUDE_PATH) $(LIB_DIR) $(LIBS)
|
||||
|
||||
${EPICS_HOST_ARCH}/monitorTest: monitorTest.cc
|
||||
g++ monitorTest.cc -o ${EPICS_HOST_ARCH}/monitorTest \
|
||||
$(INCLUDE_PATH) $(LIB_DIR) $(LIBS)
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
rm -f ${EPICS_HOST_ARCH}/cafeTest.o ${EPICS_HOST_ARCH}/cafeTest ${EPICS_HOST_ARCH}/monitorTest.o ${EPICS_HOST_ARCH}/monitorTest
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Jan Chrin
|
||||
# June 2016
|
||||
#
|
||||
# Makefile to build a simple C++ cafe client
|
||||
#
|
||||
|
||||
#-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.22.0-hipa-gcc-11.5.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
|
||||
|
||||
EPICS_BASE=${EPICS}/base-7.0.10
|
||||
|
||||
#CAFE project base
|
||||
CAFE_BASE=/psi.ch/project/cafe
|
||||
CAFE_CPP_BASE=${CAFE_BASE}/bin/cpp
|
||||
|
||||
|
||||
BOOST_BASE=${CAFE_BASE}/boost/boost_1_61_0/include
|
||||
|
||||
INCLUDE_PATH += -I$(CAFE_CPP_BASE)/$(CAFE_VERSION)/include \
|
||||
-I$(EPICS_BASE)/include -I$(EPICS_BASE)/include/compiler/gcc \
|
||||
-I$(EPICS_BASE)/include/os/Linux \
|
||||
-I$(BOOST_BASE)
|
||||
#-I${PYTHON_INCLUDE}
|
||||
#-I$(BOOST_BASE)/boost
|
||||
|
||||
LIB_DIR += -L$(EPICS_BASE)/lib/${EPICS_HOST_ARCH} \
|
||||
-Wl,-rpath,$(EPICS_BASE)/lib/${EPICS_HOST_ARCH} \
|
||||
-L$(CAFE_CPP_BASE)/$(CAFE_VERSION)/lib/${EPICS_HOST_ARCH} \
|
||||
-Wl,-rpath,$(CAFE_CPP_BASE)/$(CAFE_VERSION)/lib/${EPICS_HOST_ARCH}
|
||||
#-L/opt/psi/Programming/gcc/10.3.0/lib64 -Wl,-rpath,/opt/psi/Programming/gcc/10.3.0/lib64 \
|
||||
#-L$(PYTHON_LIB) -Wl,-rpath,$(PYTHON_LIB)
|
||||
|
||||
|
||||
LIBS += -lcafe -lca -lCom
|
||||
#-lQt5Core -lpython3.7m
|
||||
|
||||
${EPICS_HOST_ARCH}/cafeTest: cafeTest.cc callbacks.h
|
||||
g++ cafeTest.cc -o ${EPICS_HOST_ARCH}/cafeTest \
|
||||
$(INCLUDE_PATH) $(LIB_DIR) $(LIBS)
|
||||
|
||||
${EPICS_HOST_ARCH}/monitorTest: monitorTest.cc
|
||||
g++ monitorTest.cc -o ${EPICS_HOST_ARCH}/monitorTest \
|
||||
$(INCLUDE_PATH) $(LIB_DIR) $(LIBS)
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
rm -f ${EPICS_HOST_ARCH}/cafeTest.o ${EPICS_HOST_ARCH}/cafeTest ${EPICS_HOST_ARCH}/monitorTest.o ${EPICS_HOST_ARCH}/monitorTest
|
||||
|
||||
Reference in New Issue
Block a user