From fd6b276fc9006aef1a002147caae3bc2040664bb Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Mon, 20 May 2024 14:14:36 -0500 Subject: [PATCH 1/2] Updated example IOC for one axis and to use local serial port. --- .../iocBoot/iocAcs/motor.substitutions.mcb4b | 3 --- iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b | 20 +++++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b b/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b index de1d732..8b31799 100644 --- a/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b +++ b/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b @@ -3,7 +3,4 @@ file "$(MOTOR)/db/basic_asyn_motor.db" pattern {P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT} {IOC:, 1, "m$(N)", "asynMotor", MCB4B1, 0, "Bottom", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""} -{IOC:, 2, "m$(N)", "asynMotor", MCB4B1, 1, "Top", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""} -{IOC:, 3, "m$(N)", "asynMotor", MCB4B1, 2, "Inboard", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""} -{IOC:, 4, "m$(N)", "asynMotor", MCB4B1, 3, "Outboard", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""} } diff --git a/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b b/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b index d072557..ae3b2ec 100644 --- a/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b +++ b/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b @@ -6,15 +6,25 @@ dbLoadDatabase("../../dbd/acs.dbd") acs_registerRecordDeviceDriver(pdbbase) # Port 2 on a Moxa -drvAsynIPPortConfigure("serial1", "192.168.1.16:4002",0,0,0) +#!drvAsynIPPortConfigure("serial1", "192.168.1.16:4002",0,0,0) # Local serial port #!drvAsynSerialPortConfigure("serial1", "/dev/ttyS0", 0, 0, 0) +drvAsynSerialPortConfigure("serial1", "/tmp/motorport", 0, 0, 0) +asynSetOption("serial1", 0, "baud", "115200") +asynSetOption("serial1", 0, "bits", "8") +asynSetOption("serial1", 0, "parity", "none") +asynSetOption("serial1", 0, "stop", "1") + +# not sure if these two are needed or what they should be set to: +#!asynSetOption("serial1", 0, "clocal", "Y") +#!asynSetOption("serial1", 0, "crtscts", "Y") + asynOctetSetInputEos("serial1",0,"\r") asynOctetSetOutputEos("serial1",0,"\r") asynSetTraceIOMask("serial1", 0, 2) #asynSetTraceMask("serial1", 0, 255) -MCB4BCreateController("MCB4B1", "serial1", 4, 100, 5000) +MCB4BCreateController("MCB4B1", "serial1", 1, 100, 5000) ### Motors dbLoadTemplate "motor.substitutions.mcb4b" @@ -26,9 +36,3 @@ iocInit # This IOC does not use save/restore, so set values of some PVs dbpf("IOC:m1.RTRY", "0") dbpf("IOC:m1.TWV", "0.1") -dbpf("IOC:m2.RTRY", "0") -dbpf("IOC:m2.TWV", "0.1") -dbpf("IOC:m3.RTRY", "0") -dbpf("IOC:m3.TWV", "0.1") -dbpf("IOC:m4.RTRY", "0") -dbpf("IOC:m4.TWV", "0.1") From c9db06b41810cdfb215da05303513b78fef0cd1e Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Mon, 20 May 2024 14:23:12 -0500 Subject: [PATCH 2/2] Updated example IOC to use DSM prefix and zero-based indexing. --- .../iocBoot/iocAcs/motor.substitutions.mcb4b | 2 +- iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b | 34 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b b/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b index 8b31799..e5665d1 100644 --- a/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b +++ b/iocs/acsIOC/iocBoot/iocAcs/motor.substitutions.mcb4b @@ -2,5 +2,5 @@ file "$(MOTOR)/db/basic_asyn_motor.db" { pattern {P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT} -{IOC:, 1, "m$(N)", "asynMotor", MCB4B1, 0, "Bottom", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""} +{DSM:, 0, "m$(N)", "asynMotor", MCB4B0, 0, "Bottom", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""} } diff --git a/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b b/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b index ae3b2ec..65a4535 100644 --- a/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b +++ b/iocs/acsIOC/iocBoot/iocAcs/st.cmd.mcb4b @@ -6,33 +6,33 @@ dbLoadDatabase("../../dbd/acs.dbd") acs_registerRecordDeviceDriver(pdbbase) # Port 2 on a Moxa -#!drvAsynIPPortConfigure("serial1", "192.168.1.16:4002",0,0,0) +#!drvAsynIPPortConfigure("serial0", "192.168.1.16:4002",0,0,0) # Local serial port -#!drvAsynSerialPortConfigure("serial1", "/dev/ttyS0", 0, 0, 0) -drvAsynSerialPortConfigure("serial1", "/tmp/motorport", 0, 0, 0) -asynSetOption("serial1", 0, "baud", "115200") -asynSetOption("serial1", 0, "bits", "8") -asynSetOption("serial1", 0, "parity", "none") -asynSetOption("serial1", 0, "stop", "1") +#!drvAsynSerialPortConfigure("serial0", "/dev/ttyS0", 0, 0, 0) +drvAsynSerialPortConfigure("serial0", "/tmp/motorport", 0, 0, 0) +asynSetOption("serial0", 0, "baud", "115200") +asynSetOption("serial0", 0, "bits", "8") +asynSetOption("serial0", 0, "parity", "none") +asynSetOption("serial0", 0, "stop", "1") # not sure if these two are needed or what they should be set to: -#!asynSetOption("serial1", 0, "clocal", "Y") -#!asynSetOption("serial1", 0, "crtscts", "Y") +#!asynSetOption("serial0", 0, "clocal", "Y") +#!asynSetOption("serial0", 0, "crtscts", "Y") -asynOctetSetInputEos("serial1",0,"\r") -asynOctetSetOutputEos("serial1",0,"\r") -asynSetTraceIOMask("serial1", 0, 2) -#asynSetTraceMask("serial1", 0, 255) +asynOctetSetInputEos("serial0", 0, "\r") +asynOctetSetOutputEos("serial0", 0, "\r") +asynSetTraceIOMask("serial0", 0, 2) +#asynSetTraceMask("serial0", 0, 255) -MCB4BCreateController("MCB4B1", "serial1", 1, 100, 5000) +MCB4BCreateController("MCB4B0", "serial0", 1, 100, 5000) ### Motors dbLoadTemplate "motor.substitutions.mcb4b" -dbLoadRecords("$(ASYN)/db/asynRecord.db","P=IOC:,R=serial1,PORT=serial1,ADDR=0,OMAX=80,IMAX=80") +dbLoadRecords("$(ASYN)/db/asynRecord.db", "P=DSM:,R=serial0,PORT=serial0,ADDR=0,OMAX=80,IMAX=80") iocInit # This IOC does not use save/restore, so set values of some PVs -dbpf("IOC:m1.RTRY", "0") -dbpf("IOC:m1.TWV", "0.1") +dbpf("DSM:m0.RTRY", "0") +dbpf("DSM:m0.TWV", "0.1")