On 2026-02-02 18:54, William Jamieson via Tech-talk wrote:
Does anyone have experience using user-defined function codes alongside
the standard function codes that can be handled by the asyn MODBUS
driver? I am currently using the MODBUS driver for the standard 03 "READ
HOLDING REGISTERS" function while simultaneously using streamDevice
driver for executing user-defined functions. This is resulting in
conflicts between the MODBUS and streamDevice driver. I have tried
setting up two virtual ports pointing to the same serial port:
drvAsynSerialPortConfigure("rs485_modbus", "/dev/ttyUSB0", 0, 1, 0)
drvAsynSerialPortConfigure("rs485_stream", "/dev/ttyUSB0", 0, 1, 0)
I think that this is the wrong approach - according to my understanding.
Both the modbus and streamdevice should lock the asynport.
("rs485_port")
Which should the lock the underlying device, "/dev/ttyUSB0".
If you enable all asyn traces (and direct them to a file)
there should be some light comming up, if there is a problem
here in synchronizing things.
Or if there is a problem with the hardware ?
Then using a SEQ record that disables the rs485_modbus port then enables
the rs485_stream port before processing the stream record. after
processing, it disables the rs485_stream port and re-enables the
rs485_modbus port.
I disable and enable ports by writing a 0 (disable) or 1 (enable) to
the CNCT field of an ASYN record for each port. Example record:
record (asyn, "modbusPort_ASYN")
{
field (PORT, "rs485_modbus")
}
Not only does this switchover create a lot of I/O Error messages in the
IOC shell, but this still results in a garbled data readback from the
stream record.
Does anyone have a successful method of making these two methods work in
parallel? (or some other tools that make it work) Or should I just give
up and use deviceStream reads/writes instead of just the custom ones. I
prefer to use the MODBUS driver if possible for the standard MODBUS
function codes.
Thanks for any help!
William Jamieson
PPPL I&C Engineer
- Replies:
- Re: [External] Re: MODBUS User-Defined Function Codes William Jamieson via Tech-talk
- References:
- MODBUS User-Defined Function Codes William Jamieson via Tech-talk
- Navigate by Date:
- Prev:
Re: MODBUS User-Defined Function Codes Mark Rivers via Tech-talk
- Next:
RE: EPICS Collaboration Meeting Spring 2026 - CEA IRFU Paris-Saclay GOUGNAUD Francoise via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
<2026>
- Navigate by Thread:
- Prev:
Re: MODBUS User-Defined Function Codes Mark Rivers via Tech-talk
- Next:
Re: [External] Re: MODBUS User-Defined Function Codes William Jamieson via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
<2026>
|