A common issue faced by the Modbus driver is when the device’s address is discontinuous, that is, there are gaps between the addresses. In that case, some memory spaces are either non-existent or cannot be accessed. How can I access the registers, in this situation?
I/O drivers, such as Modbus and alike, are modules from Elipse E3 that enable communication with certain devices. There are two types of I/O objects: Tags and Blocks. Tags are objects that set up the communication with a variable (a memory address) of the acquisition device. Blocks are used for setting up the communication with several variables (several memory addresses in sequence) of the acquisition device.
In the case discussed in this article (discontinuous address at the Modbus driver), you must take extra care when operating with I/O blocks. If at least one address is invalid, the device will return an error message which will invalidate the whole operation.
To prevent invalid accesses, go to the IODriver‘s properties and edit the value at EnableReadGrouping property to False. Additionally, we suggest accessing the values initially via I/O Tags, and only after that via I/O Blocks, in order to check the validity of the requested addresses.
The articles below all refer to common issues faced by the Modbus driver:
- Multiple slaves with RS-485 converter.
- Protocol exception codes.
- Incrementing non-standard addresses.
- Scrambled bytes and words.
- Registers addresses indexation.
- Interpreting addresses prefixes.