I want to add noise to a value for a demo. I have OPC tags generating random numbers. I want to multiply this random number times a value from my database. However, I don’t have and can’t buy the ODBC driver for OPC.
If I could read a SQLTag in FSQL, I could get the value from my database that way, and thought that I could do what I needed in an action item.
Alternatively, I suppose I could write a script to run periodically to do this in FPMI, but I have run up against some walls on that route.
You can do this all within the SQLTags system. Make the following tags:
OPCValue = OPC Tag value from your OPC server RandValue = DB Tag bound to a SQL Query expression doing a “SELECT RAND()” NoiseValue = DB Tag bound to an expression that is OPCValue * RandValue
I would have thought that. In fact, I tried it, to no avail.
I have two SQLTags. One is reading a value from my database, the other is simulator data from KepServerEX. Both show up as good data in the SQLTags Browser.
All were float4. When I changed the random number tags to float8, all is well. This even though the SQLTag Browser shows good data quality with either float4 or float8.