Skip to content

Commit

Permalink
add genicam script
Browse files Browse the repository at this point in the history
  • Loading branch information
keenanlang committed Sep 14, 2023
1 parent 0c7f6b5 commit 00fb566
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions iocBoot/iocxxx/examples/detectors/ADGeniCam.iocsh
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 00fb566

Please sign in to comment.