|
Hi White,
That is probably not true for the EPICS driver. There is a convention I never understood where some Modbus software uses addresses that are 1 bigger than the physical address. But the EPICS driver uses the physical address, so you should use the addresses
shown in the spreadsheet.
-
drvModbusAsynConfigure("0X1R","CAT2",1,5,1,10,0,100,"CAT2")
That means:
-
Port name of asyn driver is "0X1R"
-
Port name of TCP driver is "CAT2"
-
Slave address = 1
-
Modbus function = 5, write single coil
-
Modbus start address = 1
-
Modbus length = 10
-
Modbus data type = 0 = INT16
-
Poll ms = 100
-
PlcType = "CAT2"
I think you need to change this to Modbus start address to 0, not 1.
You have set the SCAN field of the bo record to I/O Intr. That is not correct that is only for input records. It should be Passive, which is the default, so you can omit that field.
Did you check for error messages on the IOC console?
You can try processing that record and see more details about the record with this command:
dbtr FMC01:HOMING_TRIGGER 2
Mark
Hi,
I am using EPICS to remotely control a stepper motor controller (IP: 192.168.0.11), which supports the Modbus-TCP protocol. I want to use the homing trigger function for axis 0. My st.cmd file and db file are as follows, and
it runs without errors. but the PV does not connect successfully. The same situation applies to relative motion and absolute motion commands.the Modbus addresses
are in the attachment, ( the vendor said that the addresses need to be incremented by one)
drvAsynIPPortConfigure(“CAT2”,”192.168.0.11:502”,0,0,0)
modbusInterposeConfig("CAT2",0,2000,0)
drvModbusAsynConfigure("0X1R","CAT2",1,5,1,10,0,100,"CAT2")
record(bo, "$(DEVNAME):HOMING_TRIGGER")
{
field(DTYP, "asynUInt32Digital")
field(OUT, "@asynMask(0X1R 1 0x1)")
field(ZNAM,"0")
field(ONAM,"1")
field(SCAN, "I/O Intr")
}
When I enter dbpr, it displays as follows:
epics> dbpr FMC01:HOMING_TRIGGER
ASG : DESC: DISA: 0 DISP: 0
DISV: 1 NAME: FMC01:SEARCH_0_TRIGGER RBV : 0
RVAL: 0 SEVR: INVALID STAT: UDF TPRO: 0
VAL : 0
Did I make a mistake somewhere?
Thanks
White
|