ISIS Logo
SDTEST
EPICS Serial Device Test IOC
st-port.cmd
Go to the documentation of this file.
1 ## set PN before calling
2 ## if PN=1 the defines asyn port SD1 and uses macros such as PORT1, PORT1_PARITY to configure
3 
4 # this defines macros we can use for conditional loading later
5 stringiftest("PORT", "$(PORT$(PN)=)")
6 
7 # create a real serial port, unless in simulation mode then crreate an unconnected asyn port
8 $(IFPORT)$(IFSIM) drvAsynSerialPortConfigure ("SD$(PN)", "NUL", 0, 1)
9 #$(IFPORT)$(IFNOTSIM) drvAsynIPPortConfigure("SD$(PN)","$(PORT$(PN)=)",0,0,0)
10 
11 # defaults should be reflected in config.xml
12 $(IFPORT)$(IFNOTSIM) drvAsynSerialPortConfigure ("SD$(PN)", "$(PORT$(PN)=)")
13 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "baud", "$(BAUD$(PN)=9600)")
14 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "bits", "$(BITS$(PN)=8)")
15 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "parity", "$(PARITY$(PN)=none)")
16 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "stop", "$(STOP$(PN)=1)")
17 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "clocal", "$(CLOCAL$(PN)=Y)") # if N, output flow control using DSR signal
18 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "crtscts", "$(CRTSCTS$(PN)=N)") # if Y, use hardware flow control (RTS/CTS)
19 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "ixon", "$(IXON$(PN)=N)") # if Y, use software flow control for output
20 $(IFPORT)$(IFNOTSIM) asynSetOption ("SD$(PN)", 0, "ixoff", "$(IXOFF$(PN)=N)") # if Y, use software flow control for input
21 $(IFPORT)$(IFNOTSIM) asynOctetSetOutputEos("SD$(PN)",0,"$(OEOS$(PN)=\\r\\n)")
22 $(IFPORT)$(IFNOTSIM) asynOctetSetInputEos("SD$(PN)",0,"$(IEOS$(PN)=\\r\\n)")
23 
24 stringiftest("TRACEMASK", "$(TRACEMASK$(PN)=)")
25 $(IFPORT)$(IFTRACEMASK) asynSetTraceMask("SD$(PN)",0,"$(TRACEMASK$(PN)=)")
26 
27 stringiftest("TRACEIOMASK", "$(TRACEIOMASK$(PN)=)")
28 $(IFPORT)$(IFTRACEIOMASK) asynSetTraceIOMask("SD$(PN)",0,"$(TRACEIOMASK$(PN)=)")
29 
30 ## Load record instances for connected port
31 $(IFPORT) dbLoadRecords("$(TOP)/db/SDTEST-IOC-01.db","P=$(MYPVPREFIX),Q=$(IOCNAME):P$(PN):,PORT=SD$(PN),DEV=$(PORT$(PN)=),NAME=$(NAME$(PN)=),DISABLE=$(DISABLE),SIM=$(SIMULATE),SCAN=$(SCAN$(PN)=Passive),GETOUT=$(GETOUT$(PN)=),GETIN=$(GETIN$(PN)=),SETOUTA=$(SETOUTA$(PN)=),SETOUTB=$(SETOUTB$(PN)=),SETOUTC=$(SETOUTC$(PN)=),SETIN=$(SETIN$(PN)=),INITOUT=$(INITOUT$(PN)=),INITIN=$(INITIN$(PN)=),INITP=$(INITP$(PN)=NO),PROTO=$(PROTO$(PN)=SDTEST-default.proto)")
32 
33 $(IFPORT) dbLoadRecords("$(ASYN)/db/asynRecord.db","P=$(MYPVPREFIX),R=$(IOCNAME):P$(PN):ASYNREC,PORT=SD$(PN),ADDR=0,OMAX=80,IMAX=80")
34 
35 #
stringiftest("PORT","$(PORT$(PN)=)")
set PN before calling ; if PN=1 the defines asyn port SD1 and uses macros such as PORT1...
IFPORT(IFSIM) drvAsynSerialPortConfigure("SD$(PN)"
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.5