Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [volttron-dev] Write-Only Modbus Registers in Modbus-TK
  • From: "Raker, David M" <david.raker@xxxxxxxx>
  • Date: Thu, 14 Mar 2024 19:00:26 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=pnnl.gov; dmarc=pass action=none header.from=pnnl.gov; dkim=pass header.d=pnnl.gov; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lMNm9Qp3O/9to9pKESXefOvFETAP8nV+F/dWeBNLpZQ=; b=WAepB2BQRxiYa63ekcBIWIAXv8F3csI6Ie6/CMDhvih5ZtMz0gqzjg0qt5QXIAvHdfBlvlyNiBHfhpqnXGr9+e3GGlQTCIi9owlm0WkI+FhWTfx32JAzArNhQ9YmriVvoJYpTHX0aic9U96i+dzMLa0zGTHPJ2TRvAtLiqwEl9TVGDslqclWL6hBVCH3oerEEpfnDmuMFRyabFtgZS5Pt0T7Cy6wwjPrB/Lsgj5WmsuD+SkZeS/n+L2PxY5VlmQVpEBv1Gdtgy2cNK1P3RHVZ9D+pbX6EHu1QhJjsj2Emrzn9Fa6FejPboZ412XnOMkNlhanKUGMmemfKB/xknraXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n/FxWep7tvE0/YXmkRlo43lRyYBaTNbNz39neWCLvMdV56Gr89nF8iVH4B7pHkscjk7n44fvub8l/7J8+hFLdi8WYy/VyLWaxLXd/Lb6G/JMWrY0cLZa/1L8wt9qIZwdzsrGj8iNQXrtWLsgjEnIGz9oXVyaulwD9qK3iI3r/47gUnjwxaOnkGFfr2nTCMyb83D1qMf7oopQ8tJukUYePiGuBQGfJDDI9qWqp0RCE/qQzYFPDbQMR7JLz/ya94JEf2WwdMg/tWK1RG+yiZTKiag6wVUyQHhVZKMZ/c0ZsbuU6jGIkxV6o0EdMKwBRkdmMq6H6NE+7T0OAINWyE+Fag==
  • Delivered-to: volttron-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/volttron-dev/>
  • List-help: <mailto:volttron-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/volttron-dev>, <mailto:volttron-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/volttron-dev>, <mailto:volttron-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHadjpTwphI4pK3rUmxWvEyEIwfprE3jDOQ
  • Thread-topic: Write-Only Modbus Registers in Modbus-TK

Hi Joe,

 

You are correct to be concerned. Timeouts will slow down the polling, and may cause issues if it creates a backlog (really depends on the number of polls and length of the interval).  There is, unfortunately, not a way to make a truly write-only or non-polled point in the current driver design.  This is one of the issues which I’m working to address in the current driver overhaul.  The best way to deal with this, currently, if you would like to have the points available to write but do not want them polled regularly, is to set them up as if they comprise their own device. Then you can set the poll rate for that device very low (say, make the “interval” setting for the device 86400 to poll the “device” once per day).

 

Example:

 

  • You have a device called “foo” with points called “alpha”, “bravo”, “charlie” and “delta”.
    • “alpha” is read only.
    • “bravo” is read/write”.
    • “charlie” and “delta” are write-only, and should not be polled.
  • Set up two devices: “devices/other/stuff/foo” and “devices/other/stuff/foo-writables” (the names don’t matter, but you need to be able to recognize them).
    • These devices have exactly the same connection information: address, port, etc.
    • “foo” has a registry with “alpha” and “bravo”, since these points are safe to poll. It’s interval is 60 (once per minute).
    • “foo-writables” has a registry with “charlie” and “delta”, since these are the points which are not safe to poll. It’s interval is 86400 (once per day). In principle, you could make the interval even longer, but this rate isn’t going to create a problem.
  • To summarize, you have two device configurations, and two corresponding registry configurations.

 

As an aside, note that the pymodbus driver (the one just called “modbus”) assumes that writable points are holding registers and non-writable points are input registers. This is something which will get an update too, but just keep in mind that if it matters for your device whether it is a holding or input register (many devices expose everything as both, but not all do), writable=True is holding register and writable=False is an input register. The modbus-tk driver does not share this quirk. The writable column is just that.

Hope this helps,

Dave

 

From: Thompson, Joe <jthompson@xxxxxxxx>
Sent: Thursday, March 14, 2024 11:06 AM
To: volttron-dev@xxxxxxxxxxx
Cc: Raker, David M <david.raker@xxxxxxxx>
Subject: Write-Only Modbus Registers in Modbus-TK

 

Check twice before you click! This email originated from outside PNNL.

 

Hello Volttron Team, 

 

Background:

I am using Volttron 8.1.3 on a Raspberry Pi to coordinate the operation / testing of 2 devices over Modbus:

  1. An energy storage system with a BMS that Volttron’s platform.driver communicates with over modbus
  2. An inverter that also communicates with Volttron’s platform.driver via modbus

 

I have a few registers on the BMS that are write-only which are used to close contactors within the system. Manually writing to these registers works fine, but if I try manually reading from them I get a “reply timeout” error:

 

Im wondering if there’s a way to configure a write-only register in Volttron. As I currently understand, I can configure points as either read or read / write in the platform driver and all of these registers will be read by the platform driver in each scraping interval. Is there a way to configure a group of points such that they are never read but are available to be written to by the platform driver? Im concerned that adding these points to my existing list of readable points will slow down the scraping process due to these timeouts.

 

Thanks!

 

Joe Thompson

Technical Leader

Electric Power Research Institute

Energy Storage and Distributed Generation

(912) 663-3407

 

*** This email message is for the sole use of the intended recipient(s) and may contain information that is confidential, privileged or exempt from disclosure under applicable law. Unless otherwise expressed in this message by the sender or except as may be allowed by separate written agreement between EPRI and recipient or recipient’s employer, any review, use, distribution or disclosure by others of this message is prohibited and this message is not intended to be an electronic signature, instrument or anything that may form a legally binding agreement with EPRI. If you are not the intended recipient, please contact the sender by reply email and permanently delete all copies of this message. Please be advised that the message and its contents may be disclosed, accessed and reviewed by the sender's email system administrator and/or provider. ***


Back to the top