From 2ff3d3a562cbf95fd63c43b491086385a1d2df51 Mon Sep 17 00:00:00 2001 From: "Kurt A. Goetze" Date: Tue, 18 Jul 2017 12:12:57 -0500 Subject: [PATCH] Add support files --- iocBoot/iocWithAsyn/motor.substitutions.ANG1 | 17 +++++ iocBoot/iocWithAsyn/st.cmd.ANG1 | 69 ++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 iocBoot/iocWithAsyn/motor.substitutions.ANG1 create mode 100644 iocBoot/iocWithAsyn/st.cmd.ANG1 diff --git a/iocBoot/iocWithAsyn/motor.substitutions.ANG1 b/iocBoot/iocWithAsyn/motor.substitutions.ANG1 new file mode 100644 index 00000000..069accf7 --- /dev/null +++ b/iocBoot/iocWithAsyn/motor.substitutions.ANG1 @@ -0,0 +1,17 @@ +file "$(MOTOR)/motorApp/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, RTRY} + +{IOC:, 1, "m$(N)", "asynMotor", "ANG1_1_1", 0, "AMCI ANG1 1", steps, Pos, 100, 0, .2, 0, 50, .2, 1, 5, 1e9, -1e9, ""} +{IOC:, 2, "m$(N)", "asynMotor", "ANG1_1_2", 0, "AMCI ANG1 2", steps, Pos, 100, 0, .2, 0, 50, .2, 1, 5, 1e9, -1e9, ""} +} + +file "$(MOTOR)/motorApp/Db/ANG1Aux.template" +{ +pattern +{P, R, PORT, ADDR} +{IOC:, m1:, ANG1_1_1, 0} +{IOC:, m2:, ANG1_1_2, 0} +} + diff --git a/iocBoot/iocWithAsyn/st.cmd.ANG1 b/iocBoot/iocWithAsyn/st.cmd.ANG1 new file mode 100644 index 00000000..e4227c0e --- /dev/null +++ b/iocBoot/iocWithAsyn/st.cmd.ANG1 @@ -0,0 +1,69 @@ +# ANG1_motors.cmd +# + +# Use the following commands for TCP/IP +#drvAsynIPPortConfigure(const char *portName, +# const char *hostInfo, +# unsigned int priority, +# int noAutoConnect, +# int noProcessEos); +# One per controller. One controller can support up to six drivers. +drvAsynIPPortConfigure("ang1_1","164.54.53.107:502",0,0,1) +#drvAsynIPPortConfigure("ang1_2","164.54.53.23:502",0,0,1) +#drvAsynIPPortConfigure("ang1_3","164.54.xxx.xxx:502",0,0,1) + +#modbusInterposeConfig(const char *portName, +# modbusLinkType linkType, +# int timeoutMsec, +# int writeDelayMsec) +# One per controller. One controller can support up to six drivers. +modbusInterposeConfig("ang1_1",0,2000,0) +#modbusInterposeConfig("ang1_2",0,2000,0) + +# Word access at Modbus address 0 +# Access 1 words as inputs. +# Function code=3 +# default data type unsigned integer. +# drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") +# One per axis. Note: "ANG1" is the AMCI model. "ANG1_1" is the controller. "ANG1_1_1" is the axis. +drvModbusAsynConfigure("ANG1_1_1_In_Word", "ang1_1", 0, 4, 0, 10, 0, 100, "ANG1_stepper") +drvModbusAsynConfigure("ANG1_1_2_In_Word", "ang1_1", 0, 4, 10, 10, 0, 100, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_3_In_Word", "ang1_1", 0, 3, 20, 10, 0, 100, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_4_In_Word", "ang1_1", 0, 3, 30, 10, 0, 100, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_5_In_Word", "ang1_1", 0, 3, 40, 10, 0, 100, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_6_In_Word", "ang1_1", 0, 3, 50, 10, 0, 100, "ANG1_stepper") + +# Access 1 words as outputs. +# Either function code=6 (single register) or 16 (multiple registers) can be used, but 16 +# is better because it is "atomic" when writing values longer than 16-bits. +# Default data type unsigned integer. +# drvModbusAsynConfigure("portName", "tcpPortName", slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType") +# Not sure why the outputs can't be configured for Modbus data type 4? +drvModbusAsynConfigure("ANG1_1_1_Out_Word", "ang1_1", 0, 6, 1024, 10, 0, 1, "ANG1_stepper") +drvModbusAsynConfigure("ANG1_1_2_Out_Word", "ang1_1", 0, 6, 1034, 10, 0, 1, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_3_Out_Word", "ang1_1", 0, 6, 1044, 10, 0, 1, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_4_Out_Word", "ang1_1", 0, 6, 1054, 10, 0, 1, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_5_Out_Word", "ang1_1", 0, 6, 1064, 10, 0, 1, "ANG1_stepper") +#drvModbusAsynConfigure("ANG1_1_6_Out_Word", "ang1_1", 0, 6, 1074, 10, 0, 1, "ANG1_stepper") + +# Second ANG1 controller... +#drvModbusAsynConfigure("ANG1_2_1_Out_Word_0", "ang1_2", 0, 6, 1024, 1, 0, 1, "ANG1_stepper") + +dbLoadTemplate("ANG1_motors.substitutions") + +# AMCI ANG1 stepper controller/driver support +# portName The name of the asyn port that will be created for this driver +# ANG1InPortName The name of the In drvAsynIPPPort that was created previously to connect to the ANG1 controller +# ANG1OutPortName The name of the Out drvAsynIPPPort that was created previously to connect to the ANG1 controller +# numAxes The number of axes that this controller supports +# movingPollPeriod The time in ms between polls when any axis is moving +# idlePollPeriod The time in ms between polls when no axis is moving +# +# One per axis. Note: "ANG1" is the AMCI model. "ANG1_1" is the controller. "ANG1_1_1" is the axis. +# Also, ANG1_1_1 is the port name needed for motor.substitutions. +ANG1CreateController(ANG1_1_1, ANG1_1_1_In_Word, ANG1_1_1_Out_Word, 1, 100, 0) +ANG1CreateController(ANG1_1_2, ANG1_1_2_In_Word, ANG1_1_2_Out_Word, 1, 100, 0) +#ANG1CreateController(ANG1_1, ANG1_1_3_In_Word, ANG1_1_3_Out_Word, 1, 100, 0) +#ANG1CreateController(ANG1_1, ANG1_1_4_In_Word, ANG1_1_4_Out_Word, 1, 100, 0) +#ANG1CreateController(ANG1_1, ANG1_1_5_In_Word, ANG1_1_5_Out_Word, 1, 100, 0) +#ANG1CreateController(ANG1_1, ANG1_1_6_In_Word, ANG1_1_6_Out_Word, 1, 100, 0)