Applies To:
  • CitectSCADA 7.0

I am storing a Hex value in my PLC and would like to read this value in CitectSCADA. However, CitectSCADA does not natively support a Variable Tag of type Hex. How can I read this Variable Tag in CitectSCADA and preserve it's Hex representation? 

One solution is to configure your Variable Tag with a CitectSCADA native data type (e.g. INT) which means that CitectSCADA will represent your Hex value as an Integer (e.g. If you have 31 Hex stored in the PLC, CitectSCADA will read 49). However, if you would like to display 31 on a page or in a Cicode function, you can use the HexToStr Cicode function to convert it.

Another possible solution is to set the data type to BCD or LongBCD which will allow you to read/write the hex value without having to do any Hex-to/from-String conversions. It is important to note however that this solution will only work for Hex values containing numeric digits (i.e. 0-9, but not A-F).