Hi Philippe,
In Modbus R2-5 I added a new drvUser value on the asynInt32 interface called MODBUS_READ. If you have a bo record, for example, with this drvUser value then when that record
processes it will force the driver to do a read, even if the poller is disabled. The poller can be disabled by calling pasynManager->lockPort(). This was intended to allow atomic read/modify/write operations, as explained in the R2-5 release notes.
This has the disadvantage that it only really works from C code, not from the database, because you can’t call pasynManager->lockPort() from the database. Because it does
not actually run the poller it also has the disadvantage that it does not do callbacks for I/O Intr scanned records.
However, I think I see a solution that will work for both applications.
-
Change the poller so that a poller delay <=0 means sleep until an epicsEvent is signaled. This means you don’t need to use a huge poller delay, you just use 0.
-
Change the behavior of the MODBUS_READ parameter in writeInt32 so it just calls epicsEventSignal for that event. This will cause the poller to run once.
Does this sound like it will do what you want?
Mark
From: Philippe Laurent [mailto:[email protected]]
Sent: Tuesday, February 02, 2016 10:47 AM
To: [email protected]; Mark Rivers
Subject: Active modbus read function upon request
Hi Marc,
I would like to active some modbus port drivers upon request for retrieving Post Mortem datas.
It is possible to configure database such that the modbus read function is called only when a record is processing ? (like write function)
If not, what is the best option to temporary desactive the modbus pooling ?
-
Dynamically start an IOC well configured
-
Just set an huge POLL DELAY on the modbus port
-
Disable the asyn port with asyn record, I observe that :
-
modbus pooling thread is always active
-
trace in ioc shell : drvModbusAsyn::doModbusIO port LBEC-DCCT31:PostMortemRd2 disconnect error=asynManager::queueLockPort queueRequest failed: port LBEC-DCCT31 disabled
-
Other
Préservons notre environnement, n’imprimez ce mail que si nécessaire.
Preserve our environment, print this email only if necessary.