Files
caClientLessons/caLesson6/caClientWrapperC/pvexample.cc
T

28 lines
644 B
C++

#include "epicsPV.h"
using namespace std;
int main (int argc, const char** argv)
{
try {
epicsPV pv(argv[1]);
pv.get();
cout << pv.name() << " = " << pv <<
" SEVR=" << pv.alarmSeverity() <<
" STAT=" << pv.alarmStatus() << endl;
if (argc == 3)
{
pv.put(argv[2]);
pv.get();
cout << pv.name() << " = " << pv <<
" SEVR=" << pv.alarmSeverity() <<
" STAT=" << pv.alarmStatus() << endl;
}
}
catch (exception& e)
{
cout << endl << "Error: " << e.what() << endl;
}
return 0;
}