Machine Automation Forum
A forum addressing machine automation solutions for the complete machine lifecycle. Including offers like Machine Advisor, Modicon PLC/PacDrive, Lexium or Preventa. Discuss and share knowledge on offers relating to cloud-based service platforms, machine localization and monitoring, industrial operations control, motion products as well as safety function!
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-02-10 03:05 PM
I'm using ESME HVAC 1.4 and am trying to read a Mettler Toledo scale that has a 32bit real weight in two consecutive registers.
I'm not seeing a way to configure the Modbus Ethernet settings to read a REAL.
Is there a way to do this or to convert two WORDS to a REAL? In other environments I would normally create a union overlapping two words and a real variable registers or there would be a built in function.
Thanks in advance for any help on this.
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: 2023-02-12 07:02 PM
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: 2023-02-12 10:59 PM
Or you use dedicated FB which is included but a little bit hidden in ESME HVAC. You can find the dedicated function block in the TVDAs. I did also attach this block.
The tip from Ismet is really usefull if you want to use this typ of modbus slave in the past and if you want to read a lot of values with different register addresses. In that case the configuration will be easier in the future. WIth the modbus custom object you could easiely creat your own macros.
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: 2023-02-11 11:35 AM
My cent of help. I may be completely mistaken, I´ve never done this before:
I guess the real weight is something like:
realweight := uint1 + constant * uint2 . Is this what you mean by overlapping ? Is the format known ?
If you know this formula, conversion to a real value seems rather straightforward:
realweigth := TO_REAL(UINT1) + TO_REAL(UINT2) * CONSTANT, where constant should be a real value.
If for example your first word has integers while you second word has decimals, this would look like;
realweigth := TO_REAL(UINT1) + TO_REAL(UINT2) / 100.0;
Again, I´ve never done this so I might be completely oob here. Hope this helps.
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: 2023-02-12 05:04 PM
In some PLCs you could do the following as long as the scale maps the data in a real format used by the PLC.
%mw100 := word1;
%mw101 := word2;
real Weight := %mw100;
This would be similar to a C Union.
I either need to read a real register from the scale which I haven't figured out how to do in Machine Expert HVAC yet, map registers like a Union, or convert it.
My initial attempts to solve this have me stumped.
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.
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: 2023-02-12 10:59 PM
Or you use dedicated FB which is included but a little bit hidden in ESME HVAC. You can find the dedicated function block in the TVDAs. I did also attach this block.
The tip from Ismet is really usefull if you want to use this typ of modbus slave in the past and if you want to read a lot of values with different register addresses. In that case the configuration will be easier in the future. WIth the modbus custom object you could easiely creat your own macros.
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: 2023-02-20 12:09 PM
It looks like in simulation, this should work.
It is hard for me to find information in the TVDAs
Thanks!
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: 2023-02-20 12:11 PM
I had forgotten about this.
I saw it once but didn't use it.
I will have to give this a try when I have access to some hardware.
Thanks!
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: 2023-04-10 02:26 AM
What's the name of the FB in the ESME HVAC? is it the same as the one attached?
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: 2023-04-11 09:49 AM
Yes it is.
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: 2023-04-13 03:36 AM . Last Modified: 2023-04-13 03:37 AM
I managed to get the proper result using the FB method (reading a Powermeter Voltage)
but it seems when using the Modbus Editor method I always got the word mixed up ->
I've tried the "Modbus 32bit words order" setting, and there seems to be no difference, any suggestion?
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: 2023-04-13 06:22 AM
I haven't tried the modbus custom editor yet.
What options are there for word and byte swapping? Maybe try them all??
You should be able to see the differences when displaying the result in hex format. If you don't something is wrong.
What version are you using and have you downloaded properly? I have found that if it still doesn't work to cycle the PLC power.
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: 2023-04-13 10:10 AM . Last Modified: 2023-04-13 10:14 AM
I think I figured it out:
Somehow that particular setting (and only that setting, I've tried others) didn't get applied when changed unless you restart the whole application
I've tried it multiple time just to confirm*
- removed the existing modbus device from the RS-485-2 (w/ unswapped word order) and re-added it after changing it in the editor
-> wrong order
- Added a completely new modbus device in the catalog w/ the proper setting using the editor (swapped REAL & DWORD)
-> correct order
- Same with the first, but for the working modbus device
-> still correct order
- Restarted the app and downloaded all to the PLC (with the unswapped order in the new modbus device)
-> finally incorrect order
*All without hard-unplugging the PLC, just the reboot request from the software when downloading all
So yeah that's an interesting quirk with the software, but I'm glad to get to bottom of it 🙂
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: 2023-04-17 11:37 AM
If you change something in configuration part of the software you need to make a download all, or you need to download the connec.par file separat via commisioning right mouse click on cfg file to update the communicaiton.
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.