Hello, I recently came across information regarding Modbus addressing using %MW registers. I am currently working with a PLC with the address MW4513, while the machine constructor has specified the MODBUS address as 44514. When attempting to read the value using TCP Modbus, I noticed that the value matches the address 4513 Modbus (1st byte), which is puzzling. Additionally, I am trying to set the 7th bit of %MW10100 from my supervisor software. However, when I attempt to use an OR operation on the Modbus addresses 10100 or 50101 (10100 + 40001), it does not work as expected. I have been experimenting with reading and writing %MW registers in a prototype scenario using the Node.js Node-RED Modbus Module. Eventually, I plan to implement a Java application to address this issue permanently. Any assistance would be greatly appreciated. Thank you.
Thank you for your response! %MW10100 is located in the extended memory area of the Modbus protocol. Originally, Modbus only had 9999 registers numbered from 40001 to 49999. However, with extended addressing, numbering starts at 10000 and goes beyond. It's important to note that Modbus addresses only have 0X, 1X, 3X, and 4X starting addresses. For example, %MW10100 can be found at Modbus address 410099 on Schneider CPU. Similarly, %MW1100 is at address 41099 or 401099 on extended addressing. Addresses from %MW0 to %MW9999 can have 5 or 6 numbers in Modbus, while %MW10000 and above always have 6 numbers.
It is commonly referred to as 5-digit addressing in the tech world, where the maximum register value is (4)9999. Extended addressing, known as 6-digit addressing, allows for a maximum register value of (4)65536. The same concept applies to other memory area designations.
When setting up Schneider PLC for Modbus addressing, it is important to understand the different address formats. In general, the 0x format is used for %Mx bits (both read and write functions), while 1x is typically for %Mx bits that are only for reading. The 3x format is reserved for %MWx words that are only for reading, and the 4x format is for %MW words that can be both read and written. However, it is worth noting that on some PLC models, the 1x format may actually be used for discrete inputs (%Ix), while the 3x format may point to the analog input area (%IWx). Additionally, M340 PLCs come equipped with system words that can be utilized to adjust the Modbus addressing offsets from the %M and %MWx addresses. By default, the offset is set at 0, resulting in a difference of 1 between the Modbus address and the %M and %MW areas. This discrepancy is due to the fact that Modbus addressing begins at 1, while the %M and %MW areas start from %M0 and %MW0, respectively.
In order to set a Modbus offset of 1 on M340 or M580 PLCs, you will need to establish four variables using the addresses %SW138, %SW139, %SW140, and %SW141. Ensure that the value of each variable is set to "1" in order to implement the offset successfully.
Hi there! It seems like you're experiencing an off-by-one issue, which is quite common in Modbus addressing because some systems count starting from 0, while others start from 1. So Modbus address 44514 could very well be MW4513 in PLC addressing. Regarding the OR operation on the 7th bit of %MW10100, you'd probably want to use a bit mask. This way, your original bits don't get disturbed while the 7th bit is being set. So with Modbus, you may need to use function code 16 (Preset Multiple Registers) to set single-bit values. Lastly, it's important to consider endianness — Modbus uses big-endian model while PLCs may use little-endian. And yes, Node-RED is quite a good tool, but do consider using libraries like JAMod for Java application, which provides flexibility. Hopefully this helps!
It sounds like you've run into some common confusion around Modbus addressing schemes! Just to clarify, when dealing with %MW registers in a PLC, they often refer to memory locations, while Modbus uses a zero-based addressing system that adds an offset when you translate those addresses. For the issue with setting the 7th bit, make sure you're using the correct bit mask for the OR operation. Essentially, if you're trying to set a specific bit, your mask should be `1 << 6` for the 7th bit (since bit indexing starts at 0). For example, if `%MW10100` is your target, you can read the current value, apply the OR operation using this mask, and then write it back. As for the discrepancies in address ranges, it might be worth double-checking whether any internal mapping or scaling is happening in the PLC configuration. Best of luck with your Node-RED experiments and transitioning to Java!
✅ 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: Answer: The discrepancy in addresses may be due to how the Modbus addressing is configured or interpreted. Double-check the addressing scheme and ensure proper translation between PLC addresses and Modbus addresses.
Answer: Answer: This could be related to how the Modbus addressing is being handled in the communication setup or software. Verify the Modbus addressing and data interpretation to ensure correct data retrieval.
Answer: Answer: The issue with the OR operation could be due to how the Modbus addresses are being mapped or manipulated in the software. Ensure that the correct Modbus addresses are being used and that the bitwise operation is implemented correctly.
Answer: Answer: Tools like Node.js Node-RED Modbus Module can be utilized for experimentation with Modbus communication in a prototype setting. Additionally, libraries for Java applications can be
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.