Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

How to merge four words to one value?

HVAC and Pumping Forum

Support Forum for HVAC and pumping machines, Modicon M17x and EcoStruxure Machine Expert HVAC software for chillers, AHU, CRAC units for datacenters or process chillers applications - from design, implementation to troubleshooting and more, by Schneider Electric.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Industrial Automation
  • HVAC and Pumping Forum
  • How to merge four words to one value?
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
FedericoM
Commander FedericoM Commander
71
Bastian_Schmitz
Admiral Bastian_Schmitz Admiral
48
LeTomas
Lt. Commander LeTomas Lt. Commander
14
View All
Related Products
product field
Schneider Electric
EcoStruxure™ Machine Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to HVAC and Pumping Forum
jhonut
Ensign jhonut
Ensign

Posted: ‎2021-05-21 05:28 AM

0 Likes
3
3701
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-05-21 05:28 AM

How to merge four words to one value?

I get an INT64 value, through Modbus TCP from a power meter,  in four %IW (%IW68, %IW69, %IW70, %IW71).

My question is how could I merge these four input words to a value? I have seen here that LWORD type exists, but I couldn't find a function, like WORD_AS_DWORD, to merge my input values into a value. How could I do this?

I am using a TM251MESE PLC.

Many thanks in advance!

 

 

 

Labels
  • Labels:
  • Efficiency
  • Modicon M2xx
  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 3
LeTomas
Lt. Commander LeTomas Lt. Commander
Lt. Commander

Posted: ‎2021-05-21 06:24 AM . Last Modified: ‎2021-05-21 06:25 AM

0 Likes
2
3693
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-05-21 06:24 AM . Last Modified: ‎2021-05-21 06:25 AM

Hi @jhonut ,

 

I believe you could try to create a %ML variable type LWORD to overlap those registers. Something like this:

 

Address.PNG

And you can use in your program the %ML variable created.

 

I am not sure if inside Machine Expert we have function WORD_AS_LREAL or similar 🤔

 

Best regards,

  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

jhonut
Ensign jhonut
Ensign

Posted: ‎2021-05-21 06:36 AM

In response to LeTomas
0 Likes
1
3685
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-05-21 06:36 AM

Thanks for reply, @LeTomas!

I have searched in LibraryManager for WORD_AS_LREAL or DWORD_AS_LREAL, but I didn't find anything. I will try to use LWORD as you suggested.

Reply

Link copied. Please paste this link to share this article on your social media post.

SimA
Ensign SimA Ensign
Ensign

Posted: ‎2021-05-21 02:32 PM . Last Modified: ‎2021-05-21 02:38 PM

In response to jhonut
1 Like
0
3683
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-05-21 02:32 PM . Last Modified: ‎2021-05-21 02:38 PM

 

You could do it with localized variables %MW and %ML however you have to be careful about the position of the variables and that it's not used anywhere else.

 

I would typically use pointers instead.  I do it in 2 lines of structured text.  You could also embed that in a custom function that you would call in your program in any language.

Here is the function that you can import:

Download link 

 

I declare a variable that is the array of 4 words and a variable that will be the destination 64bit LINT.

I also declare a pointer to LINT that will be the address location of my LINT variable.  This location is automatically calculated at the time the project is built.

 

With this line " pLint := ADR(arWord1); " , I grab the address location of the word array and move it to my long int pointer.

In the next line " liLongInt1 := pLint^; " , I dereference the pointer with the ^ symbol.  It extracts the value from the address location contained in the pointer.

 

VAR
     arWord1 : ARRAY[0..3] OF WORD;
     liLongInt1 : LINT;
     pLint : POINTER TO LINT;
END_VAR

 

 

pLint := ADR(arWord1);
liLongInt1 := pLint^;

 

  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

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