/*exampleEasyMultiDouble.cpp */ /** * Copyright - See the COPYRIGHT that is included with this distribution. * EPICS pvData is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ /** * @author mrk */ /* Author: Marty Kraimer */ #include #include using namespace std; using namespace epics::pvData; using namespace epics::pvAccess; using namespace epics::easyPVA; static void example(EasyPVAPtr const &easyPVA) { cout << "example multiDouble\n"; size_t num = 5; shared_vector channelNames(num); channelNames[0] = "exampleDouble01"; channelNames[1] = "exampleDouble02"; channelNames[2] = "exampleDouble03"; channelNames[3] = "exampleDouble04"; channelNames[4] = "exampleDouble05"; PVStringArrayPtr pvNames = getPVDataCreate()->createPVScalarArray(); pvNames->replace(freeze(channelNames)); EasyMultiDoublePtr multiDouble(EasyMultiDouble::create(easyPVA,pvNames)); try { shared_vector data = multiDouble->get(); cout << "initial " << data << endl; for(size_t i=0; iput(data); data = multiDouble->get(); cout << "final " << data << endl; } catch (std::runtime_error e) { cout << "exception " << e.what() << endl; } } int main(int argc,char *argv[]) { EasyPVAPtr easyPVA = EasyPVA::create(); example(easyPVA); return 0; }