point set timestamp
A question about I use point.set function, want to change point value in the timestamp,
why not work?
@Sean it looks like you are testing this by 'validating' the script. During validation the value is not actually set into the database but instead just printed to the result to show that if the script was really run it would have been set. So that is why when you try to get the values in the next part of the script it returns the real values from the database and your values that were set are not present. This can be kind of confusing but is done so that you can test the script and not have to worry about modifying the values in the system.
Hope that helps.
@terrypacker I have already executed in the formal meta-data-point environment, but the values of those two points are still incorrect and have not been correctly modified to the specified values I entered. How do I do to change that two point values in timestamp?
@Sean It looks to me like the point you are setting has a 5 minute logging period. So I would check the logging settings for your point. If it is set to Interval logging it won't log every value you send in to it. Since you are querying the values from the database it will only return values that are logged:
1684906212836 -> Wednesday, May 24, 2023 5:30:12.836 AM GMT 1684906512836 -> Wednesday, May 24, 2023 5:35:12.836 AM GMT 1684906812836 -> Wednesday, May 24, 2023 5:40:12.836 AM GMT 1684907112836 -> Wednesday, May 24, 2023 5:45:12.836 AM GMT
If you want access to cached values (i.e. values not yet in the database but being used for interval logging) you would want to do this:
var from = 1684906200000; var to = 1684907500000; var useCache = true; point.pointValuesBetween(from, to, useCache);
Please can you explain what your goal is? Are you trying to change historic values?
Also provide the mango version
@CraigWeb mango version is 3.7.12
this datapoint is temperature sensor point so, recorde is normaly 2x °C
so 4376.54 and 459.62 is incorrect, so I want to reset value or delete this 2 values in timestamp
[PointValueTime(22.6@2023/05/24 13:30:12.836), PointValueTime(4376.54@2023/05/24 13:35:12.836), PointValueTime(459.62@2023/05/24 13:40:12.836), PointValueTime(22.8@2023/05/24 13:45:12.836), PointValueTime(22.886666666666667@2023/05/24 13:50:12.836)]
time = 1684906212836 , point= PointValueTime(22.6@2023/05/24 13:30:12.836)
time = 1684906512836 , point= PointValueTime(4376.54@2023/05/24 13:35:12.836)
time = 1684906812836 , point= PointValueTime(459.62@2023/05/24 13:40:12.836)
time = 1684907112836 , point= PointValueTime(22.8@2023/05/24 13:45:12.836)
time = 1684907412836 , point= PointValueTime(22.886666666666667@2023/05/24 13:50:12.836)