• phildunlap

    Hi Ian,

    I'd bet it has most to do with your scripting data source having permissions of 'superadmin' for everything, while the event handler script has no permissions.

    Otherwise....

    What version of Mango is this? The utilities should be available in any of the scripting contexts. Not all utilities are (such as the Excel Report post processing
    script utility) and not all variables are (such as "evt" and "event" being defined in event scripts. The fact that you would get a zero length instead of a message about invoking a method on an undefined object suggests the DataPointQuery utility is available to use and that it would be something else.

    Aside: it's sometimes a challenge that the logging behaviour is not the same between a data source and event scripting. Unless logging is turned on in a data source script, log statements will not be displayed when validating the script. However, they will be displayed when validating an event handler script. This is kinda understandable considering there is no explicit switch for logging in the handler (which would be nice to have).

    If you update to the 3.6 beta you'll see this is no longer the case with the new event handlers page.

    posted in User help read more
  • phildunlap

    Hi Richard,

    Jared's solution may be the correct one for the future.

    In the present, you can always do a general purpose technique like encoding that information into data points for use elsewhere. This thread sends an email for the last day's events, but it would show how to query the events from a script, currently. Then compose the JSON object you need to power your page and serialize it into an alphanumeric point.

    https://forum.infiniteautomation.com/topic/3147/email-last-day-s-events

    posted in Scripting general Discussion read more
  • phildunlap

    Hi Antonio,

    You can modify the configuration of a Mango instance on the fly from scripts using the JsonEmport script utility, which can allow you to work with JSON as you would via the Configuration Import/Export page.

    See this help page https://help.infiniteautomation.com/about-mango-java-script
    And here's an example from the forum changing theu pdate period of a data source: https://forum.infiniteautomation.com/topic/3288/alter-data-source-update-time-via-event-handler

    You could adapt that to use the virtual point's .value to update the host of the Modbus IP data source in question. Would that work for what you're asking?

    there's a way to know the MANGO path inside a script?

    You mean the directory that it is installed to? Yes,

    var pathToMango = com.serotonin.m2m2.Common.MA_HOME_PATH; //java.nio.file.Path, get a string via .toString()
    

    posted in Scripting general Discussion read more
  • phildunlap

    Hi Frank, welcome to the forum!

    I suspect Jared's implementation of the heat map in this thread would be a good place to start: https://forum.infiniteautomation.com/topic/4166/heat-map

    You may find also useful information in this thread about using the userModule to define components or filters that can manipulate it into the form the charts accept: https://forum.infiniteautomation.com/topic/3503/how-to-chart-with-data-points-in-the-x-axis-instead-of-time/5 but there is not a scatter plot component currently, so you'd have to make them independent series to use the serial chart and have only dots.

    posted in User help read more
  • phildunlap

    I also pinged the PLC IP address from the PC and it responds.

    Are you able to netcat or telnet to the port that you're expecting to connect to? There could be some sort of firewalling involved.

    Unfortunately I do not have access to the source code for the AB modules, so I can't look into the exact meaning of that message. If it's not the firewall I'll try to get someone who does have access to that code to have a look at this.

    posted in Mango Automation general Discussion read more
  • phildunlap

    Hi Antonio,

    Have you restarted Mango since copying it to Mango/overrides/properties? If not, the issue may involve the group ownership of 'root' for that file.

    posted in Mango Automation general Discussion read more
  • phildunlap

    Hi Antonio,

    Have you added the public key for the id_rsa to the authorized_keys for the user, i.e.

    cat id_rsa.pub >> /home/user/.ssh/authorized_keys

    posted in Mango Automation general Discussion read more
  • phildunlap

    Thanks for sharing what you found.

    It's possible in the latest Mango and BACnet4J to have multiple local devices bind the 0.0.0.0 address for port 47808 and then have unique device IDs (and BBMDs to make it make sense).

    Let us know what you come up with for using particular addresses!

    posted in BACnet4J general discussion read more
  • phildunlap

    You can find the button on the data point details page, next to the current value.

    There is also the /rest/v1/runtime-manager/force-refresh/{xid} REST endpoint (which is what that button is calling).

    Then there is the RuntimeManager context object in scripts, which also has a function to trigger a refresh of a data point (or even a data source) if supported, like so:

    RuntimeManager.refreshDataPoint("DP_XID"); //.refreshDataSource("DS_XID")
    

    posted in User help read more
  • phildunlap

    You can also use another search engine if you prefer. You can add the term site://forum.infiniteautomation.com while googling, for instance.

    posted in Dashboard Designer & Custom AngularJS Pages read more