Problem with Meta point
-
Try replacing true and false with 0 and 1 instead, it is a binary point afterall. Also.. What logging type is the point set to?
-
I had to change Mango machines on this site, so ended up doing an "export" then "import".
I think for some reason the Meta point did not like one of the points having a binary point rendered as "ON and OFF", which was imported from the old machine.
Once I changed this back to true/false, it worked OK. I then changed it back to ON/OFF and still works.
Seriously spent a couple of hours on this.
I did also try the 0/1 as well in the script, didn't work.
The script always validated.
Did my head in, but working now.
-
Most bizarre indeed. Sometimes I find myself better off copying and pasting scripts...
Glad to hear you managed to wrangle it though man.Fox
-
Hi hayden_AUS, Fox,
None of the theories presented sounds correct to me.
Try replacing true and false with 0 and 1 instead, it is a binary point afterall. Also.. What logging type is the point set to?
true and false are fully legitimate values to return from a meta point for a binary point. The logging type isn't taken into consideration in that script output message.
I think for some reason the Meta point did not like one of the points having a binary point rendered as "ON and OFF", which was imported from the old machine.
Once I changed this back to true/false, it worked OK. I then changed it back to ON/OFF and still works.Rendered values are not available directly in scripting environments. I opened a git issue about that a while ago, and have posted examples on the forum of how to use DataPointVO objects to render the values.
Judging by the script output message, it looks like there was a global script or some such running
return "Success, no new value";
being executed prior to the meta point, which maybe was changed between restarting the point. That output message is the new value message (from Meta/classes/i18n.properties:dsEdit.meta.test.successTs=Success. result={0}, timestamp={1}
), but the value is that string (and so it says success twice), so it seems to have come from somewhere other than this script.Edit: As to the event message, the only way I would expect to reproduce that would be returning an alphanumeric point value time with the value of "false", as if through something like
return alphanumericPoint.lastValue();
-
Hi guys,
I am still having issues with this.
Issue1: Returns "error could not convert to Binary".
Issue2: Meta point will not go false after Advanced scheduler activation.I have checked all data points in the script, and made sure they are all binary.
When I have the Meta point set to "Change":
Manually setting a solenoid to TRUE, sets the Meta point to TRUE
Manually setting the solenoid to FALSE, sets the Meta point to FALSE
Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid sets the Meta TRUE
Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid does NOT set the Meta FALSEWhen I have the Meta Point set to "Update":
Manually setting a solenoid to TRUE, sets the Meta point to TRUE
Manually setting the solenoid to FALSE, sets the Meta point to FALSE
Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid sets the Meta TRUE
Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid DOES set the Meta FALSE
However returns an error when going TRUE:
'Meta': Script result type error in point "Meta - Pump control": Could not convert result "PointValueTime(true@2019/09/05 11:00:37.543)" to BinaryI have also changed my script with relation to the else statement so that if ALL are false:
if (p84.value === true || p45.value === true || p48.value === true || p50.value === true || p51.value === true || p52.value === true || p53.value === true || p54.value === true){ return true; } else if (p84.value === false && p45.value === false && p48.value === false && p50.value === false && p51.value === false && p52.value === false && p53.value === false && p54.value === false){ return false; }
Also just got another error appear:
'Meta': Script result type error in point "Meta - Pump control": Could not convert result "PointValueTime(false@2019/09/05 11:26:13.583)" to BinaryThere were no context point changes.
Only happens when I have the Meta point set to Update.
-
Why not use the script setting for the event when it fires from your advanced scheduler?
You could tie all of your context points in there and link it all that way.
Just a suggestion here. -
Hi Fox/Phil.
I tried a scripted data point first, but ran into the same issues.
I have no other global scripts running now, no scripted data sources. There are no alphanumeric data points in the instance.
I'll try creating the same issue on another instance.
In relation to scripting, in event handler, where you set external context points, is the key variable name what would be used if creating a scripted data point?
-
Just tested on my ES using virtual points and works fine;
The Meta point switches off after the advanced scheduler goes inactive.
The Meta point is set to "change"There must be issues with the free instance I am using...
Any ideas how to fix, or do I have to re-build the instance?
-
I separated the Pump control meta point (shown way at the top of thread) into two meta points,
one for solenoids and one for other switching.Set both to "Update"
Both working fine without errors.
????? Sheech, what an ordeal.
-
Okay, I took a deeper look, and it appears the validation of binary meta points and other scripts with expected result types has an issue with returning false, as the message reports as though it
return UNCHANGED;
. This does not affect the actual runtime of the points or other such scripts. So, that explains the output on the validation in the first post. https://github.com/infiniteautomation/ma-core-public/issues/1487Thanks for bringing this to our attention!
I have not been able to reproduce the event message except by returning a value with something like the lastValue function, although it could be a binary point doing that as well. In your first script there is an else if so it would be possible not to return a value, although I would expect it to get a false (binary) / 0 (numeric and meta) / empty string (alphanumeric) value if nothing is returned.