• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Jokke
    3. Posts

    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
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 53
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Custom dynamic bar and dial gauge

      Hi,

      answers: yes something and I think so.

      I have not tried but taken a look how it works.

      Please take a look on the help. It says:

      "The Dynamic graphic component is similar to the analog image renderer in that it can visualize a numeric point, but instead of choosing one out of a set of images it dynamically draws the indicator of the value. For example, the pointer can be drawn on a single dial image. To add a new dynamic renderer, add a new subdirectory to the graphics directory and put the static image and an appropriate info file there. Then, add a rendering function to the resources/view.js file. The function must be named according to the name given to the subdirectory. See the Dial graphic as an example. "

      In the view.js there is the code for the dynamic parts. It looks quite straight forward but requires some coding skills. If you can update rest of us after trying...

      BR
      -Jokke

      posted in How-To
      J
      Jokke
    • Problem with meta point

      Hello,

      I created a metapoint for checking from multiple bits if any is on.

      Like this

      
      var value=false;
      
      if (p271.value==true ||
          p272.value==true ||
          p273.value==true ||
          p274.value==true ||
          p275.value==true ||
          p279.value==true ||
          p280.value==true )
         value=true;
      
      return value;
      
      

      The update event is context update.

      For some reason the update is never run. The datasource for the bits is Modbus TCP with 30s update interval.

      Please tell is there some trick needed.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Problem with meta point

      Hello,

      I created a metapoint for checking from multiple bits if any is on.

      Like this

      
      var value=false;
      
      if (p271.value==true ||
          p272.value==true ||
          p273.value==true ||
          p274.value==true ||
          p275.value==true ||
          p279.value==true ||
          p280.value==true )
         value=true;
      
      return value;
      
      

      The update event is context update.

      For some reason the update is never run. The datasource for the bits is Modbus TCP with 30s update interval.

      Please tell is there some trick needed.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Multi-state (Image/state assignments problem)

      :)

      You took an other cup of coffee while responding. :) Luckily the answers were not same but different aspect on same.

      btw bit offtopic. It has been a while since doing any bit filtering. Happen to know is there any way to represent binary values on JS? (like hex is 0x prefix) atleast 0b is not working. With quick internet search I did not find anything.

      BR
      -Jokke

      posted in How-To
      J
      Jokke
    • RE: Multi-state (Image/state assignments problem)

      if you create the meta data source there is the symbol with (?).

      Help tells the script is JavaScript / ECMAScript so basicly the same as every where else on mango.

      you could add something like this to the meta point script to mask the bits 2, 3 and 4 out.

      return (p100.value & 0xFFE3);

      replace p100 with the script context var appropriate on your case.

      if you data value is alphanumeric then it maybe a different solution. (and if you want to be able to set the value then there might be needed some point link)

      BR
      -Jokke

      posted in How-To
      J
      Jokke
    • RE: Multi-state (Image/state assignments problem)

      The metapoints use other points as inputs. In your case you could use metapoint to take the value an modify it(filter the bits out). Then you could use the metapoint on the view.

      You need to add meta datasource and the metapoints into it.

      BR
      -Jokke

      posted in How-To
      J
      Jokke
    • RE: Point hierachy

      I had couple of hundred points sorted and it was not too bad. I used the method to work from bottom to up. I dont know how many is your big scale. It might make sense to use import/export in some case, which I tried with few points.

      One small hint. Try clicking several points with ctrl and/or shift key pressed down so you can select and move multiple at once. How it works is not too obvious. I have noticed it shows only one point as selected but still will move several.(tried with IE, firefox and chromium)

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Popup keypad

      It did not work as easily. The HTML component is different than serverside script from browser point of view. The serverside script has the mouseover events for the mango popups, even if the "show controls" is unchecked. I think these are overiding the keyboard.js event listeners or they are not loaded at all.

      One thing to check could be to put the onchange function to the HTML component, with proper numbers instead point.id and pointComponent.id . it would work if the point exists on the view.(maybe as a hidden serverside script). This is bit tricky as it would not show the current value and it is not too comfortable to define multiple points.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Popup keypad

      Hi,

      you can use ' instead of " as browsers are accepting it. But in scritps it cannot be swapped. :)

      I put the keyboard .css, .js and png files into tomcat root. This seems kind of working(the keyboard is not bound into the component):

      
      var s="";
      
      s+= "<script type='text/javascript' ";
      s+= "src='keyboard.js' charset='UTF-8'>";
      s+= "</script> <link rel='stylesheet' type='text/css' href='keyboard.css'> ";
      
      s+="<input type='text' size=3  value='"+value+"' ";
      s+="onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.value )'  class='keyboardInput' vki_attached='true'>";
      
      return s;
      
      

      the "vki_attached='true'" is one experiment you can remove.

      I did not get it working yet in "imageless"(without need to click on the icon). It can be changed simply by setting inside keyboard.js the this.VKI_imageURI = "keyboard.png"; to this.VKI_imageURI = "";

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Popup keypad

      Hi,

      Here is code for a serverside script component.

      
      var s="";
      
      s+="<input type='text' size=3 value='"+value+"' ";
      s+="onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.value )'>";
      
      return s;
      
      
      

      Have you got it working with HTML component on view or have you made an own page with the above code?

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Popup keypad

      Hi,

      Sounds quite intresting, I would like to do similar. Could you link some example and I could take a look some time.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Sending data from Mango to Arduino board (Modbus)

      Hi,

      The sending to mango you refer is reading in mango datasorce. By checking "Settable" in a point details in modbus datasource it can then be written(send data from mango). So you need to define a point for the led.

      Not knowing what is the criteria to turn the led on, you could use point link or event handler.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Finnish translation/Mango puhuu suomea

      Maybe promotion to Padawan 1st class :D

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Finnish translation/Mango puhuu suomea

      Hello Matthew,

      Here is the "final" translation. Now the missing translations are limited on help files and some datasources. Typos corrected and minor changes on the used translations.

      There was some minor findings nothing major

      • This was seen "Modbus pointo locator test: "Illegal data address: {1}""
      • This was not localized so it is same on all language settings. "SomeCompoundEventDetectorName: java.lang.Exception: Detector S3 not enabled or does not exist"
      • On audit events the publisher deletion/change does not make any event.(like all other user actions) I am not needing it, but just noticed while testing.
      • The common.true and common.false is used on logical true/false and in the audit events. It has a slight difference on translation if the context talking about something is on/off or binary/logical value true/false.
      • This was a tricky one to translate properly making correct sentence. (because of the missing words in finnish :) ) But I think I got it worked around. "User "admin (1)" deleted Data point with id 307:
        Export ID (XID)="DP_713928"
        Name="yeaa"
        Enabled="True"
        Logging type="When point value changes"
        Interval logging period="15 minutes(s)"
        Value type="Instant"
        Tolerance="0.0"
        Purge="1 year(s)""

      Attachment: download link

      posted in User help
      J
      Jokke
    • RE: Here are some view component examples

      Here are more select examples as they seem popular.

      The simple example which was on the other topic

      
      //Simple Select example
      var s="";
      
      s+="<select  onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.options[this.selectedIndex].value )'>";
       
      s+= "<option value=1";
      if (value == 1 ) { s+= " selected ";}
      s+= "> one </option>";
      
      s+= "<option value=2";
      if (value == 2 ) { s+= " selected ";}
      s+= "> two </option>";
      
      s+= "<option value=3";
      if (value == 3 ) { s+= " selected ";}
      s+= "> three </option>";
      
      s+= "<option value=4";
      if (value == 4 ) { s+= " selected ";}
      s+= "> four </option>";
      
      s+="</select>";
      
      return s;
      
      

      A generic script for multistate point(uses the text and colour defined in multistate point renderer properties)

      
      //Multi State Select example
      
      //list of states (value key and the text)
      var MSList=point.getTextRenderer().getMultistateValues();
      var min = 0;
      var max = MSList.size();
      var s="";
      var s2=""; //temporary inside loop, to be able to set the color
      
      //check if list has values
      if(max==0){return "No States defined";}
      //sanity limit
      if(max>100){return "More than 100 states";}
      
      s+="<select  ";
       
      for(var i = min; i < max ;i++)
      {
         s2+= "<option ";
         //use the state colours 
         s2+= "style='color:"+ MSList.get(i).getColour() + "' ";
         s2+="value="+ MSList.get(i).getKey() ;
      
         if (value == MSList.get(i).getKey()) 
        { 
            s2+= " selected ";
            //set the select color according to the value
            s+= "style='color:"+ MSList.get(i).getColour() + "' ";   
      }
         s2+= "> "+MSList.get(i).getText()+"</option>";
      }
      s+="onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.options[this.selectedIndex].value )'>";
      
      // put the options into the string
      s+=s2;
      
      s+="</select>";
      
      return s;
      
      
      

      One which is quite easy to modify to some specific need

      
      //Select example with values defined in arrays
      //list of the values shown
      var choices=new Array("Pint","US gal","UK gal");
      //the values for the choices
      var values=new Array(0.568,3.785,4.546);
      var min = 0;
      var max = choices.length;
      var s="";
      
      //check if list has values
      if(max==0){return "No selections defined";}
      //check the array sizes match
      if(choices.length!=values.length){return "Array sizes not equal";}
      
      s+="<select  onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.options[this.selectedIndex].value )'>";
       
      for (var i = min; i < max ;i++)
      {
         s+= "<option value="+ values*;
      
         if (value == values* ) { s+= " selected ";}
         s+= "> "+ choices* +"</option>";
      }
      s+="</select>";
      
      return s;
      
      
      

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Drop down box

      Hello,

      It needs to have the "selected" in the option to be sync. The basic structure is this.

      
      <select onChange='somefunction()'>
      <option value=1 > one </option>
      <option value=2 selected > two </option>
      <option value=3 > three </option>
      </select>
      
      

      I used the loop to to write the selected into correct option (and not to write tens of times the same code)

      Here is an example without any loops.

      
      //Simple Select example
      var s="";
      
      s+="<select  onChange='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", this.options[this.selectedIndex].value )'>";
       
      s+= "<option value=1";
      if (value == 1 ) { s+= " selected ";}
      s+= "> one </option>";
      
      s+= "<option value=2";
      if (value == 2 ) { s+= " selected ";}
      s+= "> two </option>";
      
      s+= "<option value=3";
      if (value == 3 ) { s+= " selected ";}
      s+= "> three </option>";
      
      s+= "<option value=4";
      if (value == 4 ) { s+= " selected ";}
      s+= "> four </option>";
      
      s+="</select>";
      
      return s;
      
      
      

      I will put some more select examples from my views into the other topic.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Using "Contiguous batches only" causes exceptions

      Hello,

      I checked the sources and for me it looks the register limit of 125 is defined in the code. I am not sure it could be over written somehow but maybe mlohbihler can tell this.

      (edit)
      You can use the "holes in registermap" to work around this. If every 33th (adresses 32, 65, 97...) register is not configured to be read then the query is limited to 32 registers.

      I have not tried, but maybe an other workaround could be to configure 2 datasources. One handling registers 0 to 31 and from 64 to 95 and so on... then the second datasource hanling 32 to 63 and 96 to 127 and so on... Idea is to split the register to chunks of 32 and divide between 2 datasources.

      (/edit)
      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Modbus tcp errors?

      Hi Neil,

      I have seen similar errors on my system, when the PLC replies with nonsense. The HW of mine has a limitation on how many registers can be queried on one call. Error what i have seen is "Exception from modbus master: Unsupported IP protocol id: 1"

      The topic about it is here http://mango.serotoninsoftware.com/forum/posts/list/549.page

      If this happens all the time and not just randomly, you could take a capture of the messages with wireshark. It would help on checking what are the message content.

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Serverside script and var "events"

      hmmm,

      Yes the information helps to understand.

      I tried "events.get(0).message.getLocalizedMessage()"

      and result was "Can't find method com.serotonin.web.i18n.LocalizableMessage.getLocalizedMessage()."

      The name I refer is the defined alias for the point event detector. It is printed on event list as message.

      I am not sure if trying to find it on correct object at all. Ill continue diving...

      BR
      -Jokke

      posted in User help
      J
      Jokke
    • RE: Here are some view component examples

      Yes I first tried with onChange and for some reason I didnt get it working. It was some time ago with earlier mango version.

      However now I made a new try and it works. I updated the above post to have a better version of the code.

      BR
      -Jokke

      posted in User help
      J
      Jokke