Important Announcement: Protecting our Community from Spam Events
Dear Members, we apologize for any disruption or inconvenience caused by the recent spam incidents, and we want to assure you that our dedicated team is actively investigating each reported instance of spam and implementing robust measures to mitigate the impact. Learn more on Spams Mitigation Guidelines
Thank you,
Schneider Electric Community Team
Modicon PAC Forum
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.
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.
Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.