|
|
Experimental Physics and
| ||||||||||||||
|
|
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) 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
| ||||||||||||||
| ANJ, 19 Mar 2026 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |