Jump to content
Sign in to follow this  
guilherme_pires

Double Word to ML

Recommended Posts

Hello,

 

A DW and an ML are both 32-bit integers.  The only difference is the DW is unsigned, and the ML is signed.  Therefore, you can just store the DW straight into an ML, as long as the value in the DW is not too large (i.e. over +2,147,483,648).

Share this post


Link to post
Share on other sites
Hello,
 
Thanks for the reply , but if my DW is more than +2,147,483,648 , I can divide it into two MLs ?
 
I am using that in a flow meter in high-speed input , so that the value in the DW is more than +2,147,483,648 .
 
I saw on the high-speed input I can use ML , so I have a doubt whether the value in ML is more than +2,147,483,648 that will rewrite  automaticaly or i need to do a reset on the ML?
 
This is my program:
 
  

DW19

 

Share this post


Link to post
Share on other sites

Hello,

 

I am unsure what you mean by "divide it into two MLs".  Are you trying to build a larger integer out of two MLs?  If so, it is not possible to create integers out of two other integers.

 

The range for a DW is 0 to +4,294,967,295.  The range for an ML is -2,147,483,648 to +2,147,483,647.  The largest number the controller can handle in an integer is 4,294,967,295.  Since you are working with pulses from a HSI, the pulses cannot be negative.  So there shouldn't really be a need to use MLs for the HSI. 

 

Hope this helps.

Share this post


Link to post
Share on other sites

Typically if you overflow an integer data type it rolls over to it's maximum negative number and counts from there which can cause some pretty weird issues if you haven't accounted for it.

 

 

What is the goal of the high speed counter? What happens with the count when you're done with it, or when it reaches a setpoint?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...