/!\ Warning /!\ : For performance reasons, Custom Data Reference should be your last solution or should be used sparingly.
Here is a small custom data reference that may help you if you are doing a lot of Hex / Bin / Dec convertion. In order to use it, you will need to register the attached .dll file :
- Copy the attached .dll in your AF Plugin folder (\PIPC\AF\PlugIns\)
- Open the command prompt in the AF folder (\PIPC\AF\)
- And run the command :
RegPlugIn64.exe /f "C:\Program Files\PIPC\AF\PlugIns\OSIsoft.AF.Asset.DataReference.HexBinDecConvertor.dll"
Then, you will be able to use the "HexBinDec Convertor" Data Reference. This custom data refernce take two parameters. The first one will be the AF Attribute to convert and the second one, a number between 1 & 6 in order to indicate the conversion wished :
- From Hex to Bin
- From Hex to Dec
- From Bin to Hex
- From Bin to Dec
- From Dec to Hex
- From Dec to Bin
- 15 => 10101
- 15 => 21
- 15 => Error : The input string 15 is not in binary. Parameter "3" means conversion from Bin to Hex.
- 15 => Error : The input string 15 is not in binary. Parameter "4" means conversion from Bin to Dec.
- 15 => F
- 15 => 21
I hope it will help you.
PS: the code is available on github
GitHub - thib-osi/PI-AF-HexBinDexDataReference: The HexBinDecConvertor Custom Data Reference (CDR) is a small data refer…