Machine and Motion Control Forum
Support forum for Machine and Motion Control solutions, including Lexium MC12 and robotics, PacDrive, Modicon PLCs and I/Os, EcoStruxure Machine Expert Twin, … - from design, implementation to troubleshooting and more, by Schneider Electric
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-10-10 04:19 PM
How can I display a Modbus Floating Point in a M241 PLC? In all the documentation I've looked at over the internet and what not it shows the modbus register as %MDxxx but that is a Double Integer not a floating point. Here is my example:
In my HMI (Ignition) I have floating point 40100 = 11.22
In M241 using SoMachine I have : Integer %MW99 = 16691 & Integer %MW100 = 34079 (which is correct) how do I display in floating point?
The documentation claims %MD100 is the correct way, but I have a zero in that register. I'm sure I'm missing something. 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: 2022-10-10 10:42 PM
Try [Modbus]HRF100
https://docs.inductiveautomation.com/display/DOC80/Modbus+Addressing
if it still not work check the word order in ignition.
best regards
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: 2022-10-11 12:27 AM
Hi @ryanAstiefes ,
If you have the real value in two words then you can assign a %MD to overlap those words so the software will read the variable as floating point.
For example if you have the variables from modbus assign to two words in the M241 example:
wVariable01 AT %MW66 : WORD;
wVariable02 AT %MW67 : WORD;
rVariable AT %MD33 : REAL;
Then based in your values (maybe swap required) wVariable01 could be 16691 and wVariable02 could be 34079 then the result directly read by the PLC in rVariable will be 11.22.
For more information about addressing variables in the PLC:
In the next library i have done something related to converting 2 words to real using ADR, take a look below:
https://schneider-electric.box.com/s/73v3w1yofj1ek00pykmxjuwhr5n6xto1
Good luck!
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: 2022-10-11 11:25 AM
Thanks LeTomas I did not realize the offset was (%MW66 / 22) would hold the Floating point %MD33 and did find it in some documentation which now makes more sense. I've never seen the modbus protocol structured this way before.
In Ignition I can read and write to %MW66 (40067) as a floating point along with looking at each register individually as a integer (40067&40068), but when I try to read and write to %MD33 (40034) as a float in Ignition I have no value even tried indexing this register both positive and negative (40030/40031/40032/40033/40035/40036/40037/40038) thinking it's offset might me bigger than one but with no luck.
Is anyone else getting the same results?
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 board - and gain access to more than 10,000+ support articles along with insights from experts and peers.
With achievable small steps, users progress and continually feel satisfaction in task accomplishment.
Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.
of