I am faced with a situation where I need to retrieve data from a device that can send registers either as 32 bits or a pair of 16 bits. However, it seems that the microcontroller can only read a single 16-bit register, and the only format supported in the modbus instruction block is a WORD. Is there a solution to make this compatible and functional?
For the Rockwell Automation Micro820, the manual provides detailed information on using DINT (Signed 32-bit integer value) or UDINT (Unsigned 32-bit integer value) variables, as seen on page 49. The manual even includes an example of a UDINT being used, showing that it is indeed possible. Additionally, the manual demonstrates the loading of a Modbus message into a UDT on page 19. Based on this PLC perspective, it appears that there are no issues on this end. What devices or software are you utilizing on the other end?
I was working with the Totalflow XFC system and attempting to utilize the Modbus TCP function block. However, I understand your point about the CIP points you mentioned. It seems that in the MSG_MODBUS2 block, the local address array only accepts a WORD from what I can gather.
I may have to consider utilizing consecutive numbering to improve efficiency and organization.
In response to a question by CProv, it was suggested that using serial communication may not be necessary if Modbus TCP is functioning correctly, as both methods transfer the same data. 1) Are you successfully receiving data, even if it is in the form of 16-bit Words, from the Modbus Slave device (Totalflow XFC)? 2) If so, 2.1) What are the values of the 16-bit Words being received by the Micro820 PLC? 2.2) What are the values of the 32-bit integers (or REALs) that you are expecting to form from each pair of 16-bit words? 3) Can you provide a link to the manual for the Totalflow XFC that includes the addresses of the Input or Holding Registers for further reference?
Great news for those who appreciate the classics! Unfortunately, the XFC/XRC Series does not support Modbus TCP and requires the use of serial communication. The "XFC/XRC Series Start-Up Guide" provides limited information on Modbus, emphasizing the use of either ASCII or RTU protocols. To establish communication, consider using RS485 with a USB to RS485 converter and a Master/Slave program like "Modbus Poll." One option is the free Rilheva Modbus Poll, which can be downloaded in exchange for an email address. Keep in mind that data formatting can vary, potentially involving nibble swapping at the byte level as per Modbus standards. As for standards, Modbus lacks a clear-cut definition, leading to various approaches and variations. When working with PLCs, organize your data into 32-bit data structures for efficiency. It's worth noting that the XFC supports the ASCII version of Modbus, adding a cool factor to the mix.
I'd suggest investigating if your microcontroller has the capability to sequentially read two 16-bit registers and then combine the data internally. You might also use the modbus instruction block to read the two successive 16-bit registers as two separate WORDs and then piece them together in your application logic. It requires managing the data manually, but that's probably your best bet in this scenario.
It seems like your microcontroller and modbus setup will demand a more iterative approach. Given that your MCU can only process 16 bits at a time, consider reading the data in two separate 16-bit chunks and then combine them to generate the full 32-bit register value. Just be aware of the correct bit ordering (high/low order first) based on the communication protocol in use. Another aspect to note will be the Endianness of your system. These factors could somewhat ramp up the complexity but with proper systematic coding, it should work. This procedure might consume a slightly higher cycle time but can ensure compatibility and functionality.
It sounds like you're somewhat stuck because your device can output 32 bits, but your microcontroller only supports 16-bit input. Have you considered breaking down the 32-bit data into two segments and then reading them separately? Essentially, you'll be reading the first 16 bits, storing it temporarily, then reading the second bundle of 16 bits and appending it with the previous data. This way, you can handle the 32 bits in two rounds of 16 bits each, which should work with your microcontroller's constraints. Double check if your device preserves the byte ordering (endianness) when switching from 32 bit to a pair of 16 bits though, because that could potentially mess up your data interpretation.
✅ 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: 1. Q: How can I retrieve 32-bit or a pair of 16-bit registers with a Micro820 using Modbus TCP? The Micro820 microcontroller can only read single 16-bit registers, but there are solutions to handle 32-bit or paired 16-bit registers. You may need to manipulate the data received from the device to combine two 16-bit registers into a 32-bit value. 2. Q: What format is supported in the Modbus instruction block for the Micro820? The supported format in the Modbus instruction block for the Micro820 is a WORD, which represents a 16-bit register.
Answer: Yes, you can make the retrieval of 32-bit or paired 16-bit registers compatible and functional with the Micro820 by implementing custom logic to handle the data conversion and merging of two 16-bit registers into a 32-bit value.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.