Adds support for 4 channel boxes and overview in Readme
This commit is contained in:
55
README.md
Normal file
55
README.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
Counterbox Epics Module
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
A Stream and Asyn based driver for Counterboxes as SINQ.
|
||||||
|
|
||||||
|
This supports the older 4 and 8 channel EL737 models and the new 10CH 2nd
|
||||||
|
generation systems.
|
||||||
|
|
||||||
|
## How to Use
|
||||||
|
|
||||||
|
Unless a custom database is needed, a device can be configure simply by setting
|
||||||
|
the required environment variables when calling the correct counterbox script.
|
||||||
|
|
||||||
|
Required Variables
|
||||||
|
|
||||||
|
| Environment Variable | Purpose |
|
||||||
|
|----------------------|-----------------------------------------|
|
||||||
|
| PREFIX | Prefix of all device specific PVs |
|
||||||
|
| NAME | First field in all PVs after Prefix |
|
||||||
|
| ASYN_PORT | Unique name for referencing Asyn device |
|
||||||
|
| CNTBOX_HOST | Network IP and Port of device |
|
||||||
|
|
||||||
|
All PVs take the form
|
||||||
|
|
||||||
|
```
|
||||||
|
$(PREFIX):$(NAME):*
|
||||||
|
```
|
||||||
|
|
||||||
|
Available device startup scripts
|
||||||
|
|
||||||
|
* scripts/counterbox_4ch.cmd
|
||||||
|
* scripts/counterbox_8ch.cmd
|
||||||
|
* scripts/counterbox_v2.cmd
|
||||||
|
|
||||||
|
A device can be configured using one of the startup scripts as follows
|
||||||
|
|
||||||
|
```
|
||||||
|
epicsEnvSet("PREFIX", "SQ:INSTRUMENT") # can also be set in runScript call
|
||||||
|
|
||||||
|
runScript "$(sinq_DIR)counterbox_v2.cmd" "NAME=COUNTERBOX, ASYN_PORT=CBOXV2, CNTBOX_HOST=TestInst-DAQ1:2000"
|
||||||
|
```
|
||||||
|
|
||||||
|
## PVs of Interest
|
||||||
|
|
||||||
|
| PV | Description |
|
||||||
|
|---------------------------------------|----------------------------------------------------------------------|
|
||||||
|
| "$(PREFIX):$(NAME):MsgTxt" | Contains unexpected response to executed command |
|
||||||
|
| "$(PREFIX):$(NAME):STATUS" | 0: Idle, 1: Counting, 2: Low rate, 3: Paused, 4: Error |
|
||||||
|
| "$(PREFIX):$(NAME):PRESET-COUNT" | Run count until specified pv value reached |
|
||||||
|
| "$(PREFIX):$(NAME):PRESET-TIME" | Run count until specified pv value in seconds reached |
|
||||||
|
| "$(PREFIX):$(NAME):THRESHOLD" | Minimum rate for counting to preceed. (has RBV) |
|
||||||
|
| "$(PREFIX):$(NAME):THRESHOLD-MONITOR" | Channel monitored for minimum rate (has RBV) |
|
||||||
|
| "$(PREFIX):$(NAME):ELAPSED-TIME" | Time Counterbox has been measuring for |
|
||||||
|
| "$(PREFIX):$(NAME):M_" | Current count on channel. (1-10 depending on box) |
|
||||||
|
| "$(PREFIX):$(NAME):MONITOR-CHANNEL" | Channel that PRESET-COUNT monitors (has RBV, only v2 can be changed) |
|
@ -95,6 +95,12 @@ readMinRate{
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Read Values From Monitors
|
# Read Values From Monitors
|
||||||
|
|
||||||
|
readAll4 {
|
||||||
|
out "RA";
|
||||||
|
in "%(\$1ELAPSED-TIME)f %(\$1M1)d %(\$1M2)d %(\$1M3)d %(\$1M4)d";
|
||||||
|
@mismatch{in "%(\$1MsgTxt)s";}
|
||||||
|
}
|
||||||
|
|
||||||
readAll8 {
|
readAll8 {
|
||||||
out "RA";
|
out "RA";
|
||||||
in "%(\$1ELAPSED-TIME)f %(\$1M1)d %(\$1M2)d %(\$1M3)d %(\$1M4)d %(\$1M5)d %(\$1M6)d %(\$1M7)d %(\$1M8)d";
|
in "%(\$1ELAPSED-TIME)f %(\$1M1)d %(\$1M2)d %(\$1M3)d %(\$1M4)d %(\$1M5)d %(\$1M6)d %(\$1M7)d %(\$1M8)d";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# EL737 EPICS Database for streamdevice support
|
# Counterbox EPICS Database
|
||||||
# Macros
|
# Macros
|
||||||
# P - Prefix
|
# P - Prefix
|
||||||
# NAME - just a name, e.g. EL737
|
# NAME - just a name, e.g. EL737
|
||||||
@ -30,7 +30,7 @@ record(longout,"$(P):$(NAME):THRESHOLD-MONITOR")
|
|||||||
field(DESC, "Channel monitored for minimum rate")
|
field(DESC, "Channel monitored for minimum rate")
|
||||||
field(VAL, "1") # Monitor
|
field(VAL, "1") # Monitor
|
||||||
field(DRVL, "1") # Smallest Threshold Channel
|
field(DRVL, "1") # Smallest Threshold Channel
|
||||||
field(DRVL, "8") # Largest Threshold Channel
|
field(DRVL, "4") # Largest Threshold Channel
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -39,7 +39,7 @@ record(longout,"$(P):$(NAME):THRESHOLD-MONITOR")
|
|||||||
record(ai, "$(P):$(NAME):READALL")
|
record(ai, "$(P):$(NAME):READALL")
|
||||||
{
|
{
|
||||||
field(DESC, "Reads monitors and elapsed time")
|
field(DESC, "Reads monitors and elapsed time")
|
||||||
field(INP, "@$(PROTO) readAll8($(P):$(NAME):) $(ASYN_PORT)")
|
field(INP, "@$(PROTO) readAll4($(P):$(NAME):) $(ASYN_PORT)")
|
||||||
field(SCAN, ".2 second")
|
field(SCAN, ".2 second")
|
||||||
field(DTYP, "stream")
|
field(DTYP, "stream")
|
||||||
field(FLNK, "$(P):$(NAME):UNSET-COUNTING")
|
field(FLNK, "$(P):$(NAME):UNSET-COUNTING")
|
66
db/counterbox_8ch.db
Normal file
66
db/counterbox_8ch.db
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
# EL737 EPICS Database for streamdevice support
|
||||||
|
# Macros
|
||||||
|
# P - Prefix
|
||||||
|
# NAME - just a name, e.g. EL737
|
||||||
|
# PROTO - Stream device protocol file
|
||||||
|
# ASYN_PORT - Low level Asyn IP Port to EL737
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Status Variables
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):MONITOR-CHANNEL")
|
||||||
|
{
|
||||||
|
field(DESC, "PRESET-COUNT Monitors this channel")
|
||||||
|
field(VAL, 1)
|
||||||
|
field(DISP, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):MONITOR-CHANNEL_RBV")
|
||||||
|
{
|
||||||
|
field(DESC, "PRESET-COUNT Monitors this channel")
|
||||||
|
field(VAL, 1)
|
||||||
|
field(DISP, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Count Commands
|
||||||
|
|
||||||
|
record(longout,"$(P):$(NAME):THRESHOLD-MONITOR")
|
||||||
|
{
|
||||||
|
field(DESC, "Channel monitored for minimum rate")
|
||||||
|
field(VAL, "1") # Monitor
|
||||||
|
field(DRVL, "1") # Smallest Threshold Channel
|
||||||
|
field(DRVL, "8") # Largest Threshold Channel
|
||||||
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Read all monitors values
|
||||||
|
|
||||||
|
record(ai, "$(P):$(NAME):READALL")
|
||||||
|
{
|
||||||
|
field(DESC, "Reads monitors and elapsed time")
|
||||||
|
field(INP, "@$(PROTO) readAll8($(P):$(NAME):) $(ASYN_PORT)")
|
||||||
|
field(SCAN, ".2 second")
|
||||||
|
field(DTYP, "stream")
|
||||||
|
field(FLNK, "$(P):$(NAME):UNSET-COUNTING")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M5")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH5")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M6")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH6")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M7")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH7")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M8")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH8")
|
||||||
|
}
|
@ -229,26 +229,6 @@ record(longin, "$(P):$(NAME):M4")
|
|||||||
field(DESC, "Counterbox CH4")
|
field(DESC, "Counterbox CH4")
|
||||||
}
|
}
|
||||||
|
|
||||||
record(longin, "$(P):$(NAME):M5")
|
|
||||||
{
|
|
||||||
field(DESC, "Counterbox CH5")
|
|
||||||
}
|
|
||||||
|
|
||||||
record(longin, "$(P):$(NAME):M6")
|
|
||||||
{
|
|
||||||
field(DESC, "Counterbox CH6")
|
|
||||||
}
|
|
||||||
|
|
||||||
record(longin, "$(P):$(NAME):M7")
|
|
||||||
{
|
|
||||||
field(DESC, "Counterbox CH7")
|
|
||||||
}
|
|
||||||
|
|
||||||
record(longin, "$(P):$(NAME):M8")
|
|
||||||
{
|
|
||||||
field(DESC, "Counterbox CH8")
|
|
||||||
}
|
|
||||||
|
|
||||||
# Not yet sure whether we want to support this
|
# Not yet sure whether we want to support this
|
||||||
# record(longin, "$(P):$(NAME):R1")
|
# record(longin, "$(P):$(NAME):R1")
|
||||||
# {
|
# {
|
||||||
|
@ -47,6 +47,26 @@ record(ai, "$(P):$(NAME):READALL")
|
|||||||
field(FLNK, "$(P):$(NAME):UNSET-COUNTING")
|
field(FLNK, "$(P):$(NAME):UNSET-COUNTING")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M5")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH5")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M6")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH6")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M7")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH7")
|
||||||
|
}
|
||||||
|
|
||||||
|
record(longin, "$(P):$(NAME):M8")
|
||||||
|
{
|
||||||
|
field(DESC, "Counterbox CH8")
|
||||||
|
}
|
||||||
|
|
||||||
record(longin, "$(P):$(NAME):M9")
|
record(longin, "$(P):$(NAME):M9")
|
||||||
{
|
{
|
||||||
field(DESC, "Counterbox CH9")
|
field(DESC, "Counterbox CH9")
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
require asyn
|
|
||||||
|
|
||||||
# Need to be set by user
|
|
||||||
# epicsEnvSet("CNTBOX_HOST", "testinst-daq1:2000")
|
|
||||||
# epicsEnvSet("ASYN_PORT", "el737")
|
|
||||||
# epicsEnvSet("PREFIX", "SQ:SINQTEST")
|
|
||||||
# epicsEnvSet("NAME", "COUNTERBOX")
|
|
||||||
|
|
||||||
epicsEnvSet("PROTO", "$(sinq_DB)counterbox.proto")
|
|
||||||
|
|
||||||
drvAsynIPPortConfigure("$(ASYN_PORT)", "$(CNTBOX_HOST)", 0, 0, 0)
|
|
||||||
dbLoadRecords("$(sinq_DB)counterbox_common.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
|
||||||
dbLoadRecords("$(sinq_DB)counterbox.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
|
6
scripts/counterbox_4ch.cmd
Normal file
6
scripts/counterbox_4ch.cmd
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
require asyn
|
||||||
|
|
||||||
|
epicsEnvSet("PROTO", "$(sinq_DB)counterbox.proto")
|
||||||
|
drvAsynIPPortConfigure("$(ASYN_PORT)", "$(CNTBOX_HOST)", 0, 0, 0)
|
||||||
|
dbLoadRecords("$(sinq_DB)counterbox_common.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
||||||
|
dbLoadRecords("$(sinq_DB)counterbox_4ch.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
6
scripts/counterbox_8ch.cmd
Normal file
6
scripts/counterbox_8ch.cmd
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
require asyn
|
||||||
|
|
||||||
|
epicsEnvSet("PROTO", "$(sinq_DB)counterbox.proto")
|
||||||
|
drvAsynIPPortConfigure("$(ASYN_PORT)", "$(CNTBOX_HOST)", 0, 0, 0)
|
||||||
|
dbLoadRecords("$(sinq_DB)counterbox_common.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
||||||
|
dbLoadRecords("$(sinq_DB)counterbox_8ch.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
@ -1,13 +1,6 @@
|
|||||||
require asyn
|
require asyn
|
||||||
|
|
||||||
# Need to be set by user
|
|
||||||
# epicsEnvSet("CNTBOX_HOST", "testinst-daq1:2000")
|
|
||||||
# epicsEnvSet("ASYN_PORT", "el737")
|
|
||||||
# epicsEnvSet("PREFIX", "SQ:SINQTEST")
|
|
||||||
# epicsEnvSet("NAME", "COUNTERBOX")
|
|
||||||
|
|
||||||
epicsEnvSet("PROTO", "$(sinq_DB)counterbox.proto")
|
epicsEnvSet("PROTO", "$(sinq_DB)counterbox.proto")
|
||||||
|
|
||||||
drvAsynIPPortConfigure("$(ASYN_PORT)", "$(CNTBOX_HOST)", 0, 0, 0)
|
drvAsynIPPortConfigure("$(ASYN_PORT)", "$(CNTBOX_HOST)", 0, 0, 0)
|
||||||
dbLoadRecords("$(sinq_DB)counterbox_common.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
dbLoadRecords("$(sinq_DB)counterbox_common.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
||||||
dbLoadRecords("$(sinq_DB)counterbox_v2.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
dbLoadRecords("$(sinq_DB)counterbox_v2.db", "P=$(PREFIX), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=$(ASYN_PORT)")
|
||||||
|
Reference in New Issue
Block a user