• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. malcolmbco

    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
    M
    • Profile
    • Following 1
    • Followers 0
    • Topics 2
    • Posts 6
    • Best 0
    • Controversial 0
    • Groups 0

    malcolmbco

    @malcolmbco

    0
    Reputation
    336
    Profile views
    6
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    malcolmbco Unfollow Follow

    Latest posts made by malcolmbco

    • RE: Time sync to a Modbus device

      Yes, UTF-16BE worked great. I have time updates going to two different devices every hour.

      Thanks!
      Malcolm

      posted in Scripting general Discussion
      M
      malcolmbco
    • RE: Time sync to a Modbus device

      You were correct, update context was set. I cleared it and the cron interval now works fine. I did change the data type to UTF16 and can read the rtc data back just fine. However, writing still seems to have an issue. The first word sent is always 0xFEFF and the rest of the data sent is truncated by one word. I checked this by sniffing the data stream on the modbus. Any ideas?
      Malcolm

      posted in Scripting general Discussion
      M
      malcolmbco
    • RE: Problem with reading 8 byte unsigned modbus data

      If I simply read the registers from the device, I get back what I expect. If I split the read into two 4 byte unsigned reads, then the data is correct in each part. I actually wrote the device code and am sure it works as intended.
      One more question: Is it possible to access the actual array of bytes read from the device if the point data is set to a fixed length string?
      This would really simplify my script processing of special data types.

      Thanks!

      Malcolm

      posted in Mango Automation general Discussion
      M
      malcolmbco
    • Problem with reading 8 byte unsigned modbus data

      I am reading an 8 byte modbus parameters and it seems to be returning the least significant byte as a zero. Has anyone else had this issue?

      posted in Mango Automation general Discussion
      M
      malcolmbco
    • RE: Time sync to a Modbus device

      Philip,

      Thanks for the response.

      The registers are mapped as year, month, day of month, day of week, hours, minutes, seconds with the binary value in the lsb of each register. I made the data type a fixed length string so I could use String.fromCharCode to set them by position.

      I assigned a MetaDataSource with the cron set to once an hour to trigger the script. The script is as follows (the data point for the time is p18). I tested this on a windows platform and noticed that the cron setup does not seem to affect the execution, the script was being executed continuously until I made it only do the set on the hour turn over using an if statement. Is there an issue with cron on this platform?

      // set time in room controller
      
      var currentTime = new Date();
      
      var year = currentTime.getFullYear();
      var month = currentTime.getMonth() + 1;
      var dayOfMonth = currentTime.getDate();
      var dayOfWeek = currentTime.getDay();
      var hours = currentTime.getHours();
      var minutes = currentTime.getMinutes();
      var seconds = currentTime.getSeconds();
      
      if ((seconds === 0) && (minutes === 0))
      {
          var res = String.fromCharCode(0,year-2000,0,month,0,dayOfMonth,0,dayOfWeek,0,hours,0,minutes,0,seconds);
      
          p18.set(res);  
      }
      

      Thanks again!

      Malcolm

      posted in Scripting general Discussion
      M
      malcolmbco
    • Time sync to a Modbus device

      I have a set of Modbus devices that I would like to send time syncs to. They accept the sync as a single type 16 Modbus message to a set of 7 registers. Can I use a Meta, Scripting or Virtual data source triggered every hour to do this? I have looked at the examples and there does not seem to be one that covers sending data to multiple registers in one stream. Any advice would be helpful here!

      posted in Scripting general Discussion
      M
      malcolmbco