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: 2022-12-10 06:34 AM
How to read 64-bit Modbus register (4xIntegers) and convert it to understandable value in Control Expert?
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-12-12 07:06 AM
I did something like this:
1st is to read the data in words, or you can use byte as word instruction
2nd to split the sign, exponent, and mantissa from 64 bit format
3rd to rearrange the sign, exponent, and mantissa to 32 bit format
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-12-10 09:19 AM
Assuming you know how to receive the information using the DTM browser (if not let me know). Use a move command to move the modbus information received to any free %MW location. Make a new variable (LREAL) starting at that same %MW. You can then use that variable and view the value. [I'm on mobile, so let me know if that is enough to help, if not I can provide full details Monday].
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-12-10 04:49 PM
Problem is Control Expert/Unity Pro doesn't support 64 byte float or double float. We need to translate 64 byte float to 32 byte float manually (create logic) to workout the exponent and mantissa, and lose some precision.
These websites helps you breakdown the 2:
https://www.binaryconvert.com/convert_double.html
https://www.binaryconvert.com/convert_float.html
https://ryanstutorials.net/binary-tutorial/binary-floating-point.php
Essentially you need to remap the exponent from 11 bit to 8 bit and mantissa from 52 bits to 23 bits
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-12-12 04:57 AM
I wrote 4 INTEGERS by bits to 1 STRING. By using LEFT_INT, MID_INT and RIGHT_INT function blocks received sign, exponent and mantissa. How to convert them from STRING to numbers (int, dint, real)?
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-12-12 07:06 AM
I did something like this:
1st is to read the data in words, or you can use byte as word instruction
2nd to split the sign, exponent, and mantissa from 64 bit format
3rd to rearrange the sign, exponent, and mantissa to 32 bit format
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: 2024-08-09 05:20 AM
Hello,
I'm wondering about something. There should be 4 words in total for 64 bits, but you did it with "Double2_I, Double3_I, Double4_I". Where did you use "Double1_I"? I couldn't see it in the photo.
I'm trying to read a "wh" value from the energy analyzer from the modbus map in order;
801
802
803
804
with a total of 4 INT/Holding Registers.
Does it have to be used as;
Double1_I : 801
Double2_I : 802
Double3_I : 803
Double4_I : 804
?
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.