I'm testing the Initial Settings Import -tool in SCADAConnect simulator. I have the metering results of tank level from every 15 minutes (Excel) and I have made a SCADA Signal connection to the data. I'm using time tolerance of 5 minutes.
I tried to test how the 5 min time tolerance works by trying to import tank level value from time 00:15:00. If I have understood time tolerance right, I should get that value imported with Import Options (historical) being something between 00:10:00 - 00:20:00. However, the import only succeeds with a time between 00:13:00 - 00:20:00 (2 min before and 5 min after). The same thing happens with other metering times (00:30:00, 00:45:00 etc.) too. Why does the time tolerance function differently before and after the selected import time?
EDIT: To correct some minor details and improve the wording in some areas.
The time tolerance setting in the new SCADAConnect Simulator (and it's associated tools such as initial conditions import, calibrator import etc) is currently working as follows.
If you specify a tolerance of 5 minutes, then for a requested time of 00:15:00, the time range 00:10:00 to 00:17:00 will be queried. This equates to -5 mins / +2 mins, or 5 minutes before and 2 minutes after.
It was set up this way so that the time tolerance is effectively looking into the past, by whatever amount is specified by the user. The 2 minute look ahead range is currently fixed and was set that way primarily to deal with reading real-time values (mainly to ensure that PC clock out of sync issues were handled), however, we during development we changed the way things work and real-time signals did not end up making any use of the time tolerance (which is why it is disabled if you specify your data source to be real-time), so perhaps it might be more appropriate for us to change that and use the same time tolerance specified by the user for looking ahead too, instead of the currently fixed 2 minutes. i.e., make it so that the time tolerance used is -X/+X (for a user specified tolerance of X).
It is probably worth me mentioning that if multiple values are found within the specified time tolerance, then SCADAConnect Simulator will show the value that is closest to the actual time as possible. If it does not find a value in the time range then it will show N/A for the value. So if the time range is larger than it needs to be then the value that comes back is not affected in any way (I will mention a little more about this later).
The current best practice with the time tolerance is to set it large enough to ensure that you will always get a value from your data-source, but no larger than that.
In the meantime I created a test, with the following source data:
The using a time tolerance of 1 minute (so in practice -1/+2) then when I run my test model with a time step of 1 minute and plot the SCADA data I see this table.
Notice the N/A values? These are where the time tolerance is not wide enough to find a value (some might not look quite right, like time 26, for example, but that is covered further down).
So for simulation time 2 minutes, our historical time range is:
Start = 2 - 1 = 1 min
Stop = 2 + 2 = 4 min
Query Range = 1 min --> 4 mins
Since the source data table contains no values between time 1 min and 4 mins, we get no value back. This is expected.
The way to get data back then is to change the time tolerance to at least 2 mins.
When I do that (change to 2 minutes, I get the following table):
Bit notice that there are still some N/As!
This is because for whatever reason sometimes the time stamps coming in from Excel are not precisely the time that is specified in the data source. For example, time 12:30:00 seems to come through (and is displayed in our SCADA Signals user interface) as 12:29.
I suspect that this is some kind of rounding error. Our user interface does not go to the precision of seconds or parts of seconds, but I strongly suspect that time to be 12:29:59 and possibly 12:29:59.999 etc. i.e., some value very close to 12:30:00, but not exactly on it. I assume some floating point rounding issue in the Excel data source provider, which is out of our control, but it is not a big deal; more of a cosmetic issue than anything else.
So now if I change my time tolerance to 121 seconds (for tolerances we do not consider increments less than 1 second), and assuming that the 12:29:59 thing above is correct, it should capture all the values properly. (I am using 121 seconds here to illustrate the point above, but in practice here I would probably just make the time tolerance 5 minutes to be sure I picked up all values).
Now everything is working as expected.
The points are shown on this graph, against the actual (test) tank trajectory. The last plotted point seems very much to correlate to the 12:30:00 time as expected.
So, the moral here is to make the tolerance as wide as it needs to be, maybe plus a little more (the order of minutes), but no wider than that. The risk of making the time tolerance too large is simply performance, since you will always get back values closest to the actual time, but SCADAConnect Simulator will have to search through more values (from a larger time range) before being able to find the best match.
Hopefully this helps explains how things are working and as mentioned above I will review the fixed 2 minutes into the future part of the time tolerance for the forthcoming SS6 release.
Answer Verified By: Ulla Koivisto