The Busy Record

The purpose of the BUSY record is to give the database developer a way to signal the completion of an operation via EPICS' putNotify/ca_put_callback mechanism. This mechanism is described in the EPICS Application Developer's Guide; for purposes here, it is essentially an execution trace. When ca_put_callback() causes a record to process (i.e., to execute) EPICS takes note of that processing, and any other record processing that results directly from it. "Directly" means that the processing is caused by either a forward link, or a database link with the attribute 'PP'. Only this kind of processing is traceable by EPICS. When all traced processing completes, EPICS sends a callback to the source of the original ca_put_callback() command.

If all of the processing that results from a ca_put_callback() is traceable by EPICS, the callback from EPICS is all you need to indicate completion. But if you want to include some processing that isn't traceable by EPICS, the BUSY record is a convenient way to fold it in. If you arrange for a BUSY record to be processed as a traceable result of the ca_put_callback(), and cause its VAL field to have the value "Busy" (1), the BUSY record will pretend to be doing something (i.e., it will not execute its forward link) as long as its VAL field remains "Busy". When VAL is set to "Done", and the record is processed, it will execute its forward link, notifying EPICS that it is finished, and EPICS will send the callback. The write that sets a BUSY record to 1 must be done by either a ca_put_callback(), or a PP link. The write that resets the record to 0 can be done by a channel-access client, or by device support. If it's done by a CA client, it must be done by either a ca_put() or a CA link.

The BUSY record is essentially a copy of the BO record from EPICS 3.14.8.2, with two modifications: (1)the process routine declines to call recGblFwdLink() when the VAL field has the value 0; (2) the ZNAM and ONAM strings have the default values "Done", and "Busy", respectively.