Skip to content

DAE Pre and Post commands

Freddie Akeroyd edited this page Feb 19, 2022 · 11 revisions

It is possible to get additional actions to be carried out by DAE IOC when commands such as begin/end/pause/resume/abort are executed. These actions are typically used to do things like open/close an intermediate (fast) shutter. A PRE action is executed before the command and a POST after it has run. Whether the IOC waits for a PRE/POST to complete before the next action is controlled by whether PP or CA is passed as part of configuration, CA will wait for a completion callback and PP will just inititate processing and then carry on to start the next operation. The PV specified for PRE/POST will have the number 0 written to it for a PRE action and 1 for a POST action, often you will specify the .PROC field of a PV so just processing is initiated, but you could specify e.g. the .VAL, or another field such as .A of a calcout record, and use the 0/1 value to determine the action to take.

The PV links to use during PRE/POST are set by macros, either in the configuration or in globals.txt. They have names like PRE_BEGIN_1 and POST_BEGIN_1, to specify then in globals you would add something like

ISISDAE_01__PRE_BEGIN_1=SOME:PV:TO:ACCESS.PROC CA

Note the CA added at the end to request a channel access put, which means the DAE IOC will wait for processing of the PV to finish before executing the main command (begin in this case). As mentioned above PP would request processing but not wait, but PP is only valid for PVs in the same IOC and it is unlikely the PV of interest will be inside the DAE IOC. For PVs not in the DAE IOC, a channel access put will be done anyway and whether the record processes will be determined by properties of the field written to. I've not determined yet whether adding CA to a link that refers to a PV outside the DAE IOC make any difference to Wait behaviour as it will already be a channel access link, but if you wish this behaviour it is safer to add CA.

Clone this wiki locally