Hello, I have configured my Micro820 with a basic mapping, but I am encountering errors when running a script to read the addresses. The errors indicate illegal addresses when trying to read certain Modbus registers. When connected to Modbus Server, I am experiencing issues with reading specific addresses such as _IO_EM_DI_01, _IO_EM_DI_02, _IO_EM_DI_03, and _IO_EM_DI_04. However, it is interesting to note that I can successfully read the 4 discrete inputs if I treat them as coils (0x01) instead of discrete inputs (0x02). I have attempted to adjust the registers but have not been successful in resolving the issue. Here is a snippet of the mapping configuration I am using: ```python modbus_mapping = { '_IO_EM_DO_01': {'address': 0, 'type': 'coil'}, '_IO_EM_DO_02': {'address': 1, 'type': 'coil'}, '_IO_EM_DO_03': {'address': 2, 'type': 'coil'}, '_IO_EM_DO_04': {'address': 3, 'type': 'coil'}, '_IO_EM_DI_01': {'address': 4, 'type': 'discrete_input'}, '_IO_EM_DI_02': {'address': 5, 'type': 'discrete_input'}, '_IO_EM_DI_03': {'address': 6, 'type': 'discrete_input'}, '_IO_EM_DI_04': {'address': 7, 'type': 'discrete_input'}, '_IO_EM_AO_00': {'address': 8, 'type': 'holding_register'}, '_IO_EM_AI_00': {'address': 24, 'type': 'input_register'}, } ``` If you have any insights or suggestions on how to resolve this issue with illegal Modbus addresses, please feel free to share.
Discover the most commonly used Modbus Function Codes for optimal communication efficiency: Read: - 01: Coils (FC=01) - 02: Discrete Inputs (FC=02) - 03: Multiple Holding Registers (FC=03) - 04: Input Registers (FC=04) Write: - 05: Single Coil (FC=05) - 06: Single Holding Register (FC=06) - 0F: Multiple Coils (FC=15) - 10: Multiple Holding Registers (FC=16) For example, to address "_IO_EM_DI_01," map it to address 100001 as it falls under Discrete Inputs, then use Function 02 to read address 10001. For more insights on Modbus Addressing, simply search for it on Google for a wealth of valuable information.
I want to express my gratitude for your valuable advice, which has significantly assisted me. I had initially believed that the IDE in CCW handled addressing automatically, but I now understand that it plays a different role. Thanks to your guidance, my new table is functioning properly. I also discovered that the mapping of addresses works differently than I had thought, with the address format of "4xxxxx" or "3xxxxx" managing the word counts instead of needing "16" addresses. Your help has been invaluable, and I appreciate it greatly. Thank you!
It sounds like a complex issue you've got there. From my experience, the problem might lie in the addressing scheme of your Modbus slave device. The registers in Modbus devices usually begin at 1, not 0, so when you try to read from address 0, the Modbus might flip to the highest value. If your scripting software interprets registers starting at 1, try shifting all your address starts by 1 (i.e., '_IO_EM_DO_01' is located at address 1). Remember, the addressing can vary depending on the device. Please let us know if it works out!
It sounds like youβre doing everything right from a configuration perspective, but it could be that your Micro820 controller may not support the 'discrete input' type for Modbus communication. Generally, 'discrete input' is read-only and 'coil' is read-write in Modbus terms. So, if you are trying to read and write, you might face illegal address issues with discrete inputs. It might be worth consulting the manual of your Modbus server or reaching out to technical support to confirm what types of communication your Modbus-enabled devices support and if there are any specific device/coil configurations required for successful communication.
It seems like you're treating your discrete inputs as coils, which might be the root of the problem. In Modbus protocol, coils and discrete inputs are viewed differently where coils are read-write while discrete inputs are read-only. Your Micro820 might define the _IO_EM_DI_xx in a certain way that doesn't support reading as if they were coils. You could try specifying them as discrete inputs and ensure you're using the correct function codes when reading them. Please confirm that you're reading the discrete inputs with the function code 0x02. Additionally, it's also worth checking if there's any offset in the address of your registers.
β Work Order Management
β Asset Tracking
β Preventive Maintenance
β Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: The issue with illegal Modbus addresses can occur due to incorrect mapping configurations or mismatch in treating registers as coils instead of discrete inputs.
Answer: To read these specific addresses successfully, consider treating them as discrete inputs (0x02) instead of coils (0x01) in your mapping configuration.
Answer: If adjusting the registers did not resolve the issue, double-check the mapping configuration for accuracy and ensure that the addresses are correctly defined for each register type (coil, discrete input, holding register, input register).
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.