From 00fb566b1f1f3058b1c79bab2da7733f5dc64536 Mon Sep 17 00:00:00 2001 From: keenanlang Date: Thu, 14 Sep 2023 13:55:31 -0500 Subject: [PATCH] add genicam script --- .../iocxxx/examples/detectors/ADGeniCam.iocsh | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 iocBoot/iocxxx/examples/detectors/ADGeniCam.iocsh diff --git a/iocBoot/iocxxx/examples/detectors/ADGeniCam.iocsh b/iocBoot/iocxxx/examples/detectors/ADGeniCam.iocsh new file mode 100644 index 0000000..09f3de1 --- /dev/null +++ b/iocBoot/iocxxx/examples/detectors/ADGeniCam.iocsh @@ -0,0 +1,35 @@ +#- INSTANCE - Used for Camera Port Name and detector pv name +#- CAM_IP +#- MODEL - Model name to identify correct database file to pull from genicam +#- XSIZE - Image Width +#- YSIZE - Image Height +#- TYPE - Image Datatype, default: Int8 + +epicsEnvSet("GENICAM_GENTL64_PATH", "$(ADVIMBA)/bin/$(ARCH)") +epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db:$(ADGENICAM)/db:$(ADVIMBA)/db") + +ADVimbaConfig("$(PORT)", "$(CAM_IP)", 0, 0, 0) +asynSetTraceIOMask($(PORT), 0, 2) + +set_requestfile_path("$(ADGENICAM)/GenICamApp/Db") +set_requestfile_path("$(ADVIMBA)/vimbaApp/Db") + +dbLoadRecords("$(ADVIMBA)/db/vimba.template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE)") +dbLoadRecords("$(ADGENICAM)/db/$(MODEL).template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE)") + +# Create a standard arrays plugin +NDStdArraysConfigure("Image1", 5, 0, "$(INSTANCE)", 0, 0) + +# Need to determine certain values from input parameters +iocshCmd("epicsEnvSet('__FTVL', '$($(TYPE=Int8)_VAL)')", "Int8_VAL=UCHAR, UInt8_VAL=UCHAR, Int16_VAL=SHORT, UInt16_VAL=SHORT, Int32_VAL=LONG, UInt32_VAL=LONG, Float32_VAL=DOUBLE, Float64_VAL=DOUBLE") +iocshCmd("epicsEnvSet('__TYPE', '$($(TYPE=Int8)_VAL)')", "Int8_VAL=Int8, UInt8_VAL=Int8, Int16_VAL=Int16, UInt16_VAL=Int16, Int32_VAL=Int32, UInt32_VAL=Int32, Float32_VAL=Float32, Float64_VAL=Float64") +luaCmd("epicsEnvSet('__SIZE', tostring((XSIZE*YSIZE)|0))", "XSIZE=$(XSIZE), YSIZE=$(YSIZE)") + +dbLoadRecords("$(ADCORE)/ADApp/Db/NDStdArrays.template", "P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(__TYPE),FTVL=$(__FTVL),NELEMENTS=$(__SIZE)") + +epicsEnvUnset("__FTVL") +epicsEnvUnset("__TYPE") +epicsEnvUnset("__SIZE") + +# Load all other plugins using commonPlugins.cmd +iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")