• Recent
    • Tags
    • Popular
    • Register
    • Login

    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

    JsonEmport not working for me

    How-To
    2
    4
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phillip Weeks
      last edited by

      I used this code before our last update to 3.6... now this returns an eof error.

      print(JsonEmport.dataPointQuery("eq(name,FAN COIL VALVE)&limit(1000)"));```
      
      Expected } but found eof //JsonEmport.doImport(JSON.stringify({"dataPoints": dataPoints})); ^ at line: 8, column: 90 at line: 8, column: 9
      
      1 Reply Last reply Reply Quote 0
      • terrypackerT
        terrypacker
        last edited by

        @Phillip-Weeks
        That bug is fixed in 3.7.x I was not aware it was in the 3.6 release. I am planning another 3.6 release in the next few weeks so I'll get that fix in there. In the meantime you cannot end a script with a comment line. So adding a newline after that I think should work.

        1 Reply Last reply Reply Quote 1
        • P
          Phillip Weeks
          last edited by

          Thanks no that was not in the script I added that after. This produces the same result. It is 3.6 and I will upgrade to 3.7 shortly if it fixes this. Thanks for your reply,

          var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,FAN COIL VALVE)&limit(1000)")).dataPoints;
          print(JsonEmport.dataPointQuery("eq(name,FAN COIL VALVE)&limit(1000)"));
          
          1 Reply Last reply Reply Quote 0
          • terrypackerT
            terrypacker
            last edited by

            @Phillip-Weeks I just implemented a Scripting Data source that runs this script and see no errors on Mango 3.6.6?

            var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,Voltage)&limit(1000)")).dataPoints;
            print(JsonEmport.dataPointQuery("eq(name,Voltage)&limit(1000)"));
            

            I am searching for a point named Voltage

            Output:

            
            "dataPoints":[
            {
            "xid":"voltage",
            "name":"Voltage",
            "enabled":true,
            "loggingType":"ON_CHANGE",
            "intervalLoggingPeriodType":"MINUTES",
            "intervalLoggingType":"INSTANT",
            "purgeType":"YEARS",
            "pointLocator":{
            "dataType":"NUMERIC",
            "changeType":{
            "type":"BROWNIAN",
            "max":100.0,
            "maxChange":0.01,
            "min":0.0,
            "startValue":"1"
            },
            "settable":true
            },
            "eventDetectors":null,
            "plotType":"STEP",
            "rollup":"NONE",
            "unit":"V",
            "simplifyType":"NONE",
            "chartColour":"",
            "chartRenderer":null,
            "dataSourceXid":"DS_997094",
            "defaultCacheSize":1,
            "deviceName":"Dashboard Demo",
            "discardExtremeValues":false,
            "discardHighLimit":0.0,
            "discardLowLimit":0.0,
            "intervalLoggingPeriod":15,
            "intervalLoggingSampleWindowSize":0,
            "overrideIntervalLoggingSamples":false,
            "preventSetExtremeValues":false,
            "purgeOverride":false,
            "purgePeriod":1,
            "readPermission":"user",
            "setExtremeHighLimit":1.7976931348623157E308,
            "setExtremeLowLimit":-1.7976931348623157E308,
            "setPermission":"",
            "tags":null,
            "textRenderer":{
            "type":"ANALOG",
            "useUnitAsSuffix":true,
            "format":"#.00"
            },
            "tolerance":0.0
            }
            ]
            }
            

            The cause must be specific to your system. Perhaps that specific point is corrupt? Try another point and if that doesn't work take a look at the logs and see if anything is being output about the error.

            Thanks.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post