Skip to content

Commit

Permalink
Add the instruction for epics-related intf/env
Browse files Browse the repository at this point in the history
  • Loading branch information
zhe-slac committed Jul 2, 2024
1 parent e78ec75 commit 8a1427d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/guides/create-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,12 @@ class Environment(environment.Environment):
return 0
``` -->
## Caveats
### EPICS-related interface/environment
When setting up an interface that uses EPICS. There is a need to run `epics.ca.clear_cache()`[^epics-docs] when both getting and setting values from PVs. This ensures that the new processes do not share connections with previous runs of Badger. Also to note, when you uses `PV.get()` to fetch data, the connections must be disconnected by the interface when they are no longer needed. If they are not properly disconnected they will persist between runs and cause a fault in Badger.

[^intf-exp]: One example is that both LCLS and NSLS use Epics as the control system, so an Epics interface can be shared between the LCLS and NSLS Badger environments
[^env-cons]: Environment can only record the VOCS, not the intermediate measurements. Say, to calculate the FEL pulse energy, one needs to average over a buffer of values. It is the averaged value being recorded in the archived run data, not the raw buffers
[^epics-docs]: See https://pyepics.github.io/pyepics/ca.html for notes on the `clear_cache` method
7 changes: 7 additions & 0 deletions versioned_docs/version-1.0/guides/create-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,12 @@ class Environment(environment.Environment):
return 0
``` -->
## Caveats
### EPICS-related interface/environment
When setting up an interface that uses EPICS. There is a need to run `epics.ca.clear_cache()`[^epics-docs] when both getting and setting values from PVs. This ensures that the new processes do not share connections with previous runs of Badger. Also to note, when you uses `PV.get()` to fetch data, the connections must be disconnected by the interface when they are no longer needed. If they are not properly disconnected they will persist between runs and cause a fault in Badger.

[^intf-exp]: One example is that both LCLS and NSLS use Epics as the control system, so an Epics interface can be shared between the LCLS and NSLS Badger environments
[^env-cons]: Environment can only record the VOCS, not the intermediate measurements. Say, to calculate the FEL pulse energy, one needs to average over a buffer of values. It is the averaged value being recorded in the archived run data, not the raw buffers
[^epics-docs]: See https://pyepics.github.io/pyepics/ca.html for notes on the `clear_cache` method

0 comments on commit 8a1427d

Please sign in to comment.