This project has moved. For the latest updates, please go here.

DynamicCalculation Parse Errors - How to prevent?

May 9, 2013 at 6:00 PM
Under uncertain, unknown conditions, I get the following error from the ErrorLog:
Could not find a field/property/variable with the name 'frq'
I assume that this is from the ConnectionString such as:
VariableList={frq=PPA:3860;slp=PPA:4223};ExpressionText=If(ABS(frq - 60.0) < 0.01, 0.0, ABS((((frq - 60.0) * (360.0/30)) - slp)/((frq - 60.0) * (360.0/30))));FramesPerSecond=1;LagTime=20;LeadTime=3;OutputMeasurements=PPA:4339;

In past times this has worked when I 'fiddle' with some of the other parameters, and with the inputs. Currently I cannot get this to clear (and work). I've tried to change FramesPerSecond from 1 to 30 and back, increase/decrease LagTime, adding TrackLatestMeasurements=True, also adding TrackRecentValues=True... none of these solve the problem.

The inputs are average frequency, using the standard action adapter. The other value (slp) is from my own adapter which creates one average phase angle per second. Previously I just used the unmodified phase angle.
May 9, 2013 at 6:18 PM
actually, the 'slp' is currently and previously the average voltage phase angle slope
May 9, 2013 at 7:58 PM
Hi patpentz,

The dynamic calculator needs to concentrate its measurements so that it isn't running calculations on measurements with different timestamps. This error occurs when it receives a frame of measurements from its concentrator that does not have values for every measurement that it needs for the calculation. This can happen when the input device providing the measurements goes offline, for instance.

FYI, in response to this thread, I checked in a change to the DynamicCalculator that inputs a variable with the value of double.NaN for any variables which do not have corresponding measurement values in the frame. This should make the errors go away, but the calculated values will likely be double.NaN. This is included in the latest nightly build, version 1.5.231.

May 10, 2013 at 11:00 AM
Thanks a lot!!! You cannot imagine what it is like when several hundred Dynamic Calculations go south, and flood the console (and ErrorLog). This doesn't solve the underlying problem, but at least makes the environment more useful.

The input variables in this case does exist, but perhaps the timestamps are not always aligned as desired. One input is the average frequency, created by a GPA adapter. the other, the average voltage phase angle slope, is calculated by my adapter. I tried to ensure that the timestamp was on the same boundary as the average frequency, but perhaps not perfect. In any case, the input values are shown on the graph display, but the comparison shows 'NaN', due to the correction you supplied. As these are one-second averages, the DynamicCalculator has FramesPerSecond=1. I've played with various lagTimes, short, long, very long, without satisfaction. Are there any better ways to think about picking parameters for these adapters - perhaps longer leadTimes, or use of Trackxxx parameters, etc?
May 14, 2013 at 5:10 PM
a new wrinkle in DynamicCalculator - many of the functions available do not accept NaN, and generate errors. I understand that double.IsNan is not automatically available in DynamicCalculator, but some 'inport' can be used to provide this. Is this correct?
May 14, 2013 at 5:20 PM
I found my reference as to how to make double.IsNan to DynamicCalculator. Add as import:

AssemblyName={mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089}, TypeName=System.Math;AssemblyName={mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089}, TypeName=System.Double

I would recommend that this assembly be make always available, since NaN's will become more prevalent.