Read Modbus Address and its customization

Hi, I hope everyone reading this is doing well. I am new to modbus based communication and automation. I have been working on Janitza Analyzer and reading its data via dashboard of a data logger.
I am able to establish the communication and reading some of the address as well successfully.
In this journey, I came across a concept that we can read consecutive modbus addresses only. My first question is, Is there any way we can read non consecutive modbus addreses. For example the relevant data which i require is available at address 200 and 275. There is a lot of difference in between.

The second query is , How to make customize Modbus XML file to send query to read data.... Is therre any recommended tool?
 
My first question is, Is there any way we can read non consecutive modbus addreses. For example the relevant data which i require is available at address 200 and 275.
Yes. Make two separate Modbus requests. One for address 200 and another for address 275.

The second query is , How to make customize Modbus XML file to send query to read data.... Is therre any recommended tool?
XML files are not Modbus masters and are not capable of making Modbus requests. Is the XML file a configuration file used by your data logger? Or are you using some other Modbus master device or software that uses the XML file?

In order to help you, we need to know the vendor and model numbers of all equipment being used.
 
Yes. Make two separate Modbus requests. One for address 200 and another for address 275.


XML files are not Modbus masters and are not capable of making Modbus requests. Is the XML file a configuration file used by your data logger? Or are you using some other Modbus master device or software that uses the XML file?

In order to help you, we need to know the vendor and model numbers of all equipment being used.
Using Modbus poll, reading Address separately works fine... But if i try reading address range specifically from 250 to 322, i start getting wrong/garbage values which doesn't gets correct with any type of multiplier etc. Below are address ranges which is giving values perfectly:

Range 1: 200 to 258
Range 2: 259 to 319

if i include some addres from range 1 and some address from range 2 problem starts. Otherwise it works perfectly.

For your second response, XML file is the Energy Analyzer configuration file required by the Datalogger. This idea of customize XML file came to me when i research and found a YouTube video discussing that in Modbus problem occurs in case of reading non-consecutive modbus addresses...

I am updating the my question with the products and software i am using for this case study/Learning.
 
While the Modbus specification limits the number of registers in a single request to 125, some Modbus slave devices additionally impose their own limitation. Perhaps this device's maximum number of registers in a single request is 60.

It's also possible there are specific blocks in the register range that the Modbus slave device requires to be all be read, otherwise it replies with an exception response.

Without knowing the model number of the energy analyzer, I cannot say for certain.

This idea of customize XML file came to me when i research and found a YouTube video discussing that in Modbus problem occurs in case of reading non-consecutive modbus addresses...
This sounds suspicious, especially taken out of context. Can you provide a link to the video that makes these claims?
 
Thank you for the additional information.

Non Consecutive Modbus Address Video
This video is only trying to explain how a single Modbus read request works. A Modbus read request has the following fields: Slave Address, Function Code, Starting Address (of the register, coil, input status), and Number of Registers.

It explains that if you want to read two items that are not consecutive using a single request, you must also read all items in between those two items.

What the video does not say is that you don't have to use a single request. You can instead use two requests and only request the item(s) you're interested in. In practice though, it is usually more efficient to make a single request for items that are nearly consecutive and ignore the items in between.

Vendor Specific Modbus Device Definition
This link is only for a specific product - which seems to be deviceWISE (dw) IoT Platform Gateways. This does not apply to any other Modbus device. It is only how one would configure the Modbus driver on one of these gateways, and these gateways alone. All Modbus vendors have their own way of configuring their devices.

XML Files
It seems that the Sungrow logger allows importing an XML file that defines the Modbus data, however, it seems this is not the preferred way of adding a 3rd party device to the logger. You can, instead, create a point table template using the logger's web interface as shown in section 2.4 here:
https://www.sungrowpowerservice.com...r Adding Third-party Meter via Logger1000.pdf

Using this method, you would create one entry for the analyzer's Voltage L1-N at address 200 and another entry for the analyzer's Frequency L1 at address 275. Presumably, the web interface would allow you to export the point table you created to an XML file that could later be imported.


Also, an important thing to note is that not all Modbus devices use the same register address numbering. Some devices start at 0, while others start at 1. Some use reference notation and have 40,000 or 400,000 offset (for holding registers). Here are more details on this:
https://control.com/forums/threads/modbus-register-numbering.49844/

Your analyzer uses 0-based register address numbering (since the lowest address is 000). I'm unable to find definitively whether the Sungrow logger uses 0-based or 1-based, so as with many Modbus integrations, you will need to perform some testing to determine which is used.
 
But if i try reading address range specifically from 250 to 322, i start getting wrong/garbage values which doesn't gets correct with any type of multiplier etc. Below are address ranges which is giving values perfectly:

Range 1: 200 to 258
Range 2: 259 to 319

if i include some addres from range 1 and some address from range 2 problem starts. Otherwise it works perfectly.
As a reminder (I stated this in your other thread), the manual for your energy analyzer states "Maximum 120 bytes only can be read out into a block!". Therefore, you can only request up to 60 registers in a single request (i.e. one window in Modbus Poll). If you need to create multiple blocks of data in Modbus Poll, click File->New and define a new register range using Setup->Read/Write Definition...
 
Top