-
Notifications
You must be signed in to change notification settings - Fork 0
Minimal functional IOC for Pilatus4 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gustavosr8
wants to merge
6
commits into
main
Choose a base branch
from
initial-poc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
10a3081
app: use ADEiger driver.
gustavosr8 cf6b1bc
docker: use standardized containerization scheme.
gustavosr8 704e3c5
plugins: configure plugin set.
gustavosr8 23599fd
plugins: define pipeline options.
gustavosr8 ecf27f5
ci: use epics-in-docker IOC build workflow.
gustavosr8 818c413
docs: create README file with build and run instructions.
gustavosr8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: Build image | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| build_and_push: | ||
| permissions: | ||
| packages: write | ||
| contents: read | ||
| uses: cnpem/epics-in-docker/.github/workflows/ioc-images.yml@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [submodule "docker"] | ||
| path = docker | ||
| url = https://github.com/cnpem/epics-in-docker.git | ||
| branch = release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # EPICS IOC for ADEiger-based detectors | ||
|
|
||
| This repository contains the EPICS Input/Output Controller (IOC) used at LNLS | ||
| based on [ADEiger](https://github.com/areaDetector/ADEiger) support module. | ||
|
|
||
| ## Running the IOC | ||
|
|
||
| You can use the following command to run it in the background using the `lnls-run.sh` script from | ||
| [epics-in-docker](https://github.com/cnpem/epics-in-docker). | ||
|
|
||
| ``` | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| ## Building the IOC image | ||
|
|
||
| You can build the IOC with the following command: | ||
|
|
||
| ```bash | ||
| TAG=latest docker compose build | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| services: | ||
| ioc: | ||
| image: ghcr.io/cnpem/ad-eiger-epics-ioc:${TAG} | ||
| build: | ||
| context: ./ | ||
| dockerfile: docker/Dockerfile | ||
| target: dynamic-link | ||
| labels: | ||
| org.opencontainers.image.source: https://github.com/cnpem/ad-eiger-epics-ioc | ||
| args: | ||
| REPONAME: ad-eiger-epics-ioc | ||
| RUNDIR: /opt/ad-eiger-epics-ioc/iocBoot/iocEiger | ||
| RUNTIME_PACKAGES: libxml2 libtiff6 libzmq5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Standard configuration for Pilatus4 detector based on ADEiger. | ||
| # | ||
| # Configuration parameters: | ||
| # | ||
| # $(PREFIX) | ||
| # Prefix for all PVs. | ||
|
|
||
| # Register all support components | ||
| dbLoadDatabase("$(TOP)/dbd/Eiger.dbd") | ||
| Eiger_registerRecordDeviceDriver(pdbbase) | ||
|
|
||
| # Define detector driver port | ||
| epicsEnvSet("PORT", "PIL4") | ||
| # Include ADCore to path for loading its databases relatively | ||
| epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db:$(ADEIGER)/db") | ||
|
|
||
| # Configure connection to detector | ||
| eigerDetectorConfig("$(PORT)", "$(IP_ADDRESS)", 0, 0) | ||
|
|
||
| # Load device general records from ADEiger | ||
| dbLoadRecords("$(ADEIGER)/db/pilatus4.template", "P=$(PREFIX), R=cam1:, PORT=$(PORT), ADDR=0, TIMEOUT=1") | ||
|
|
||
| # Trace error and warning messages | ||
| asynSetTraceMask("$(PORT)", 0, ERROR | WARNING) | ||
|
|
||
| # Use larger callback queue to account for the high number of PVs | ||
| callbackSetQueueSize(5000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Area Detector plugin configuration | ||
| # | ||
| # The following parameters must be defined before loading this configuration: | ||
| # | ||
| # $(PREFIX) | ||
| # Prefix for all records. | ||
| # | ||
| # $(PORT) | ||
| # The port name for the detector. | ||
| # | ||
| # $(MAX_IMAGE_PIXELS) | ||
| # The maximum number of pixels to be sent through channel access through | ||
| # NDPluginStdArrays. | ||
| # | ||
| # Optional parameters: | ||
| # | ||
| # $(IMAGE_ASYN_TYPE) | ||
| # Value of the DTYP field of the waveform record which defines the underlying | ||
| # asyn datatype. | ||
| # This should be consistent with IMAGE_WAVEFORM_TYPE. | ||
| # | ||
| # $(IMAGE_WAVEFORM_TYPE) | ||
| # Data type of the waveform values themselves. | ||
| # This should be consistent with IMAGE_ASYN_TYPE. | ||
| # | ||
| # $(QSIZE) | ||
| # The queue size for all plugins. | ||
| # | ||
| # $(QSIZE_HDF5) | ||
| # Queue size for HDF5 plugin. | ||
| # | ||
| # $(MAX_THREADS) | ||
| # The maximum number of threads for plugins which can run in multiple threads. | ||
|
|
||
| epicsEnvSet("IMAGE_ASYN_TYPE", "$(IMAGE_ASYN_TYPE=Int32)") | ||
| epicsEnvSet("IMAGE_WAVEFORM_TYPE", "$(IMAGE_WAVEFORM_TYPE=LONG)") | ||
| epicsEnvSet("QSIZE", "$(QSIZE=20)") | ||
| epicsEnvSet("QSIZE_HDF5", "$(QSIZE_HDF5=1000)") | ||
| epicsEnvSet("MAX_THREADS", "$(MAX_THREADS=4)") | ||
|
|
||
| # Create Codec plugins | ||
| NDCodecConfigure("CODEC1", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS)) | ||
| dbLoadRecords("NDCodec.template", "P=$(PREFIX), R=Codec1:, PORT=CODEC1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)") | ||
|
|
||
| # Create ROI plugin | ||
| NDROIConfigure("ROI1", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0, 0, $(MAX_THREADS)) | ||
| dbLoadRecords("NDROI.template", "P=$(PREFIX), R=ROI1:, PORT=ROI1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)") | ||
|
|
||
| # Create Channel Access conversion plugin | ||
| NDStdArraysConfigure("Image1", $(QSIZE), 0, "$(PORT)", 0, 0, 0, 0) | ||
| dbLoadRecords("NDStdArrays.template", "P=$(PREFIX), R=image1:, PORT=Image1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT), TYPE=$(IMAGE_ASYN_TYPE), FTVL=$(IMAGE_WAVEFORM_TYPE), NELEMENTS=$(MAX_IMAGE_PIXELS)") | ||
|
|
||
| # Create PV Access conversion plugin | ||
| NDPvaConfigure("PVA1", $(QSIZE), 0, "$(PORT)", 0, $(PREFIX)PVA1:Image, 0, 0, 0) | ||
| dbLoadRecords("NDPva.template", "P=$(PREFIX), R=PVA1:, PORT=PVA1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)") | ||
|
|
||
| # Configure HDF5 file format plugin | ||
| NDFileHDF5Configure("FileHDF1", $(QSIZE_HDF5), 0, "$(PORT)", 0) | ||
| dbLoadRecords("NDFileHDF5.template", "P=$(PREFIX), R=HDF1:, PORT=FileHDF1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| dbpf "$(PREFIX)cam1:DataSource" "FileWriter" | ||
| dbpf "$(PREFIX)cam1:StreamDecompress" "Disable" | ||
| dbpf "$(PREFIX)cam1:CompressionAlgo" "BS LZ4" | ||
|
|
||
| dbpf "$(PREFIX)cam1:FWEnable" "Enable" | ||
| dbpf "$(PREFIX)cam1:FWHDF5Format" "v2024.2" | ||
| dbpf "$(PREFIX)cam1:SaveFiles" "Enable" | ||
| dbpf "$(PREFIX)cam1:FWAutoRemove" "Enable" | ||
|
|
||
| dbpf "$(PREFIX)image1:EnableCallbacks" 1 | ||
|
|
||
| dbpf "$(PREFIX)PVA1:EnableCallbacks" 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,25 @@ | ||
| #!../../bin/linux-x86_64/Eiger | ||
| #!/opt/ad-eiger-epics-ioc/bin/linux-x86_64/Eiger | ||
| # -*- container-image: ghcr.io/cnpem/ad-eiger-epics-ioc | ||
| # -*- mount: /ibira:/ibira | ||
| # -*- log! | ||
|
|
||
| #- You may have to change Eiger to something else | ||
| #- everywhere it appears in this file | ||
| cd /opt/ad-eiger-epics-ioc/iocBoot/iocEiger | ||
|
|
||
| < envPaths | ||
|
|
||
| cd "${TOP}" | ||
| # IOC and device specific configuration | ||
| epicsEnvSet("PREFIX", "MNC:B:PILATUS4_4M:") | ||
| epicsEnvSet("IP_ADDRESS", "10.31.71.19") | ||
|
|
||
| ## Register all support components | ||
| dbLoadDatabase "dbd/Eiger.dbd" | ||
| Eiger_registerRecordDeviceDriver pdbbase | ||
| < device.cmd | ||
|
|
||
| ## Load record instances | ||
| #dbLoadRecords("db/Eiger.db","user=root") | ||
| # Configure Area Detector plugins | ||
| epicsEnvSet("MAX_IMAGE_WIDTH", 1030) | ||
| epicsEnvSet("MAX_IMAGE_HEIGHT", 1065) | ||
| epicsEnvSet("MAX_IMAGE_PIXELS", 1096950) | ||
|
|
||
| < plugins.cmd | ||
|
|
||
| cd "${TOP}/iocBoot/${IOC}" | ||
| iocInit | ||
|
|
||
| ## Start any sequence programs | ||
| #seq sncxxx,"user=root" | ||
| < setup-pipeline.cmd |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.