pvac: add synchronous put to 'value' field

This commit is contained in:
Michael Davidsaver
2017-07-18 14:02:14 +02:00
parent 43019344d2
commit 1a47e5fb0a
6 changed files with 196 additions and 13 deletions

View File

@ -10,6 +10,7 @@ TESTPROD_HOST += monitorme
TESTPROD_HOST += spamme
TESTPROD_HOST += miniget
TESTPROD_HOST += miniput
include $(TOP)/configure/RULES
#----------------------------------------

33
examples/miniput.cpp Normal file
View File

@ -0,0 +1,33 @@
/*
* Copyright information and license terms for this software can be
* found in the file LICENSE that is included with the distribution
*/
// The simplest possible PVA put
#include <iostream>
#include "pva/client.h"
int main(int argc, char *argv[])
{
try {
if(argc<=2) {
std::cerr<<"Usage: "<<argv[0]<<" <pvname> <value>\n";
return 1;
}
pvac::ClientProvider provider("pva");
pvac::ClientChannel channel(provider.connect(argv[1]));
std::cout<<"Before "<<channel.name()<<" : "<<channel.get()<<"\n";
channel.putValue<epics::pvData::pvString>(argv[2]);
std::cout<<"After "<<channel.name()<<" : "<<channel.get()<<"\n";
}catch(std::exception& e){
std::cerr<<"Error: "<<e.what()<<"\n";
return 1;
}
}