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.

  • Time Intervals

    2
    0 Votes
    2 Posts
    874 Views
    phildunlapP
    Hi gquiroz, It is not currently simple to do. The way to do it now would involve something like manually starting the data source on the quantized period, which a script on a cron pattern may be able to achieve. If it were guaranteed they would not subsequently be stopped and started (like being saved), then a script on an event handler on the system startup event could use the RuntimeManager script object to start appropriate data sources at appropriate times and sleep in between. But, it does take time to start data sources so the alignment would be imperfect. I would tend to encourage someone who wanted such a value to record all sampled data in the sampling point, and use a meta point on a cron to compute the intervals you want with something like p.past(MINUTE, 15).average, then set the purge period of the sampled point lower if you're worried about the data's size on disk. One advantage is being able to see later on if a 15 minute period that seems anomalous had a reduced number of samples in it, and not having to wait up to 14:59 for the data source to start sampling at the right time. Edit: The question got reraised, so here's a snippet of what such a cron powered scripting data source could look like. //untested if(typeof hasRestartedDataSourcesAtRightTime === 'undefined') { var dataSourcesToQuantize = ["DS_XID"]; for(var j = 0; j < dataSourcesToQuantize.length; j+=1) { RuntimeManager.stopDataSource(dataSourcesToQuantize[j]); RuntimeManager.startDataSource(dataSourcesToQuantize[j]); } var hasRestartedDataSourcesAtRightTime = true; } But, because Mango's API, UI, reporting tools, etc offer rollups, having the data aligned in the period is probably not critical. My colleague said it well in the email chain: If the actual goal is to view/retrieve data at even time intervals, you can change the rollup periods when looking at charts/downloading CSV data on the watch lists. I suspect that this, coupled with configuring the data points to poll and log more frequently, would likely be the more "correct" version of the intended goal, since the average/min/max values of those time periods (00:00, 00:15, 00:30) would use all the logged point values within them, giving a more accurate representation of the actual values instead of a snapshot every 15m. If instead the goal is only to have the last timestamp be a round number in the watch lists, you'll have to use Phil's scripting data source solution or wait for cron patterns to be added to all data sources.
  • Trouble Connecting To Modbus IP

    3
    0 Votes
    3 Posts
    1k Views
    J
    Hey Joel! Yup, that was it. I was trying to read the wrong register. Thank you!
  • Re-creating Slave Points

    4
    0 Votes
    4 Posts
    1k Views
    CraigWebC
    strange I tested it before I posted is your data source modbusIP or modbus serial ? Make sure you have a binary bit data point on that data source with the slave ID that you want to be monitored.
  • Publisher issue after upgrading ES to 3.5.6

    3
    0 Votes
    3 Posts
    873 Views
    P
    Thank-you Phil, I forgot I had asked about this so I posted again then remembered this post and deleted it. That worked perfect.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Process Event handler to fire external script

    56
    0 Votes
    56 Posts
    35k Views
    MattFoxM
    Why poll? use a datapoint that is amended via the PLC. Make it reflect the state of the PLC and use that to control your script status. It should be able to trigger the other way, not with you polling it. If needs be contact me via chat and we can discuss in detail.
  • Processing files

    4
    0 Votes
    4 Posts
    1k Views
    phildunlapP
    I don't suppose he's using Linux / Mac, and/or Windows 10 with the bash command? If so, I'd almost certainly do it with some sed commands in a bash script. If not, I agree with Jared that a frontend solution may be good. You could build your colleague a simple sanitize.html page with two textbox elements, and upon change in the input invoke a function to transform it to the output, function transformInputCSV() { var input = document.getElementById("inputTextbox").value; var output = input.replace(/your regex here/, "You're replacement text"); // ouput = output.replace(.....) document.getElementById("outputTextbox").value = output; } Here's the HTML for such a page, which he could open in a browser, <html> <head> <script> function transformInputCSV() { var input = document.getElementById("inputTextbox").value; var output = input.replace(/your regex here/, "Your replacement text"); // output = output.replace(.....) document.getElementById("outputTextbox").value = output; } </script> </head> <body> <div><textarea id="inputTextbox" onchange="transformInputCSV()"></textarea></div> <div><textarea id="outputTextbox" ></textarea></div> </body> </html> But it would be possible to tie Mango into things if there is a reason to. Have you checked out the API endpoints for the data file data source? One permits you to submit files for immediate processing, and there's no reason an importer could not simply place the post-processed file in the filestore for a user this user has access to.
  • Adding a BACnet router as a foreign device

    2
    0 Votes
    2 Posts
    1k Views
    phildunlapP
    Hi gquiroz, I know this thread is from 3.2, but I think it may still work okay in 2.8.8: https://forum.infiniteautomation.com/topic/3099/bacnet4j-3-2-and-bbmd-foreign-device-support You could probably also send the WhoIS to just that device by changing the broadcast address to that device's address in your Local device settings on the system settings page. That wouldn't quite be the same as sending a foreign device registration explicitly, though.
  • Mango Service Not Running (Switching from H2 DB to MySQL)

    7
    0 Votes
    7 Posts
    2k Views
    J
    Hi phildunlap, apparently MYSQL v8 came with a security update that prevents many third party applications from accessing the server. Authentication plugin 'caching_sha2_password' cannot be loaded I could not find a fix for this, other than just downgrading to an older version. I will create a new post regarding the BACnet question: https://forum.infiniteautomation.com/topic/4042/adding-a-bacnet-router-as-a-foreign-device
  • Time Gap in data points

    3
    0 Votes
    3 Posts
    1k Views
    S
    @phildunlap Hi Phildunlop, I haven't set any rollup. Rollup is none
  • Change XID dynamically

    3
    0 Votes
    3 Posts
    1k Views
    Jared WiltshireJ
    Here's another way of doing it that will only fetch the values for the selected point. The buttons also highlight to show which point is selected. <!-- set the initial data point XID for when the page loads --> <div ng-init="dataPointXid = 'temperature'"></div> <ma-get-point-value point-xid="{{dataPointXid}}" point="selectedPoint"></ma-get-point-value> <md-button ng-click="dataPointXid = 'temperature'" ng-class="{'md-raised': dataPointXid === 'temperature'}">Data point 1</md-button> <md-button ng-click="dataPointXid = 'voltage'" ng-class="{'md-raised': dataPointXid === 'voltage'}">Data point 2</md-button> <ma-point-values point="selectedPoint" values="pointValues" from="dateBar.from" to="dateBar.to" rollup="{{dateBar.rollupType}}" rollup-interval="{{dateBar.rollupIntervals}} {{dateBar.rollupIntervalPeriod}}"> </ma-point-values> <ma-serial-chart style="height: 300px; width: 100%" series-1-values="pointValues" series-1-point="selectedPoint"> </ma-serial-chart> [image: nzrsW5O.png]
  • Changing the Excel report name

    5
    0 Votes
    5 Posts
    2k Views
    phildunlapP
    Ah okay, so it's a daily report I would guess. You would have to do this in a script and have an SQL point that updates table only in the context var basePath = "/path/to/Mango"; var reportsDirectory = new java.io.File(basePath + "/web/modules/excelReports/web/report-data"); var reports = reportsDirectory.listFiles(); for(var k = 0; k < reports.length; k+=1) { var filenameInfo = /(.*?__20\d\d)[^.]+(\.xlsx?)/.exec(reports[k].getName()); if(filenameInfo !== null) { var newFilename = filenameInfo[1] + filenameInfo[2]; sqlPoint.set("(" + newFilename +","+ reports[k].getName()+")"); var newFile = new java.io.File(basePath + "/web/modules/excelReports/web/report-data/" + newFilename); java.nio.file.Files.move(reports[k].toPath(), newFile.toPath()); } } Here's the JSON for my scripting data source and my SQL data source. { "dataSources":[ { "xid":"DS_de7b7e71-f677-4020-ae30-3880c0c7402d", "name":"Rename Reports", "enabled":false, "type":"SCRIPTING", "alarmLevels":{ "SCRIPT_ERROR":"URGENT", "DATA_TYPE_ERROR":"URGENT", "POLL_ABORTED":"URGENT", "LOG_ERROR":"URGENT" }, "purgeType":"YEARS", "updateEvent":"CONTEXT_UPDATE", "context":[ { "varName":"sqlPoint", "dataPointXid":"DP_f527c6d3-9b10-44aa-b72c-9c21aaf6b605", "updateContext":false } ], "logLevel":"NONE", "cronPattern":"0 5 0\/1 * * ?", "executionDelaySeconds":0, "historicalSetting":false, "logCount":5, "logSize":1.0, "script":"var basePath = \"\/path\/to\/Mango\";\nvar reportsDirectory = new java.io.File(basePath + \"\/web\/modules\/excelReports\/web\/report-data\");\nvar reports = reportsDirectory.listFiles();\nfor(var k = 0; k < reports.length; k+=1) {\n var filenameInfo = \/(.*?__20\\d\\d)[^.]+(\\.xlsx?)\/.exec(reports[k].getName());\n if(filenameInfo !== null) {\n var newFilename = filenameInfo[1] + filenameInfo[2];\n sqlPoint.set(\"(\" + newFilename +\",\"+ reports[k].getName()+\")\");\n var newFile = new java.io.File(basePath + \"\/web\/modules\/excelReports\/web\/report-data\/\" + newFilename);\n java.nio.file.Files.move(reports[k].toPath(), newFile.toPath());\n }\n}", "scriptPermissions":{ "customPermissions":"", "dataPointReadPermissions":"superadmin", "dataPointSetPermissions":"superadmin", "dataSourcePermissions":"superadmin" }, "editPermission":"", "purgeOverride":false, "purgePeriod":1 }, { "xid":"DS_9fdb6029-cf67-4ed4-8372-1d6e7f304cc5", "name":"UpdateReportNames", "enabled":true, "type":"SQL", "alarmLevels":{ "POLL_ABORTED":"URGENT", "STATEMENT_EXCEPTION":"URGENT", "DATA_SOURCE_EXCEPTION":"URGENT" }, "purgeType":"YEARS", "updatePeriodType":"HOURS", "connectionUrl":"jdbc:h2:C:\\IA\\Mangoes\\enterprise-m2m2-core-3.5.0-2\\databases\\mah2", "driverClassname":"org.h2.Driver", "password":"", "rowBasedQuery":true, "selectStatement":"select '' from systemSettings", "updatePeriods":5, "username":"", "editPermission":"", "purgeOverride":false, "purgePeriod":1 } ], "dataPoints":[ { "xid":"DP_f527c6d3-9b10-44aa-b72c-9c21aaf6b605", "name":"UpdateReportName", "enabled":true, "loggingType":"ON_CHANGE", "intervalLoggingPeriodType":"MINUTES", "intervalLoggingType":"INSTANT", "purgeType":"YEARS", "pointLocator":{ "dataType":"ALPHANUMERIC", "parameters":[ "STRING", "STRING" ], "dateParameterFormat":"yyyy-MM-dd'T'HH:mm:ss", "fieldName":"", "tableModifier":true, "timeOverrideName":"", "updateStatement":"update excelReports set filename='?' where filename='?'" }, "eventDetectors":[ ], "plotType":"STEP", "rollup":"NONE", "unit":"", "templateXid":"Alphanumeric_Default", "simplifyType":"NONE", "chartColour":"", "chartRenderer":{ "type":"TABLE", "limit":10 }, "dataSourceXid":"DS_9fdb6029-cf67-4ed4-8372-1d6e7f304cc5", "defaultCacheSize":1, "deviceName":"UpdateReportNames", "discardExtremeValues":false, "discardHighLimit":1.7976931348623157E308, "discardLowLimit":-1.7976931348623157E308, "intervalLoggingPeriod":15, "intervalLoggingSampleWindowSize":0, "overrideIntervalLoggingSamples":false, "preventSetExtremeValues":false, "purgeOverride":false, "purgePeriod":1, "readPermission":"", "setExtremeHighLimit":1.7976931348623157E308, "setExtremeLowLimit":-1.7976931348623157E308, "setPermission":"", "tags":{ }, "textRenderer":{ "type":"PLAIN", "useUnitAsSuffix":true, "unit":"", "renderedUnit":"", "suffix":"" }, "tolerance":0.0 } ] } I have it running at the fifth minute of each hour, assuming the report is probably generated on some hour. You could work the cron to happen after the report is run.
  • Calculating values on the fly

    15
    0 Votes
    15 Posts
    4k Views
    Jared WiltshireJ
    @psysak said in Calculating values on the fly: Is the {xid: 'cost'} an implied search term for xid which contains "cost"? No. This is object literal syntax - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Object_literals By using points="[power, price, {name: 'Cost', xid: 'cost', deviceName: 'Cost'}]" I am creating an array containing the two points stored in the scope as power and price, and creating a third object in the array with its xid property set to the string cost.
  • Chrome on a MacBook

    15
    0 Votes
    15 Posts
    4k Views
    Jared WiltshireJ
    @psysak said in Chrome on a MacBook: I just had this issue pop up in page editor as well. However, I've also realized that everything works perfectly fine in FireFox so if I have any issues I just open that up. If it is happening on the dashboard designer I would also expect it to affect the page editor too. They use the exact same ace editor component. Chrome should work 100% perfectly, the fact that you are still experiencing issues with this indicates there is something amiss with your installation. Please contact me via private message / chat and I'll get you to screen share and we can get to the bottom of it. You also commented that you were experiencing this issue which was patched long ago.
  • Dynamic Excel reports?

    8
    1 Votes
    8 Posts
    2k Views
    MattFoxM
    @psysak said in Dynamic Excel reports?: The thing with the excel report is formatting, as trivial as it may sound I don't want my clients just downloading raw csv files. I need our logo, proper formatting with bolding, some equations to run etc. Ah, why didn't you say so sooner. Seeing as you dont need them to 'access' a raw file per se. why not just generate a pdf file to encapsulate it instead?? Do you anticipate that they will need to use the data for their own graphing/charting in excel?? If not, this is also a viable solution. Works everywhere, can generate the layout and whatnot that you need in html and make it open in a new page for them to download or just download outright. There are numerous javascript libraries available. Doing it this way will also enable you to append chart images on the page as well rather than just numbers using amcharts's export api. Let me know your thoughts. EDIT: I have come across this library if you would still rather use excel. Whether or not it will do what you want I'm not certain. https://github.com/SheetJS/js-xlsx however at first glance I'm not seeing anything resembling image support....
  • Limiting date ranges

    3
    0 Votes
    3 Posts
    1k Views
    Jared WiltshireJ
    You could also just stick something on your page to reset the date range if they try - <ma-calc input="dateBar.from" on-change="startOfMonth = ('now' | maMoment:'startOf':'month'); $value > startOfMonth && (dateBar.from = startOfMonth.toDate())"></ma-calc> <ma-calc input="dateBar.to" on-change="startOfMonth = ('now' | maMoment:'startOf':'month'); $value > startOfMonth && (dateBar.to = startOfMonth.toDate())"></ma-calc>
  • Is it a problem having a big H2 database?

    12
    0 Votes
    12 Posts
    2k Views
    A
    Ohh yes, this is where I got confused! I haven't seen that options on the Alarm level combo. All clarified now! I found in the forum that I can export data from any table to another external DB, so I can keep the events shorter in H2. I will make an effort to keep the structure with H2 DB because the management through Mango seems simplier. Thanks a lot for all the info.
  • Error: Server Timeout

    16
    0 Votes
    16 Posts
    4k Views
    phildunlapP
    I forgot to inquire if you have set memory settings for this machine? Perhaps you can try allocating ~70% of the memory explicitly to Java via moving an appropriate memory script from Mango/bin/ext-available into Mango/bin/ext-enabled, modifying it to your system's resources, and stopping, then starting (not restarting) Mango to have it come into effect.
  • Excel report causing H2 error code 50100

    6
    0 Votes
    6 Posts
    2k Views
    phildunlapP
    I would unzip the backup and check the SQL file inside for DATA4. That's what I did in the other thread when he sent in his backup and I didn't find any references. I restored it and didn't encounter the issue. I would advise that you restore the backup into a clean database to check it out (move Mango/databases when Mango is off so that it will start on a new database) and perhaps keep a JSON configuration export and output of SELECT id, xid FROM dataPoints; on hand, in case you need to restore via JSON rather than the database backup.
  • Excel Reports Sent at Wrong Time

    excel reports time cron mangoes
    9
    0 Votes
    9 Posts
    3k Views
    MattFoxM
    This will be a handy post for those who are running cloud hosted solutions as there isn't a mangoES settings section for custom installs.