EPICS exampleCPP/exampleClient

2016.08.29

Abstract

exampleClient has examples for pvaClientCPP

developerGuide.html Provides tutorial information on how to use pvaClient. Many of the examples are adapted from the examples shown here.

Table of Contents


examplePvaClientGet

This has a number of examples:

exampleDouble
This shows both a short and long way to get data from a scalar channel. The short way throws an execption if the request fails. The long way allows the client more control of looking for problems and blocking.
exampleDoubleArray
Like exampleDouble except the data is a scalarArray.
exampleCADouble
This is like exampleDouble except it uses provider ca.
exampleCADoubleArray
This is like exampleDoubleArray except it uses provider ca.
examplePowerSupply
This is an example of getting data from a channel that does not have a value field.

examplePvaClientMonitor

This is an example of creating a monitor on a channel. It monitors a scalar double field. It also issues puts to the same channel so that it can make the monitors occur.

examplePvaClientPut

This has the folllowing examples:

examplePut
This shows use of get, put, and monitor.
examplePVFieldPut
This does a put and then a get.

examplePvaClientProcess

This example makes a process request to a channel.

examplePvaClientMultiDouble

This is an example of using pvaClientMultiChannel, pvaClientMultiGetDouble, pvaClientMultiPutDouble, and pvaClientMultiMonitorDouble.

examplePvaClientNTMulti

This is an example of using pvaClientMultiChannel to get data as an NTMultiChannel.

helloWorldPutGet

This is an example of issuing a channelPutGet.

helloWorldRPC

This is an example of issuing a PvaClientRPC request. It does not use pva.

getForever

This example uses pvaClientGet. It supports help as follows:

mrk> pwd
/home/epicsv4/release4_6/exampleCPP/exampleClient
mrk> bin/$EPICS_HOST_ARCH/getForever -help
provider channelName  debug
default
pva PVRdouble false
mrk> 
The arguments are:
provider
This can be either pva or ca. ca only works if channelName is a accessable via the ca network protocol, e. g. it is the name of a DBRecord in a V3 IOC.
channelName
The name of the channel.
debug
If true then debug messages are displayed/

When run an attempt is made to connect to channelName, create a pvaClientGet, and a get is issued. If any of these fails an error message is issued and the process terminates.

If successful the result of the get is shown and then the process waits for input from the console. If exit is entered the process terminates.

If the get fails, e. g. the channel has disconnected since the last get, an error message is displayed and the process terminates. If the get is successful then the result is displayed and the process again waits for console input.

Note that if a channel disconnects and reconnects between gets the process should continuue to work.

monitorForever

This example uses pvaClientMonitor. It supports help as follows:

mrk> pwd
/home/epicsv4/release4_6/exampleCPP/exampleClient
mrk> bin/$EPICS_HOST_ARCH/monitorForever -help
provider channelName  debug
default
pva PVRdouble false
mrk> 
The arguments are:
provider
This can be either pva or ca. ca only works if channelName is a accessable via the ca network protocol, e. g. it is the name of a DBRecord in a V3 IOC.
channelName
The name of the channel.
debug
If true then debug messages are displayed/

When run an attempt is made to connect to channelName, create a pvaClientMonitor, and starts monitoring. If any of these fail an error message is issued and the process terminates.

If successful then output is displayed for each monitor event. The process also waits for input from the console. If exit is entered the process terminates. If unlisten was called since the last console intput a message is displayed and the process terminates, otherwise the process continues.

Note that if a channel disconnects and reconnects between console input the process should continuue to work.

testRAII, testRAIIMultiDouble, and testRAIINTMulti

These were created to help test if pvaClientCPP properly implements RAII, e. g, Resource Allocation Is Initialization.