Jump to content

Double Word to ML

Recommended Posts

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:



Link to comment
Share on other sites



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.

Link to comment
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?

Link to comment
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.

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.

  • Create New...