Skip to content

Commit

Permalink
Proper type/ftvl/size calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
keenanlang committed Sep 14, 2023
1 parent 00fb566 commit 16e8bdd
Show file tree
Hide file tree
Showing 16 changed files with 210 additions and 62 deletions.
15 changes: 12 additions & 3 deletions iocBoot/iocxxx/examples/detectors/ADAdsc.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int8
#- FTVL - Waveform type, default: UCHAR

#- The search path for database files
epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADADSC)/db")
Expand All @@ -14,11 +13,21 @@ epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(AD
#- "Q210r", "Q270", "Q315", or "Q315r"
#-
adscConfig("$(INSTANCE)","$(MODEL)")
dbLoadRecords("$(ADADSC)/db/adsc.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")
dbLoadRecords("$(ADADSC)/db/adsc.template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# 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")

iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

15 changes: 12 additions & 3 deletions iocBoot/iocxxx/examples/detectors/ADAndor.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int16
#- FTVL - Waveform type, default: SHORT

epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADANDOR)/db")

#- andorCCDConfig(const char *portName, const char *installPath, int cameraSerial, int shamrockID,
#- int maxBuffers, size_t maxMemory, int priority, int stackSize)
andorCCDConfig("$(INSTANCE)", "$(INSTALL_PATH='')", $(SERIAL), 0, 0, 0, 0, 0)
dbLoadRecords("$(ADANDOR)/db/andorCCD.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")
dbLoadRecords("$(ADANDOR)/db/andorCCD.template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# Need to determine certain values from input parameters
iocshCmd("epicsEnvSet('__FTVL', '$($(TYPE=Int16)_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=Int16)_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")

iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

Expand Down
15 changes: 12 additions & 3 deletions iocBoot/iocxxx/examples/detectors/ADAndor3.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int16
#- FTVL - Waveform type, default: SHORT

epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADANDOR3)/db")

#- andor3Config(const char *portName, int cameraId, int maxBuffers,
#- size_t maxMemory, int priority, int stackSize,
#- int maxFrames)
andor3Config("$(INSTANCE)", $(ID), 0, 0, 0, 0, 100)
dbLoadRecords("$(ADANDOR3)/db/andor3.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")
dbLoadRecords("$(ADANDOR3)/db/andor3.template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# Need to determine certain values from input parameters
iocshCmd("epicsEnvSet('__FTVL', '$($(TYPE=Int16)_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=Int16)_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")

iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

Expand Down
18 changes: 14 additions & 4 deletions iocBoot/iocxxx/examples/detectors/ADAravis.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int8
#- FTVL - Waveform type, default: UCHAR
#- COLORS - Number of colors, default: 1

epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADARAVIS)/db")
Expand All @@ -14,14 +13,25 @@ epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(AD
aravisConfig("$(INSTANCE)", "$(ID)", $(CACHING=1), 0, 0, 0)

#- Main database
dbLoadRecords("$(ADARAVIS)/db/aravisCamera.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE)")
dbLoadRecords("$(ADARAVIS)/db/aravisCamera.template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE)")

#- Load the autogenerated file of GenICam features
dbLoadRecords("$(DB_FILE)", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE)")
dbLoadRecords("$(DB_FILE)", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE)")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# 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((COLORS*XSIZE*YSIZE)|0))", "COLORS=$(COLORS=1), 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")


iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

Expand Down
16 changes: 11 additions & 5 deletions iocBoot/iocxxx/examples/detectors/ADDexela.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int16
#- FTVL - Waveform type, default: SHORT

epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADDEXELA)/db")

Expand All @@ -13,14 +12,21 @@ epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(AD
#- This is for the first detector in the system
DexelaConfig("$(INSTANCE)", $(ID), 0, 0, 0, 0)

dbLoadRecords("$(ADDEXELA)/db/Dexela.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")
dbLoadRecords("$(ADDEXELA)/db/Dexela.template", "P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

# Create a standard arrays plugin, set it to get data from Driver.
NDStdArraysConfigure("Image1", 3, 0, "$(PORT)", 0)

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")
# Need to determine certain values from input parameters
iocshCmd("epicsEnvSet('__FTVL', '$($(TYPE=Int16)_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=Int16)_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")

iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

Expand Down
20 changes: 14 additions & 6 deletions iocBoot/iocxxx/examples/detectors/ADEiger1X.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int32
#- FTVL - Waveform type, default: LONG

epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADEIGER)/db")


eigerDetectorConfig("$(INSTANCE)", "$(ID)", 0, 0)
dbLoadRecords("$(ADEIGER)/db/eiger1.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
#Create tandard arrays plugins.
NDStdArraysConfigure("$(INSTANCE)Image1", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/db/NDStdArrays.template', 'P=$(PREFIX)$(INSTANCE):,R=image1:,PORT=$(INSTANCE)Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int32),FTVL=$(FTVL=LONG),NELEMENTS=' .. NELM)", "NELM=$(XSIZE)*$(YSIZE)")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image2", 3, 0, "$(INSTANCE)", 1, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# 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((COLORS*XSIZE*YSIZE)|0))", "COLORS=$(COLORS=1), XSIZE=$(XSIZE), YSIZE=$(YSIZE)")

dbLoadRecords("$(ADCORE)/ADApp/Db/NDStdArrays.template", "P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(__TYPE),FTVL=$(__FTVL),NELEMENTS=$(__SIZE)")
dbLoadRecords("$(ADCORE)/ADApp/Db/NDStdArrays.template", "P=$(PREFIX):,R=image2:,PORT=$(INSTANCE)Image2,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(__TYPE),FTVL=$(__FTVL),NELEMENTS=$(__SIZE)")

epicsEnvUnset("__FTVL")
epicsEnvUnset("__TYPE")
epicsEnvUnset("__SIZE")


iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

Expand Down
20 changes: 14 additions & 6 deletions iocBoot/iocxxx/examples/detectors/ADEiger2X.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int32
#- FTVL - Waveform type, default: LONG

epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADEIGER)/db")


eigerDetectorConfig("$(INSTANCE)", "$(ID)", 0, 0)
dbLoadRecords("$(ADEIGER)/db/eiger2.template", "P=$(PREFIX)$(INSTANCE):,R=cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
#Create tandard arrays plugins.
NDStdArraysConfigure("$(INSTANCE)Image1", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/db/NDStdArrays.template', 'P=$(PREFIX)$(INSTANCE):,R=image1:,PORT=$(INSTANCE)Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int32),FTVL=$(FTVL=LONG),NELEMENTS=' .. NELM)", "NELM=$(XSIZE)*$(YSIZE)")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image2", 3, 0, "$(INSTANCE)", 1, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# 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((COLORS*XSIZE*YSIZE)|0))", "COLORS=$(COLORS=1), XSIZE=$(XSIZE), YSIZE=$(YSIZE)")

dbLoadRecords("$(ADCORE)/ADApp/Db/NDStdArrays.template", "P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(__TYPE),FTVL=$(__FTVL),NELEMENTS=$(__SIZE)")
dbLoadRecords("$(ADCORE)/ADApp/Db/NDStdArrays.template", "P=$(PREFIX):,R=image2:,PORT=$(INSTANCE)Image2,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(__TYPE),FTVL=$(__FTVL),NELEMENTS=$(__SIZE)")

epicsEnvUnset("__FTVL")
epicsEnvUnset("__TYPE")
epicsEnvUnset("__SIZE")


iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

Expand Down
19 changes: 15 additions & 4 deletions iocBoot/iocxxx/examples/detectors/ADFastCCD.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#- XSIZE - Image Width
#- YSIZE - Image Height
#- TYPE - Image Datatype, default: Int8
#- FTVL - Waveform type, default: UCHAR


epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(ADFASTCCD)/db")

Expand All @@ -13,16 +13,27 @@ epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(EPICS_DB_INCLUDE_PATH):$(ADCORE)/db:$(AD

FastCCDConfig("$(INSTANCE)", 0, 0, 0, 100000, 2000, 200, "", "$(ID)", "")

dbLoadRecords("$(ADFASTCCD)/db/FastCCD.template","P=$(PREFIX)$(INSTANCE):,R=:cam1:,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")
dbLoadRecords("$(ADFASTCCD)/db/FastCCD.template","P=$(PREFIX),R=$(INSTANCE):,PORT=$(INSTANCE),ADDR=0,TIMEOUT=1")

#Create a standard arrays plugin, set it to get data from first simDetector driver.
NDStdArraysConfigure("$(INSTANCE)Image", 3, 0, "$(INSTANCE)", 0, 2000000)
luaCmd("dbLoadRecords('$(ADCORE)/ADApp/Db/NDStdArrays.template', 'P=$(PREFIX):,R=image1:,PORT=$(INSTANCE)Image,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(INSTANCE),TYPE=$(TYPE=Int8),FTVL=$(FTVL=UCHAR),NELEMENTS=' .. tostring((XSIZE*YSIZE)|0) )", "XSIZE=$(XSIZE),YSIZE=$(YSIZE)")

# 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")


iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "PREFIX=$(PREFIX), PORT=$(INSTANCE), QSIZE=20, XSIZE=$(XSIZE), YSIZE=$(YSIZE), NCHANS=1024, CBUFFS=20, MAX_THREADS=5")

# Load the FastCCD Plugin
NDFastCCDConfigure("FastCCD1", 20, 0, "PROC1", 0, 0, 0, 0, 0, 5)
dbLoadRecords("$(ADFASTCCD)/db/NDFastCCD.template", "P=$(PREFIX)$(INSTANCE):,R=FastCCD1:, PORT=FastCCD1, NDARRAY_PORT=FASTCCD, ADDR=0, TIMEOUT=1")
dbLoadRecords("$(ADFASTCCD)/db/NDFastCCD.template", "P=$(PREFIX),R=FastCCD1:, PORT=FastCCD1, NDARRAY_PORT=FASTCCD, ADDR=0, TIMEOUT=1")

set_requestfile_path("$(ADFASTCCD)/db")
Loading

0 comments on commit 16e8bdd

Please sign in to comment.