diff --git a/iocBoot/iocxxx/common.iocsh b/iocBoot/iocxxx/common.iocsh index 6b9b078b26e221fc9392eb59eac6b92d0281bc4e..db0b971af8b94ecfb00f30f3513c6e9042cf4efd 100644 --- a/iocBoot/iocxxx/common.iocsh +++ b/iocBoot/iocxxx/common.iocsh @@ -51,8 +51,7 @@ dbLoadTemplate("$(PLATFORM)/motor.substitutions", "P=$(PREFIX)") #dbLoadTemplate("common/pseudoMotor.substitutions", "P=$(PREFIX)") # Allstop, alldone -dbLoadRecords("$(MOTOR)/db/motorUtil.db", "P=$(PREFIX)") -doAfterIocInit("motorUtilInit('$(PREFIX)')") +iocshLoad("$(MOTOR)/iocsh/allstop.iocsh", "P=$(PREFIX)") ### streamDevice example #dbLoadRecords("$(TOP)/xxxApp/Db/streamExample.db","P=$(PREFIX),PORT=serial1") diff --git a/iocBoot/iocxxx/softioc/serial.cmd b/iocBoot/iocxxx/softioc/serial.cmd index a55b8b44fdec1a3adbf7f1fcb247e81fa49655b5..f2a48eb7074d14eb0a4146f9748ff5f99abd91aa 100644 --- a/iocBoot/iocxxx/softioc/serial.cmd +++ b/iocBoot/iocxxx/softioc/serial.cmd @@ -2,104 +2,45 @@ # BEGIN serial.cmd ------------------------------------------------------------ # Set up 2 local serial ports - -# serial 1 connected to Keithley2K DMM at 19200 baud #drvAsynSerialPortConfigure("portName","ttyName",priority,noAutoConnect, # noProcessEos) drvAsynSerialPortConfigure("serial1", "/dev/ttyS0", 0, 0, 0) -asynSetOption(serial1,0,baud,19200) -#asynOctetSetInputEos(const char *portName, int addr, -# const char *eosin,const char *drvInfo) -asynOctetSetInputEos("serial1",0,"\r\n") -# asynOctetSetOutputEos(const char *portName, int addr, -# const char *eosin,const char *drvInfo) -asynOctetSetOutputEos("serial1",0,"\r") +drvAsynSerialPortConfigure("serial2", "/dev/ttyS1", 0, 0, 0) + +# Set up 2 MOXA Nport serial ports +#drvAsynIPPortConfigure("serial3", "164.54.160.50:4001", 0, 0, 0) +#drvAsynIPPortConfigure("serial4", "164.54.160.50:4002", 0, 0, 0) + # Make port available from the iocsh command line #asynOctetConnect(const char *entry, const char *port, int addr, # int timeout, int buffer_len, const char *drvInfo) asynOctetConnect("serial1", "serial1") - -# serial 2 connected to Newport MM4000 at 38400 baud -drvAsynSerialPortConfigure("serial2", "/dev/ttyS1", 0, 0, 0) -asynSetOption(serial2,0,baud,38400) asynOctetConnect("serial2", "serial2") -asynOctetSetInputEos("serial2",0,"\r") -asynOctetSetOutputEos("serial2",0,"\r") +#asynOctetConnect("serial3", "serial3") +#asynOctetConnect("serial4", "serial4") -# Set up ports 1 and 2 on Moxa box +# Load asynRecord and deviceCmdReply records on serial0-serial7 +iocshLoad("$(IP)/iocsh/loadSerialComm.iocsh", "P=$(PREFIX), PORT=serial") + + +# serial 1 connected to Keithley2K DMM at 19200 baud +#iocshLoad("$(IP)/iocsh/Keithley_2k_serial.iocsh", "PREFIX=$(PREFIX), INSTANCE=D1, PORT=serial1, NUM_CHANNELS=22, MODEL=2700") + +# serial 2 connected to Newport MM4000 at 38400 baud +iocshLoad("$(MOTOR)/iocsh/Newport_MM4000.iocsh", "PORT=serial2, CONTROLLER=0, POLL_RATE=10, MAX_CONTROLLERS=1") # serial 3 is connected to the ACS MCB-4B at 9600 baud -#drvAsynIPPortConfigure("portName","hostInfo",priority,noAutoConnect, -# noProcessEos) -#drvAsynIPPortConfigure("serial3", "164.54.160.50:4001", 0, 0, 0) -#asynOctetConnect("serial3", "serial3") -#asynOctetSetInputEos("serial3",0,"\r") -# For Digitel need to use null input terminator -#asynOctetSetInputEos("serial3",0,"") -#asynOctetSetOutputEos("serial3",0,"\r") +iocshLoad("$(MOTOR)/iocsh/ACS_MCB4B.iocsh", "PORT=serial3, CONTROLLER=0, POLL_RATE=100, NUM_AXES=1") +#iocshLoad("$(MOTOR)/iocsh/Newport_PM500.iocsh", "PORT=serial3, CONTROLLER=0, POLL_RATE=10, MAX_CONTROLLERS=1") # serial 4 not connected for now -#drvAsynIPPortConfigure("serial4", "164.54.160.50:4002", 0, 0, 0) -#asynOctetConnect("serial4", "serial4") -#asynOctetSetInputEos("serial4",0,"\r") -#asynOctetSetOutputEos("serial4",0,"\r") - -# Newport MM4000 driver setup parameters: -# (1) maximum # of controllers, -# (2) motor task polling rate (min=1Hz, max=60Hz) -MM4000Setup(1, 10) - -# Newport MM4000 driver configuration parameters: -# (1) controller -# (2) asyn port name (e.g. serial1 or gpib1) -# (3) GPIB address (0 for serial) -MM4000Config(0, "serial2", 0) - -# Newport PM500 driver setup parameters: -# (1) maximum number of controllers in system -# (2) motor task polling rate (min=1Hz,max=60Hz) -#PM500Setup(1, 10) - -# Newport PM500 configuration parameters: -# (1) controller -# (2) asyn port name (e.g. serial1 or gpib1) -#PM500Config(0, "serial3") - -# McClennan PM304 driver setup parameters: -# (1) maximum number of controllers in system -# (2) motor task polling rate (min=1Hz, max=60Hz) -#PM304Setup(1, 10) - -# McClennan PM304 driver configuration parameters: -# (1) controller being configured -# (2) MPF serial server name (string) -# (3) Number of axes on this controller -#PM304Config(0, "serial4", 1) - -# ACS MCB-4B driver setup parameters: -# (1) maximum number of controllers in system -# (2) motor task polling rate (min=1Hz, max=60Hz) -MCB4BSetup(1, 10) - -# ACS MCB-4B driver configuration parameters: -# (1) controller being configured -# (2) asyn port name (string) -MCB4BConfig(0, "serial3") - -# Load asynRecord records on all ports -dbLoadTemplate("common/asynRecord.substitutions", "P=$(PREFIX)") - -# send impromptu message to serial device, parse reply -# (was serial_OI_block) -dbLoadRecords("$(IP)/ipApp/Db/deviceCmdReply.db","P=$(PREFIX),N=1,PORT=serial1,ADDR=0,OMAX=100,IMAX=100") -dbLoadRecords("$(IP)/ipApp/Db/deviceCmdReply.db","P=$(PREFIX),N=2,PORT=serial2,ADDR=0,OMAX=100,IMAX=100") -dbLoadRecords("$(IP)/ipApp/Db/deviceCmdReply.db","P=$(PREFIX),N=3,PORT=serial3,ADDR=0,OMAX=100,IMAX=100") +#iocshLoad("$(MOTOR)/iocsh/McClennan_PM304.iocsh", "PORT=serial4, CONTROLLER=0, POLL_RATE=10, MAX_CONTROLLERS=1, NUM_AXES=1") # Stanford Research Systems SR570 Current Preamplifier -#dbLoadRecords("$(IP)/ipApp/Db/SR570.db", "P=$(PREFIX),A=A1,PORT=serial1") +#iocshLoad("$(IP)/iocsh/SR_570.iocsh", "PREFIX=$(PREFIX), INSTANCE=A1, PORT=serial1") # Lakeshore DRC-93CA Temperature Controller -#dbLoadRecords("$(IP)/ipApp/Db/LakeShoreDRC-93CA.db", "P=$(PREFIX),Q=TC1,PORT=serial4") +#iocshLoad("$(IP)/iocsh/Lakeshore_DRC93CA.iocsh", "PREFIX=$(PREFIX), INSTANCE=TC1, PORT=serial4") # Huber DMC9200 DC Motor Controller #dbLoadRecords("$(IP)/ipApp/Db/HuberDMC9200.db", "P=$(PREFIX),Q=DMC1:,PORT=serial5") @@ -107,18 +48,11 @@ dbLoadRecords("$(IP)/ipApp/Db/deviceCmdReply.db","P=$(PREFIX),N=3,PORT=serial3,A # Oriel 18011 Encoder Mike #dbLoadRecords("$(IP)/ipApp/Db/eMike.db", "P=$(PREFIX),M=em1,PORT=serial3") -# Keithley 2000 DMM -#dbLoadRecords("$(IP)/ipApp/Db/Keithley2kDMM_mf.db","P=$(PREFIX),Dmm=D1,PORT=serial1") -#doAfterIocInit("seq &Keithley2kDMM, 'P=$(PREFIX), Dmm=D1, channels=22, model=2700'") - # Oxford Cyberstar X1000 Scintillation detector and pulse processing unit -#dbLoadRecords("$(IP)/ipApp/Db/Oxford_X1k.db","P=$(PREFIX),S=s1,PORT=serial4") +#iocshLoad("$(IP)/iocsh/Oxford_X1k.iocsh", "PREFIX=$(PREFIX), INSTANCE=s1, PORT=serial4") # Oxford ILM202 Cryogen Level Meter (Serial) -#dbLoadRecords("$(IP)/ipApp/Db/Oxford_ILM202.db","P=$(PREFIX),S=s1,PORT=serial5") - -# Elcomat autocollimator -#dbLoadRecords("$(IP)/ipApp/Db/Elcomat.db", "P=$(PREFIX),PORT=serial8") +#iocshLoad("$(IP)/iocsh/Oxford_ILM202.iocsh", "PREFIX=$(PREFIX), INSTANCE=s1, PORT=serial5") # Eurotherm temp controller #dbLoadRecords("$(IP)/ipApp/Db/Eurotherm.db","P=$(PREFIX),PORT=serial7") @@ -136,11 +70,6 @@ dbLoadRecords("$(IP)/ipApp/Db/deviceCmdReply.db","P=$(PREFIX),N=3,PORT=serial3,A #dbLoadRecords("$(IP)/ipApp/Db/TSP.db","P=$(PREFIX),TSP=tsp1,PORT=serial4,PA=0") # Heidenhain ND261 encoder (for PSL monochromator) -#dbLoadRecords("$(IP)/ipApp/Db/heidND261.db", "P=$(PREFIX),PORT=serial1") - -# Love Controllers -#devLoveDebug=1 -#loveServerDebug=1 -#dbLoadRecords("$(IP)/ipApp/Db/love.db", "P=$(PREFIX),Q=Love_0,C=0,PORT=PORT2,ADDR=1") +#iocshLoad("$(IP)/iocsh/Heidenhain_ND261.iocsh", "PREFIX=$(PREFIX), PORT=serial1") # END serial.cmd -------------------------------------------------------------- diff --git a/iocBoot/iocxxx/vxWorks/serial.cmd b/iocBoot/iocxxx/vxWorks/serial.cmd index dd10a7b55715d456582a8802f216e5f2817cf6c9..2f59d548e6150aee2cc6dc333e6cee59005debcc 100644 --- a/iocBoot/iocxxx/vxWorks/serial.cmd +++ b/iocBoot/iocxxx/vxWorks/serial.cmd @@ -1,19 +1,13 @@ # BEGIN serial.cmd ------------------------------------------------------------ -# Initialize Octal UART stuff -# tyGSOctalDrv(int maxModules) -tyGSOctalDrv(1) +#Creates serial0 through serial7 +iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=UART_0, PORT=serial, TYPE=232, CARRIER=0, SLOT=0, INT_VEC=0x80, MAX_MODULES=1") +iocshLoad("$(IP)/iocsh/loadSerialComm.iocsh", "PREFIX=$(PREFIX), PORT=serial") -# tyGSOctalModuleInit(char *name, char *type, int intVec, int carrier, int slot) -# name - name by which you want to refer to this IndustryPack module -# type - one of "232", "422", "485" -- the serial hardware standard the module implements -# intVec - interrupt vector -# carrier - number of IP carrier (Carriers are numbered in the order in which they were -# defined in ipacAddXYZ() calls.) -# slot - location of module on carrier -- 0..3 for slot A..slot D -tyGSOctalModuleInit("UART_0", "232", 0x80, 0, 0) -tyGSOctalDevCreateAll("serial", "UART_0", 1000, 1000) +#Creates serial10 through serial17 +#iocshLoad("$(IPAC)/iocsh/tyGSOctal.iocsh", "INSTANCE=UART_1, PORT=serial1, TYPE=232, CARRIER=0, SLOT=1, INT_VEC=0x80") +#iocshLoad("$(IP)/iocsh/loadSerialComm.iocsh", "PREFIX=$(PREFIX), PORT=serial1") #serial0 - SR570 #serial1 - @@ -25,84 +19,10 @@ tyGSOctalDevCreateAll("serial", "UART_0", 1000, 1000) #serial7 - Love Controllers -# Newport MM4000 driver setup parameters: -# (1) maximum # of controllers, -# (2) motor task polling rate (min=1Hz, max=60Hz) -#MM4000Setup(1, 10) - -# Newport MM4000 serial connection settings -#asynSetOption("serial6", -1, "baud", "38400") -#asynSetOption("serial6", -1, "bits", "8") -#asynSetOption("serial6", -1, "stop", "1") -#asynSetOption("serial6", -1, "parity", "none") -#asynSetOption("serial6", -1, "clocal", "Y") -#asynSetOption("serial6", -1, "crtscts", "N") -#asynOctetSetInputEos("serial6", -1, "\r") -#asynOctetSetOutputEos("serial6", -1, "\r") - -# Newport MM4000 driver configuration parameters: -# (1) controller -# (2) asyn port name (e.g. serial0 or gpib1) -# (3) GPIB address (0 for serial) -#MM4000Config(0, "serial6", 0) - -# Newport PM500 driver setup parameters: -# (1) maximum number of controllers in system -# (2) motor task polling rate (min=1Hz,max=60Hz) -#PM500Setup(1, 10) - -# Newport PM500 serial connection settings -#asynSetOption("serial2", -1, "baud", "9600") -#asynSetOption("serial2", -1, "bits", "7") -#asynSetOption("serial2", -1, "stop", "2") -#asynSetOption("serial2", -1, "parity", "even") -#asynSetOption("serial2", -1, "clocal", "N") # Hardware handshaking -#asynSetOption("serial2", -1, "crtscts", "N") -#asynOctetSetInputEos("serial2", -1, "\r") -#asynOctetSetOutputEos("serial2", -1, "\r") - -# Newport PM500 configuration parameters: -# (1) controller -# (2) asyn port name (e.g. serial0 or gpib1) -#PM500Config(0, "serial2") - -# McClennan PM304 driver setup parameters: -# (1) maximum number of controllers in system -# (2) motor task polling rate (min=1Hz, max=60Hz) -#PM304Setup(1, 10) - -# McClennan PM304 driver configuration parameters: -# (1) controller being configured -# (2) MPF serial server name (string) -# (3) Number of axes on this controller -#PM304Config(0, "serial3", 1) - -# ACS MCB-4B driver setup parameters: -# (1) maximum number of controllers in system -# (2) motor task polling rate (min=1Hz, max=60Hz) -#MCB4BSetup(1, 10) - -# ACS MCB-4B serial connection settings -#asynSetOption("serial4", -1, "baud", "19200") -#asynSetOption("serial4", -1, "bits", "8") -#asynSetOption("serial4", -1, "stop", "1") -#asynSetOption("serial4", -1, "parity", "none") -#asynSetOption("serial4", -1, "clocal", "Y") -#asynSetOption("serial4", -1, "crtscts", "N") -#asynOctetSetInputEos("serial4", -1, "\r") -#asynOctetSetOutputEos("serial4", -1, "\r") - -# ACS MCB-4B driver configuration parameters: -# (1) controller being configured -# (2) asyn port name (string) -#MCB4BConfig(0, "serial4") - -# Load asynRecord records on all ports -dbLoadTemplate("common/asynRecord.substitutions", "P=$(PREFIX)") - -# send impromptu message to serial device, parse reply -# (was serial_OI_block) -dbLoadRecords("$(IP)/ipApp/Db/deviceCmdReply.db","P=$(PREFIX),N=1,PORT=serial0,ADDR=0,OMAX=100,IMAX=100") +#iocshLoad("$(MOTOR)/iocsh/Newport_MM4000.iocsh", "PORT=serial6, CONTROLLER=0, POLL_RATE=10, MAX_CONTROLLERS=1") +#iocshLoad("$(MOTOR)/iocsh/Newport_PM500.iocsh", "PORT=serial2, CONTROLLER=0, POLL_RATE=10, MAX_CONTROLLERS=1") +#iocshLoad("$(MOTOR)/iocsh/McClennan_PM304.iocsh", "PORT=serial3, CONTROLLER=0, POLL_RATE=10, NUM_AXES=1, MAX_CONTROLLER=1") +#iocshLoad("$(MOTOR)/iocsh/ACS_MCB4B.iocsh", "PORT=serial4, CONTROLLER=0, POLL_RATE=100, NUM_AXES=1") # Stanford Research Systems SR570 Current Preamplifier #iocshLoad("$(IP)/iocsh/SR_570.iocsh", "PREFIX=$(PREFIX), INSTANCE=A1, PORT=serial0")