Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
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
4 changes: 4 additions & 0 deletions .gitmodules
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
17 changes: 8 additions & 9 deletions EigerApp/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ include $(TOP)/configure/CONFIG
# Build the IOC application

PROD_IOC = Eiger
# Eiger.dbd will be created and installed
DBD += Eiger.dbd

# Eiger.dbd will be made up from these files:
Eiger_DBD += base.dbd
Eiger_DBD += eigerDetectorSupport.dbd
Eiger_LIBS += eigerDetector
Eiger_LIBS += dectrisCompression
Eiger_LIBS += frozen
Eiger_LIBS += tinyCBOR

# Include dbd files from all support applications:
#Eiger_DBD += xxx.dbd

# Add all the support libraries needed by this IOC
#Eiger_LIBS += xxx

# Eiger_registerRecordDeviceDriver.cpp derives from Eiger.dbd
Eiger_SRCS += Eiger_registerRecordDeviceDriver.cpp

# Build the main IOC entry point on workstation OSs.
Expand All @@ -30,6 +27,9 @@ Eiger_SRCS_vxWorks += -nil-

# Add support from base/src/vxWorks if needed
#Eiger_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
# Load libraries from common areaDetector plugins
DBD_NAME = $(PROD_IOC)
include $(ADCORE)/ADApp/commonDriverMakefile

# Finally link to the EPICS Base libraries
Eiger_LIBS += $(EPICS_BASE_IOC_LIBS)
Expand All @@ -39,4 +39,3 @@ Eiger_LIBS += $(EPICS_BASE_IOC_LIBS)
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE

21 changes: 21 additions & 0 deletions README.md
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
```
13 changes: 13 additions & 0 deletions compose.yml
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
1 change: 1 addition & 0 deletions configure/CONFIG_SITE
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ CHECK_RELEASE = YES
# These allow developers to override the CONFIG_SITE variable
# settings without having to modify the configure/CONFIG_SITE
# file itself.
include $(AREA_DETECTOR)/configure/CONFIG_SITE
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local

10 changes: 5 additions & 5 deletions configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
# the CONFIG_SITE file.

# Variables and paths to dependent modules:
#MODULES = /path/to/modules
#MYMODULE = $(MODULES)/my-module
ASYN=

# If using the sequencer, point SNCSEQ at its top directory:
#SNCSEQ = $(MODULES)/seq-ver
AREA_DETECTOR=
ADCORE=
ADEIGER=

# EPICS_BASE should appear last so earlier modules can override stuff:
EPICS_BASE = /home/ABTLUS/gustavo.reis/EPICS/epics-base
EPICS_BASE=

# Set RULES here if you want to use build rules from somewhere
# other than EPICS_BASE:
Expand Down
1 change: 1 addition & 0 deletions docker
Submodule docker added at fb5c4e
27 changes: 27 additions & 0 deletions iocBoot/iocEiger/device.cmd
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)
59 changes: 59 additions & 0 deletions iocBoot/iocEiger/plugins.cmd
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)")
12 changes: 12 additions & 0 deletions iocBoot/iocEiger/setup-pipeline.cmd
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
28 changes: 16 additions & 12 deletions iocBoot/iocEiger/st.cmd
100644 → 100755
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
Loading