Hello,
Here’s my problem:
With the Modbus driver, negative values are implemented as 65536.
The problem arose because I’m logging the temperature of my freezer (-21°C), which is a permanently negative temperature. So, in Grafana, I performed an operation of -65536, and that worked.
Now, I’m logging the values from my weather station, so the outside temperature and dew point have both negative and positive values. My previous rule no longer works.
My solution:
Perform the following operation directly in OpenHistorian: IF value > 6000 Then value - 65536 Else value = value.
So, I created:
As you can see, it’s not working.
Thank you for your help.
Hello Philippe,
The issue seems to be a somewhat fundamental misunderstanding of how the dynamic calculator works. Each adapter can only produce values for one measurement. So if you are trying to produce three values, you need three separate adapter instances to make it work.
Note that there is no outputMeasurementKeys parameter. The parameter you want is outputMeasurements, and if you supply more than one output measurement to the dynamic calculator, the adapter will throw an error during initialization.
Thanks,
Stephen
Hello
Thank you for your reply.
I apologize for my ignorance, but I’m not a specialist in this field; my expertise lies more in automation.
I modified the query, but it didn’t change anything.
inputMeasurements=DATA:104; expressionText=x > 60000 ? x - 65536 : x; variableName=x; outputMeasurements=DATA:163; FramesPerSecond=30; LagTime=3; LeadTime=5; CalculationInterval=1
The issue now is how you specify input measurements. There are no inputMeasurements or variableName parameters. Try this connection string instead.
variableList={x=DATA:104}; expressionText=x > 60000 ? x - 65536 : x; outputMeasurements=DATA:163; FramesPerSecond=30; LagTime=3; LeadTime=5; CalculationInterval=1
Hello, please excuse my late reply.
I will test your solution later.
To fix my problem more simply, in the ‘INT’ read by OpenHistorian, I added the value 1000 to my PLC and then added -1000 to the tag, which directly gives me the correct value in the database.
Thank you for your help. I will test the calculator in the future.