EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  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  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Modbus Polling disable/enable
From: Mark Rivers <[email protected]>
To: "'[email protected]'" <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 6 Sep 2018 13:42:53 +0000
Hi Emilio,

> I found two ways of achieving the goal:
>    1. Set pollMsec  to a value less or equal to 0 and add an extra record for each register that has periodic scan and writes to MODBUS_READ (disable button would disable this record)
>    2. Use absolute addressing (modbusStartAddress=-1) and change all the records to be periodic scanned

> The downside of the first solution is that I need to have double records for each modbus register.

That is not quite true.  You need an additional record for each contiguous block of registers that are read by a single Modbus asyn driver, not one record for each register.  In many cases there are just a few such blocks of registers that need to be read, so there are only a few new records required.

> The downside of the second solution is that this might be a feature of absolute addressing that might change, as documentation
> is not explicit on the point that absolute addressing mode disables the readPoller thread and calls doModbusIO on record's demand.

I think you can be certain that drivers using absolute addressing will never poll.  If they did poll they would need to poll the entire 64KB modus address space, which would require multiple read operations and be very slow.  This is because the driver cannot know what Modbus addresses will actually be read when a record processes.  Furthermore it would almost always result in Modbus errors because it would attempt to read Modbus addresses that are invalid for a particular piece of hardware.

So I think either method will work.  Method 1) may require fewer periodically scanned records to change their SCAN rates when you want to do a read.

Mark



-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of [email protected]
Sent: Thursday, September 6, 2018 4:16 AM
To: [email protected]
Subject: Modbus Polling disable/enable

Hello Tech-talk


I'm currently working in a module which relies on the modbus module and I need to create a button in the user

interface that allows to disable the read polling.

As it is working now, readPoller still reads the values even if the associated record is disabled.


I found two ways of achieving the goal:

    1. Set pollMsec  to a value less or equal to 0 and add an extra record for each register that has periodic scan and writes to MODBUS_READ (disable button would disable this record)

    2. Use absolute addressing (modbusStartAddress=-1) and change all the records to be periodic scanned


The downside of the first solution is that I need to have double records for each modbus register.

The downside of the second solution is that this might be a feature of absolute addressing that might change, as documentation

is not explicit on the point that absolute addressing mode disables the readPoller thread and calls doModbusIO on record's demand.


My question is:  what is the recommended way?


Best regards and thank you,

Emilio

-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom


References:
Modbus Polling disable/enable [email protected]

Navigate by Date:
Prev: Re: asking for help on s7nodave Mark Rivers
Next: asking for help on s7nodave =?gb18030?b?s8nN/rvG5a0=?=
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  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Modbus Polling disable/enable [email protected]
Next: Problems with soft motors Mark Rivers
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  <20182019  2020  2021  2022  2023  2024 
ANJ, 06 Sep 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·