Author Topic: Decimal to Hex  (Read 1108 times)

pedroceronjunior

  • Newbie
  • *
  • Posts: 3
    • View Profile
Decimal to Hex
« on: December 03, 2015, 09:28:19 AM »
My PLC only use hexadecimal values ​​, the counters and timers values ​​are given in Hex , the AdvancedHMI converts this value in decimal , I need to show that value in hex ​​in a BasicLabel . :-[ :-[

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Decimal to Hex
« Reply #1 on: December 03, 2015, 11:38:49 AM »
The BasicLabel does not have functionality to convert to Hex.
You can do this with a DataSubscriber and a Label.

- Add a DataSubscriber to your form
- Set the PLCAddressValue to the address you want to display
- Add a Label from the All Windows Forms group in the ToolBox
- Double click the DataSubscriber and enter this code:
Code: [Select]
Try
  Label1.Text=DataSubscriber1.Value.ToString("X")
Catch ex as exception
End Try