Logging BCD data

To log data from Automation Direct PLCs, I use KEPDirect, their version of KEPServer. The data is sent coded BCD, but just looks like 2s complement to FSQL and the database. Is there a FSQL function to convert it?

No, there currently isn’t a function in FactorySQL to convert BCD encoded values. However, in your tag configuration in KepDirect, you can specify that the tag’s data type is BCD, which will cause KepDirect to do the decoding and send the value as 2s compliment to FactorySQL.

Thanks for the question,

I am currently working on a project using the same setup.

You can convert the number in the Kepware. Click on the tag and then click the scaling tab. Then select the way you want it scaled if at all and the data type it will be. I select short for most of the BCD values but you can choose whatever works best from the drop down selection.