News:

  • September 12, 2025, 07:21:19 PM

Login with username, password and session length

Author Topic: Converting Binary to Hex for Error codes in sureservo2  (Read 891 times)

LennyG

  • Newbie
  • *
  • Posts: 3
Converting Binary to Hex for Error codes in sureservo2
« on: June 11, 2025, 02:48:08 PM »
When you read the fault or error codes from the Sureservo2 servo drives from automation direct the modbus reads it as a decimal but the manual and the display are showing hex numbers. How do I convert the Modbus value I read so it is hex so I can display it to an operator through my C-more display (instead of them having to convert using a calculator or opening up the panel and reading the error)?
Is there a simple command to convert it? Some equation in the MATH function that people use?

Bolt

  • Hero Member
  • *****
  • Posts: 588
Re: Converting Binary to Hex for Error codes in sureservo2
« Reply #1 on: June 11, 2025, 02:56:59 PM »
While you may be able to format and integer as hex in the HMI, the easiest method would be to do a STRPRINT FmtInt(D0,hex).

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3759
    • Host Engineering
Re: Converting Binary to Hex for Error codes in sureservo2
« Reply #2 on: June 11, 2025, 03:57:17 PM »
Your HMI should let you display any numeric value as decimal or hexadecimal (or octal or binary)

For example, 15 will display as 15 in decimal format, or 000F in hexadecimal format (with leading zeroes).

C-more should have that option.  If it doesn't, let us know (you can do string stuff to format any numeric value as needed).