Hi,
First post for me, although I've lurked here a bit over the years, I've searched for more info in Seimens help, website and here for around 12 hours to get this far, Most of the info about seems to be dead links or WinCC Flex.
I'm trying to get a DINT to display in a Static Text box as Hex, most of the project is in C but it doesn't have a Hex conversion function AFAIK, so I'm tryng to get it to work in VBS, my first VBS script ever.
If I replace HexString in the Text statement to "Test1" it displays ok, but if I set HexString to "Test1" it doesn't work for some reason, So I'm thinking I'm setting varibale types wrong somehow but can't see any issues in Help & the scripts I've checked against.
First post for me, although I've lurked here a bit over the years, I've searched for more info in Seimens help, website and here for around 12 hours to get this far, Most of the info about seems to be dead links or WinCC Flex.
I'm trying to get a DINT to display in a Static Text box as Hex, most of the project is in C but it doesn't have a Hex conversion function AFAIK, so I'm tryng to get it to work in VBS, my first VBS script ever.
If I replace HexString in the Text statement to "Test1" it displays ok, but if I set HexString to "Test1" it doesn't work for some reason, So I'm thinking I'm setting varibale types wrong somehow but can't see any issues in Help & the scripts I've checked against.
Code:
Function Text_Trigger(ByVal Item)
Dim ObjName, DINTTag, HexValue, HexString, HexTag
Set ObjName = ScreenItems("PunchCodeHex1")
Set DINTTag = HMIRuntime.Tags("BNDDoors_SERVERPC::Panel00PunchCode")
Set HexTag = HMIRuntime.Tags("BNDDoors_SERVERPC::Panel00PunchCodesHex")
DINTTag.Read
Set HexValue = Hex(DINTTag)
Set HexString = CStr(HexValue)
HexTag.Write HexString
ObjName.Text HexString
End Function