Announcement

Collapse
No announcement yet.

Conversion question?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • Conversion question?

    I am currently interfacing a C-more Micro HMI with a Do-more H2-DM1E. My question/issue is, when I enter a actual measurement into the HMI in inch increments, how do I convert that into a number to represent PPR for my encoder? Currently 1 inch of material equates to 33.3 PPR. I was going to round it down to 1 inch of material is 33 PPR. I am unsure of what instruction or instructions I need to use to make this work. Thank you for any assistance!


  • #2
    The Cmore Micro does not have a built in scaling function. You will have to perform the conversion in the H2-DM1E
    thePLCguy

    Bernie

    Comment



    • #3
      No need to round the conversion factor. I am guessing that it may actually be 33.3333... and you rounded that? MATH can do that on the final calculation. Say your HMI is writing inches value to D42, and you want the pulses to go into D100 as an integer.

      MATH D100 "ROUND(D42 * 33.3333)"
      (if I am wrong about the 33.3333, just change it to 33.3)
      There are 10 kinds of people in this world, those who know binary, and those who do not.

      Comment



      • #4
        franji1 Thanks for the information. After I posted the question I couldn't stop playing around. I figured it out utilizing the math IBOX. I used TOINT(SQRT(R0)) This allowed me to input numbers such as 1.75 inches or 1.25 on my HMI to a D location. From there I used another math instruction R0 * 33.3 and shifted that number to a V memory location for monitoring. I will definitely try your instruction on the test bench. If it achieves the same outcome that just means one less Ibox or instruction in the overall logic. Simple is always better, lol.

        Comment



        • #5
          Just curious, why are you using square root? I assume that's what the SQRT is.
          thePLCguy

          Bernie

          Comment



          • #6
            TOINT truncates. ROUND rounds. TOINT(3.9) equates to 3. ROUND(3.9) equates to 4. Sometimes you want the former, sometimes the latter.
            There are 10 kinds of people in this world, those who know binary, and those who do not.

            Comment

            Working...
            X