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
1 change: 1 addition & 0 deletions PS300/PS300-IOC-01App/src/build.mak
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $(APPNAME)_DBD += calcSupport.dbd
$(APPNAME)_DBD += asyn.dbd
$(APPNAME)_DBD += drvAsynSerialPort.dbd
$(APPNAME)_DBD += drvAsynIPPort.dbd
$(APPNAME)_DBD += drvPrologixGPIB.dbd
$(APPNAME)_DBD += luaSupport.dbd
$(APPNAME)_DBD += stream.dbd
## add other dbd here ##
Expand Down
1 change: 1 addition & 0 deletions PS300/iocBoot/iocPS300-IOC-01/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ioc_details>IOC to control the Stanford powersupply 300 series IOCs</ioc_details>
<macros>
<macro name="PORT" pattern="^COM[0-9]+$" description="Serial COM port" hasDefault="NO" />
<macro name="IPADDR" pattern="^[0-9]+\.[0-9]\.+[0-9]\.+[0-9]+$" description="IP Address of prologix GPIB" hasDefault="NO" />
<macro name="MODEL" pattern="^[0-9]{3}((_neg)|(_pos))*$" description="Serial COM port" hasDefault="YES" defaultValue="350_pos"/>
</macros>
<pvsets>
Expand Down
28 changes: 18 additions & 10 deletions PS300/iocBoot/iocPS300-IOC-01/st-common.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,32 @@ epicsEnvSet "DEVICE" "L0"
##ISIS## Run IOC initialisation
< $(IOCSTARTUP)/init.cmd

stringiftest("GPIB", "$(IPADDR=)", 3)
stringiftest("SERIAL", "$(PORT=)", 3)

## Device simulation mode IP configuration
$(IFDEVSIM) drvAsynIPPortConfigure("$(DEVICE)", "localhost:$(EMULATOR_PORT=57677)")

## For recsim:
$(IFRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NUL)", 0, 1, 0, 0)

## For real device:
$(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NO_PORT_MACRO)", 0, 0, 0, 0)
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "baud", "$(BAUD=9600)")
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "bits", "$(BITS=8)")
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "parity", "$(PARITY=none)")
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "stop", "$(STOP=1)")
## For real RS2323 serial device:
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) drvAsynSerialPortConfigure("$(DEVICE)", "$(PORT=NO_PORT_MACRO)", 0, 0, 0, 0)
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "baud", "$(BAUD=9600)")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "bits", "$(BITS=8)")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "parity", "$(PARITY=none)")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", -1, "stop", "$(STOP=1)")
## Hardware flow control off
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", 0, "clocal", "Y")
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"crtscts","N")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)", 0, "clocal", "Y")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"crtscts","N")
## Software flow control off
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixon","N")
$(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixon","N")
$(IFSERIAL) $(IFNOTDEVSIM) $(IFNOTRECSIM) asynSetOption("$(DEVICE)",0,"ixoff","N")

## GPIB prologix
$(IFGPIB) $(IFNOTDEVSIM) $(IFNOTRECSIM) prologixGPIBConfigure("$(DEVICE)", "$(IPADDR=)")
$(IFGPIB) $(IFNOTDEVSIM) $(IFNOTRECSIM) prologixGPIBSetOption("$(DEVICE)", "timeout_ms", 2000)
#$(IFGPIB) $(IFNOTDEVSIM) $(IFNOTRECSIM) prologixGPIBSetOption("$(DEVICE)", "send_eoi", 0)

## Load record instances

Expand Down