preparing fro RHEL9
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user