Ask our Experts
Didn't find what you are looking for? Ask our experts!
Ask Me About Webinar: Data Center Assets - Modeling, Cooling, and CFD Simulation
Join our 30-minute expert session on July 10, 2025 (9:00 AM & 5:00 PM CET), to explore Digital Twins, cooling simulations, and IT infrastructure modeling. Learn how to boost resiliency and plan power capacity effectively. Register now to secure your spot!
A forum for topics related to the scope of Modicon PAC offers and ecosystem along the whole lifecycle: Modicon M580 and 340, EcoStruxure Control Expert, EcoStruxure Process Expert (Unity Pro) and more.
Search in
Posted: 2021-03-09 12:10 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-03-09 12:10 AM
Hello guys,
I have created some structures in somachine in order to be transmitted with modbus from a M241 PLC. The problem is that all these data are being transmitted but not correctly. For example I have the following data:
W:int:=50;
VA:int:=1000;
Varpower:int:=2000;
Hz:udint:=50;
TotWhInj:ulint:=100;
TotWhAbs:ulint:=100;
So these data are being transmitted with modbus and I am checking with modbus poll whether the transmission is okay or not. So when I check on modbus poll I found out this:
- When I change the value of Hz (That occupy 2 modbus registers) it doesn't change the registers of Hz but change one register of Hz (The second one) and the first register of the next variable.
I am not sure why that is happening. But what I know is that If change the types from udint and ulint to uint everything works fine.
If someone could help me I would appreciate a lot. Thanks in advance!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-03-15 12:44 PM
You may find that the structure is effectively even word aligned because of the udint.
There could be a dummy word inserted after the Varpower variable so the Hz variable is sitting on an even word boundary.
If this was a Modicon M340 or M580, that is exactly what we would get.
There is some description on Help at this location:
Machine Expert > V1.2 > Controllers > M241 Logic Controllers > M241 Logic Controller - Programming Guide > Memory Mapping
Link copied. Please paste this link to share this article on your social media post.
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.