• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. iperry
    3. Topics

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website
    I
    • Profile
    • Following 0
    • Followers 0
    • Topics 39
    • Posts 95
    • Best 2
    • Controversial 0
    • Groups 0

    Topics created by iperry

    • I

      Data point query limited to 100 points returned

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      631
      Views

      MattFoxM

      I believe since 3.6 the default was changed from 200 to 100. This has always been the case.
      I always write a full rql string to ensure nothing is amiss. I think you've found a typo.

      Fox

    • I

      How to disable fonts from being loaded

      User help
      • • • iperry
      1
      0
      Votes
      1
      Posts
      481
      Views

      No one has replied

    • I

      Creating model for use in Freemarker

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      1.1k
      Views

      MattFoxM

      I can probably help here. I use it to construct my data reports into an email.
      Javascript:

      var model = {"crit": crit, "urgent": urgent, "warn":warn}; //print(JSON.stringify(model)); var template = com.serotonin.m2m2.Common.freemarkerConfiguration.getTemplate("datapoint_email.ftl"); var writer = new java.io.StringWriter(); template.process(model, writer); var emailContent = new com.serotonin.web.mail.EmailContent(null, writer.toString(), com.serotonin.m2m2.Common.UTF8); var recipients = ["fox@domain.com"]; com.serotonin.m2m2.rt.maint.work.EmailWorkItem.queueEmail(recipients, "Datapoint Summary", emailContent, null);

      Template

      <#assign key_list = crit?keys/> <!-- get keys --> <#list key_list as c> <!-- c is your array index --> <!-- markup fluff here --> <#list crit[c] as k,x> <!-- this point here would be your tmpRecs object --> <#assign row = row + 1/> <#if row == 2><#assign row = 0/></#if> <tr class="critrow<#if row == 1>Alt</#if>"> <td colspan="4">${x["id"]} </td> <td colspan="4"><span style="font-weight:bold">${x["deviceName"]}</span><span> : ${x["pointName"]}</span></td> <td colspan="4">${x["time"]} </td> <td colspan="4">${x["value"]} </td> </tr> <#else> <tr><td colspan="12">No Critical Items</td></tr> </#list>

      Would be good to see how you've laid out your model because that's what affects how the loop has to parse the data.

      Fox

    • I

      Email retries setting

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      665
      Views

      CraigWebC

      @iperry you have not missed anything, 1 attempt is made, there is no setting for the number of attempts.

    • I

      Changing the name of a data point using a script

      User help
      • • • iperry
      4
      0
      Votes
      4
      Posts
      871
      Views

      MattFoxM

      Nicely done man!
      At least you know why now. Glad I could be a sounding board!

      Fox

    • I

      Consumption of JVM memory leads to disconnect of MQTT data source

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      687
      Views

      TurboT

      Heya:

      I ran into similar issues with memory usage-- Notably, whenever one of our users ran one of their Big Excel Reports, the Available Memory would go to Zero, and the wheels would come off of Mango. We set our JAVAOPTS to be 10G, and those problems seem to go away.

      Mango uses Monster Amounts of Memory under certain conditions-- I'd say that you 1600Meg is too small. I've got site machines running with 2 gigs of RAM, and we use the JAVAOPTS small for that. Those sites only use the Modbus datasource, a handful of metapoints, and the persistent publisher. Even that seems to use all the available memory at times, and once Java takes RAM it never give sit back..

      Right now, our main machine is set up with 16 gigs of RAM, with only 174 megs free. The rest of that is JAVA, which is using 14.785 GB of RAM according to TOP.

      This peaks whenever a report is ran, but then Java never gives RAM back to the OS after it's taken. Right now, our JVM free memory is about 5 gigs, but that will go to < 2 gigs if one of these big reports gets ran.

      Cheers,
      -Greg

    • I

      Triggering a counter data point to enable and restart

      User help
      • • • iperry
      3
      0
      Votes
      3
      Posts
      857
      Views

      MattFoxM

      Use an event handler and trigger it which runs a script which increments, enables/disables values using a the supplied scripting context points when it has fired. Use the Set Point value type handler.

    • I

      Creating a chart with dynamic number of series

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      513
      Views

      MattFoxM

      I did something similar, the easiest way I did it was hard coding three graph series and wrapping it with an ng-if="seriesCount==1" or 2 or 4 in the html template file.
      You know for a fact you're working with only up to three series, so it shouldn't be overkill.
      Store all necessary settings in your JSON then go forth. I think you're making it more complex than required.

      Alternatively,
      Map everything into controller variables then link them into the chart instance:

      <ma-serial-chart points="$ctrl.points" values="$ctrl.values" legend="true" export="true" graph-options="$ctrl.graphOptions" options="$ctrl.serialChartOptions"> </ma-serial-chart> <ma-point-values points="$ctrl.points" values="$ctrl.values" from="$ctrl.dateBar.from" to="$ctrl.dateBar.to" rollup="{{$ctrl.rollupType}}" rollup-interval="{{$ctrl.rollupInterval}} {{$ctrl.rollupIntervalPeriod}}" ></ma-point-values>

      Fox

    • I

      Moving global script functions to a server file

      User help
      • • • iperry
      6
      0
      Votes
      6
      Posts
      1.3k
      Views

      I

      Hi @terrypacker

      Thanks for pointing me towards the audit trial. I hadn't realized what elements were tracked here.

      However, the audit trail doesn't offer any comparison tools, version tagging, etc that source control app would, like Github. This was my intention for saving the global scripts to an external file.

      Thanks
      Ian

    • I

      Adding condition checks to ma-set-point-value

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      737
      Views

      MattFoxM

      Hi Ian,

      My first suggestion for 1) involves using a number input with the desired mins and maxes, then a ma-button/md-button to use the point.setValue( numberFieldVal)

      <md-input-container> <input type="number" minimum="0" maximum="5" ng-model="angleToSet"/> <md-button ng-click="anglePoint.setValue( angleToSet ) " class="md-primary md-raised">Set Angle Value</md-button> </md-input-container>

      Do you have any suggestions if I wanted to add custom condition checks to the ma-set-point-value object? Would I have to create my own component so I could add the condition checks?

      That would be best. As you know, the components in the UI all use the REST API, so use that to enable you to write your own checks etc.
      In fact if you're trying to do the same above, you may as well look at the github and see Jared's approach and work from there. You could then likely set different "setValue" calls so when setting a point value, you can run different checking algorithms and set alerts using an alert or $mdToast or the like.

      Fox

    • I

      Migrating a custom page to a component

      User help
      • • • iperry
      4
      0
      Votes
      4
      Posts
      872
      Views

      MattFoxM

      My pleasure, glad to see you were able to figure it out!

    • I

      Interfacing Mango with Digi RM

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      781
      Views

      phildunlapP

      Hi Ian,

      You maybe could do it with an HTTP JSON retriever or receiver - you link does not explain the protocol you're trying to interface with. If you have an authentication token you can probably do it with the retriever, and if you can configure it to push messages to your Mango at the /httpds URL
      you may be able to use the receiver.

      Given that it brings a login screen, you may be better off using a scripting data source with the HttpBuilder doing the HTTP, as you can do more arbitrary things, such as logging into the service. This thread has an HttpBuilder integration with an API: https://forum.infiniteautomation.com/topic/2999/intesis-integration/2

      You may also need to use something like var response = JSON.parse(content); in the response function.

      Documentation here: https://help.infiniteautomation.com/about-mango-java-script

    • I

      Displaying the latest history timestamp for a data point

      User help
      • • • iperry
      4
      0
      Votes
      4
      Posts
      798
      Views

      phildunlapP

      My notion of the hacky solution looked more like,

      <ma-get-point-value ng-init="latestTimeToggle=false; page={};" point-xid="brown" point="myPoint" on-value-updated="latestTimeToggle=!latestTimeToggle;"></ma-get-point-value> <ma-point-values ng-if="!latestTimeToggle" point="myPoint" values="page.point1Values" latest="1" realtime="false" use-cache="false"></ma-point-values> <ma-point-values ng-if="latestTimeToggle" point="myPoint" values="page.point1Values" latest="1" realtime="false" use-cache="false"></ma-point-values> <p> The point name is "{{myPoint.name}}" and its value is {{myPoint.renderedValue}} at {{myPoint.time}} </p> {{page.point1Values}}

      But probably the best solution, since you're already writing components / directives, would be to interact with the point value websocket to subscribe to the LOGGED event type, and then you could handle any messages of that type to update your component.

      See the /ui/docs/ng-mango-services/ma-point-event-manager page for how to use the point event manager service to subscribe to the event type in your component. You can see an example of its use in the ma-get-point-value directive, https://github.com/infiniteautomation/ma-dashboards/blob/main/UI/web-src/ngMango/directives/getPointValue.js#L76

    • I

      Mango stuck on startup

      User help
      • • • iperry
      10
      0
      Votes
      10
      Posts
      1.9k
      Views

      I

      Excellent... thanks! That looks to have worked. :)

    • I

      Inconsistent values between MQTT and meta points

      User help
      • • • iperry
      11
      0
      Votes
      11
      Posts
      1.9k
      Views

      phildunlapP

      As you are likely the maintainer of the system, you should do what makes sense to you.

      Global scripts are simply stitched into scripts to provide functions or global variables or what have you. Refactoring what gets passed where and how in a script is an implementation decision that I don't see a clear advisement on. It certainly can simplify things if lots of scripts would be doing the same thing to make that a uniform function.

      The only thing I can think to add to that is that currently script engines which are in something's runtime do not suddenly execute a global scripts when it is saved to pick up the changes. You would have to restart any meta data sources or scripting sources, for instance.

    • I

      Resources available in (email) event handler scripts

      User help
      • • • iperry
      3
      0
      Votes
      3
      Posts
      1.0k
      Views

      I

      Hi Phil,

      Ahhh thanks! I figured it most have been something I missed.

      Setting "Script data point read permission" to "superadmin" worked!

      The /facepalm for me was that I was sure I had it working correctly before. I had created a script to create the handlers as they were going to be applied to a large number of data points (and event detectors). Likely I had missed this value in the script which has lead to some frustration. Whopps.

      This is the current version of Mango (3.5x).

      I haven't upgraded to the beta version yet as I usually shy away from these versions. ;) I also am trying to keep my version consistent with a few trials we have in progress until I can upgrade them all.

      Thanks again,
      Ian

    • I

      Unable to add meta point as context to itself

      User help
      • • • iperry
      4
      0
      Votes
      4
      Posts
      1.1k
      Views

      phildunlapP

      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")
    • I

      Clarify use of variable name on meta data points

      User help
      • • • iperry
      5
      0
      Votes
      5
      Posts
      993
      Views

      phildunlapP

      Hi iperry,

      In the end the point data wasn't going to help me as I was hoping to get its hierarchical info. Guess I will need to query for that data.

      You mean the point hierarchy information? You could get this through the DataPointWrapper easily.

      var dpPath = p.getDataPointWrapper().getPath();

      You can also get the point folder id or the data type id from the DataPointVO,

      var folderId = CONTEXT_POINTS.p.getVO().getPointFolderId(); var dataTypeId = CONTEXT_POINTS.p.getVO().getPointLocator().getDataTypeId();

      (The intention was if the setpoint associated to the alarm was set to -1, get the setpoint of the group it's in instead)

      As far as grouping, I would use tags instead of the point hierarchy.

      use an RQL query consisting of each of your points, I believe this may give you the nuts and bones data about storage and pointLocator types etc... This may be what you need to leverage that info...

      This would certainly work if one is more comfortable using the JSON than going through the DataPointQuery object to get a list of DataPointWrapper objects (so if they're enabled, their .getRuntime() method returns what a normal context point is). So,

      var queriedPoints = DataPointQuery.query(rql); //also has byXid method //Let's just assume there's at least one for this example, and it's enabled, print( queriedPoints[0].getRuntime() ); // should be the same as print(p) if p is a context point
    • I

      Displaying a chart with no data

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      979
      Views

      Jared WiltshireJ

      https://forum.infiniteautomation.com/topic/3936/retrieving-historical-values/2
      https://forum.infiniteautomation.com/topic/4024/filter-for-point-values/7

      When 3.6 is released there will be a bookend="false" option on <ma-point-values>

    • I

      Property template on persistent TCP data point

      User help
      • • • iperry
      2
      0
      Votes
      2
      Posts
      871
      Views

      phildunlapP

      Hi Ian,

      The lack of the template id element would lead me to believe that the property template is not required.

      Correct.

      The data history will be the same as the point to which it is linked; the logging type of "All Data" will ensure this.

      It's not that simple. If the publisher is sending realtime values with update / change as its update event, the data source is saving real time values, but the point on the publisher is logging on an interval then the updates within an interval would have been published and saved, while on the publisher side only the interval logging would be recorded longer term.

      So the settings that go into it are:

      Publisher update event. All publishers have this setting, and it determines when you send a value from a point (or update the publishers' data image in the case of the Modbus or BACnet publisher). The logging type of the data point being sent. For a data point logging all data, for instance, the 'update' and 'logged' events are synonymous. If the publisher transmits real time data. If not, then only historical syncs will bring about data on the receiver. If the data source saves real time data. If not, then the points will appear to update in time, but their histories will only be filled in once a history sync is run.