AdvancedHMI Software

General Category => Support Questions => Topic started by: pedroceronjunior on December 03, 2015, 09:28:19 AM

Title: Decimal to Hex
Post by: pedroceronjunior 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 . :-[ :-[
Title: Re: Decimal to Hex
Post by: Archie 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