1 / 4

Support for ca_put_callback in synApps

The ca_put_callback function allows Channel Access clients to write to a PV and wait for a callback to indicate the completion of the operation. This feature eliminates the need for polling and is essential for the use of EPICS sscan record. It is used in synApps records such as motor, scaler, mca, swait, sseq, sCalcout, aCalcout, and busy.

berthold
Download Presentation

Support for ca_put_callback in synApps

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Support for ca_put_callback in synApps • ca_put_callback allows Channel Access clients to write to a PV and wait for a callback to indicate that the entire operation is complete • The record written to and any linked records using DB or FLNK links (not CA links). • The callback is done when all records have called recGblFwdLink(), normally done at the end of the process() function. • Use of ca_put_callback eliminates the need for polling to determine when an operation is complete • Essential for use of EPICS sscan record • Some synApps records only call recGblFwdLink when their logical operation is complete • motor • scaler • mca • swait, sseq, sCalcout, aCalcout (optional wait) • busy

  2. Busy record • Identical to bo record with 1 exception • It only calls recGblFwdLink() when the VAL field changes from 1 to 0 • Can be used in EPICS databases to signal completion with ca_put_callback() when not using the records on the previous slide. • Writes to the busy record can be from • Channel Access • Links in other records in the database • C/C++ callbacks from asyn drivers and asyn device support

  3. Example: Write to undulator energy, wait for completion # This is the energy PV to write to with ca_put_callback record(ao,"$(P)ID$(xx)_energy") { field(FLNK,"$(P)ID$(xx)_busyOn.VAL PP MS") } # This sets the busy record to 1 and forward links to record that sets energy record(bo,"$(P)ID$(xx)_busyOn") { field(DOL,"1") field(OUT,"$(P)ID$(xx)_busy.VAL PP MS") field(FLNK,"$(P)ID$(xx)_energyPut.VAL PP MS") } # This is the busy record record(busy,"$(P)ID$(xx)_busy") { } # This fetches the value from _energy and writes the value to the ID control record(ao,"$(P)ID$(xx)_energyPut") { field(OMSL,"closed_loop") field(DOL,"$(P)ID$(xx)_energy.VAL NPP NMS") field(OUT,"ID$(xx):ScanEnergy.VAL PP MS") } # This monitors the Busy field of the ID control and writes it to busy record record(bo,"$(P)ID$(xx)_copyBusy") { field(OMSL,"closed_loop") field(DOL,"ID$(xx):Busy.VAL CP MS") field(OUT,"$(P)ID$(xx)_busy.VAL CA MS") }

  4. Example: areaDetector wait for plugins record(bo, "$(P)$(R)Acquire") { field(DTYP, "asynInt32") field(OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))ACQUIRE") field(FLNK, "$(P)$(R)SetAcquireBusy") info(asyn:READBACK, "1") } record(calcout, "$(P)$(R)SetAcquireBusy") { field(INPA, "$(P)$(R)Acquire NPP") field(CALC, "A") field(OOPT, "Transition To Non-zero") field(OUT, "$(P)$(R)AcquireBusy PP") } record(busy, "$(P)$(R)AcquireBusy") {} record(bi, "$(P)$(R)AcquireBusyCB") { field(DTYP, "asynInt32") field(INP, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))ACQUIRE_BUSY") field(SCAN, "I/O Intr") } record(calcout, "$(P)$(R)ClearAcquireBusy") { field(INPA, "$(P)$(R)AcquireBusyCB CP") field(CALC, "A") field(OOPT, "Transition To Zero") field(OUT, "$(P)$(R)AcquireBusy PP") } record(bo, "$(P)$(R)WaitForPlugins") { field(PINI, "YES") field(DTYP, "asynInt32") field(OUT, "@asyn($(PORT),$(ADDR=0),$(TIMEOUT=1))WAIT_FOR_PLUGINS") }

More Related