Convert incoming string data to float and provide division all in the same tag instead of a PE
OPC server is outputting data with the currency data type (VT_CY) and it needs to be stored in the float type. As per the OPCtoCSV document, the OPCtoCSV tool/OPC interface invokes VariantChangeType in order to convert this currency value to it's string representation before PI receives it.
"Some OPC servers have property values that are type VTCY. The VTCY type is intended to represent monetary values. A VTCY value is a fixed-point number with four digits after an implied decimal point that is scaled and stored as a 64-bit integer. When VariantChangeType converts a VTCY value to string, the string representation is an integer. To account for the implied decimal point, divide the integer by 10000. That is, “123456” actually represents 12.3456 (using dot to indicate the decimal point), “123” represents 0.0123, and so forth. (p. 19)
So essentially, PI is receiving an integer value of the string type that is several orders of magnitude larger than the original. He needs PI to first convert this value from a string to a float, and then scale it down by 1/10,000. Typically, a conversion from currency to float would be done on the source before the data reaches PI, but his OPC vendor has prevented this.
As far as I know, the Data Archive is not capable of automatically converting and scaling this event before archiving it. We tried setting a conversion factor to 0.0001 and changing the point type to float but then we started getting "Bad" values. The only way I know to accomplish is to create a performance equation that will parse the string value (using Float()) and then scale the result by 1/10,000. In fact, we did create a test performance equation and it did exactly what we needed it to.