powerSupply is an example of creating a service that requires a somewhat complicated top level PVStructure. Look at the code for details.
This is an example of creating a service that requires a somewhat complicated top level PVStructure.
The example has a top level pvStructure:
structure
alarm_t alarm
time_t timeStamp
structure power
double value
structure voltage
double value
structure current
double value
It is designed to be accessed via a channelPutGet request. The client sets power.value and voltage.value When the record processes it computes current.value. In addition the timeStamp is set to the time when process is called.
All of the following are run in the powerSupply directory. The examples are for linux. For windows a .bat file is also provided.
scripts/powerSupplyMain
scripts/powerSupplyMonitor
scripts/powerSupplyClient
NOTE: The client ends by requesting a voltage of 0. This results in the power supply record thowing an exception. This results in problems including the powerSupplyMonitor no longer updating. Needs investigation.