Experimental Physics and
| |||||||||||||||||
|
Dennis Nicklaus wrote: Can someone please give me a step-by-step explanation of how to use
The genSub record does not talk to device support. If you want to write to hardware, you have to get some other record to do it. Here's a recipe: 1. Write a database: record(genSub, "gs") { # set up array PV VALI and VALQ to write to waveform records, which # will do the actual output to hardware. field(FTVI, "LONG") field(NOVI, "$(N)") field(OUTI, "myWaveform_1 PP NMS") # ...and similarly for VALQ # set up scalar PVs A, B, and C. Note that the input PV's (A-U) # are not PP fields (writing to them from a CA client will not # cause the record to process), so we must arrange another way # for the genSub record to process when its input values change. field(FTA, "DOUBLE") field(NOA, "1") field(INPA, "mySourceInfo1.VAL CP NMS") # ...and similarly for B and C } Write the subroutine. See examples in the genSub module. You may not need an init routine, because the genSub record will allocate storage for the array PVs. The process subroutine does stuff like the following: for(i=0; i<prec->nova; i++) { prec->vali[i] = prec->a + prec->b + prec->c; /* ...and similarly for valq */ } 2. Write device support for the waveform record to write the arrays to hardware. Probably you'll want to use a setup routine, callable from st.cmd, to give the waveform records their target address. 3. You could wither forward link from the genSub record, or from one of the waveform records it causes to process. -- Tim Mooney ([email protected]) (630)252-5417 Beamline Controls & Data Acquisition Group Advanced Photon Source, Argonne National Lab.
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |