• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Jorge Gonzalez
    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
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 23
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by Jorge Gonzalez

    • J

      Script to convert from Hex to Dec

      How-To
      • • • Jorge Gonzalez
      4
      0
      Votes
      4
      Posts
      1.3k
      Views

      ThomasEinastoT

      @jorge-gonzalez said in Script to convert from Hex to Dec:

      13:32

      @Jorge-Gonzalez, documentation to solve your problems.

      Firstly see what parseInt does - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

      There you can see that the hexdecimal value has to be in correct format be it with 0x or without. Your string splits 2 bytes in the hexdecimal format by using a colon. You need to remove it. Simply do it by utilizing .replace method on a string before putting it into parseInt. Or if you have a string which contains multiple values utilize .split method on a string and then put the bytes together before putting the value into parseInt.

      Replace method explanation
      https://www.w3schools.com/jsref/jsref_replace.asp

      Split method explanation
      https://www.w3schools.com/jsref/jsref_split.asp

      Following function is following the detailed explanation you provided in the post.

      function stringsplitter (string) { var result = {}; // This contains the bytes of data result.arrayofbytes = string.split(':'); // Get byte count of data inside the string result.bytecount = result.arrayofbytes.length; // Start at the beginning var variablecounter = 0; result.hexdata = []; result.decimaldata = []; // Loop over the array, but taking into account that we have 2 byte data, use try/catch so that function will return if something should fail try{ for (var x = 0;x < result.bytecount / 2;x++){ result.hexdata[x] = result.arrayofbytes[variablecounter] + result.arrayofbytes[variablecounter+1]; result.decimaldata[x] = parseInt(result.hexdata[x],16); variablecounter += 2; } }catch(err){ return err } // return object with all our data which includes hexdecimal data, decimaldata and byte count inside the string return result; } // Example usage var devicestring = '13:30:27:14:01:33:02:6c:02:76'; var data = stringsplitter(devicestring); //get array in hexdecimal and decimal format var hexdata = data.hexdata; var decimaldata = data.decimaldata; // first value in hexdecimal and decimal format var firstvaluehex = hexdata[0]; var firstvaluedecimal = decimaldata[0]; // Second value in hexdecimal and decimal format var secondvaluehex = hexdata[1]; var secondvaluedecimal = decimaldata[1]; // Following that your post had used an example with the last value var lastvalue = decimaldata[4]; // Should be 23 var lastvaluecorrected = lastvalue * 0.1 - 40;

      Thomas

    • J

      Send a password every Five min

      How-To
      • • • Jorge Gonzalez
      6
      0
      Votes
      6
      Posts
      1.7k
      Views

      phildunlapP

      In the last image you posted, the points' variable names are p385 and p386 but in the script body they're being referred to as passwordPointp385 and passwordPointp386, so that is why you got the reference error. As Craig said you'll want to use the actual hexidecimal password (or if it's just a number remove the 0x before the number for decimal) instead of 0xdeadbeef, which is just one of the many things which can be spelled in hexidecimal.

      if the customer change the current password, how we will get the new hex value?
      I will appreciate so much your support

      You will be told the value they changed it to, I would expect, then you could change it. If you want to, you could store the password in a point and then send the value of the point. Then when the password changes you just set a new value to the point.

    • J

      How to Add a Html link in Graphic Views

      How-To
      • • • Jorge Gonzalez
      4
      0
      Votes
      4
      Posts
      1.7k
      Views

      phildunlapP

      Yes, it is possible to have a hyperlink via the HTML component, by using the HTML to create the link as I did in my last post. It is also possible to embed another page into an HTML component via an iframe.

    • J

      How to divide or multiply a SNMP Value

      How-To
      • • • Jorge Gonzalez
      13
      0
      Votes
      13
      Posts
      2.8k
      Views

      J

      Thanks so much, with Your script, now it is working... it is the most important thing, because the customer is testing this Scada platform.

      Soon We will start checking what happen with this controller and them kind of SNMP Data.
      Again, thanks for Your support

    • J

      Create a new numeric Datapoints from alphanumeric datapoint

      How-To
      • • • Jorge Gonzalez
      7
      0
      Votes
      7
      Posts
      1.5k
      Views

      J

      Thanks so much, You are right, we check it and it work. Thank You
      The other script... will be for the oficial integration.
      till now we are showing to the customer that the platform can work with their controller

    • J

      "SNMP Host Testing"

      How-To
      • • • Jorge Gonzalez
      9
      0
      Votes
      9
      Posts
      2.1k
      Views

      phildunlapP

      Hi Jorge,

      You are right with alphanumeric type i got the values... now i need to check why with another type as octetct string didnt work.

      Octet String would only be a set type (for writing data out), and that point. The MIB you posted said it's read-only, so I'm not sure any set type would be able to set a value to it.

      I would have expected Numeric to work as a data type for the OID you posted in the original image, too.