I have a somewhat interesting problem. I have a tag that stores a value that represents the total number if linear feet ran off our line for an entire shift. This value is stored as a REAL data type on the Winder PLC where it is primarily needed. However, we also pass this information both to the main line's PLC and to a Historian database, both of which store the value as a 32 bit integer.
Now here's where it gets interesting. Whenever the value of the REAL tag at the winder passes 32,768(which you may recognize as the maximum value of a 16 bit integer, I feel that has to be significant) the main PLC and the Historian database both show the value instantly double to 65,536 and then start counting backwards. There is no way possible for this machine to go backwards fyi. Again, keep in mind that on the Winder HMI it displays just fine, there is only an issue when it gets passed to one of the systems that stores it as a DINT.
So what is going on here? I assume it has something to do with the conversion from REAL to DINT, but how exactly?