• H
    HSAcontrols

    So what I'm trying to achieve is to have one Ethernet port connected to a HMI which will poll data from a publisher, and the other port be used for communicating with another device.

    I was intending to allocate a different IP address to each of the ports such that I did not require additional ports on a switch ,

    At the moment as described above, I have set different addresses for enp1s0, and ensp2s0. I have only been able to ping them from connecting to ethernet port 1. The device does not respond to pings on port 2.

    posted in Development general discussion read more
  • H
    HSAcontrols

    Hi,

    The HTS hardware has dual Ethernet ports, and within the system settings, there are two configurable network addresses.

    When I configure both as unique Static IP address i.e. enp1s0 is 192.168.0.100 and enp2s0 is 192.168.0.101 both are only accessible through one of the Ethernet ports.

    Is my assumption wrong that you can address the ports separately, or is there more to it?

    Thanks.

    posted in Development general discussion read more
  • H
    HSAcontrols

    Thanks guys, appreciate the help. Managed to get it all working, the error handling was definitely a good call.

    posted in Scripting general Discussion read more
  • H
    HSAcontrols

    Recently I successfully implemented the basic statistical calculations (min/max/average) by creating a Meta data source, scripting the data-point and then publishing via Modbus.

    I have had some difficulty putting together a script for calculating the standard deviation. The system returns a black question mark diamond icon as a data point place holder, and continues to fill the historical values table unlike when there is a bad/no data source. I am not sure whether the error icon is indicative of NaN, out of range, etc (new to mango).

    I tested the script incrementally and only towards the end of the calculation does this error occur, maybe a problem with the division & square root being to small?

    If anyone could provide clarification on this error icon, or point me towards the right documentation section that would be very helpful!

    Thanks!

    Script is below:

    var average     = p6167.past(MINUTE, 5).average; //Get Average 
    var valueArray  = p6167.last(300);              //Get Last 300 Points(5 min)		
    var Power_StdDev = 0;                           //reset std devation
    			
        for (var i=0; i<300; i++){                  //loop through points 
            var value_i = valueArray.get(i).value;	//get array(i) value     
            var DiffSquared = (value_i - average)^2;    //take the diff & square
            var sumDiffSquared = DiffSquared + sumDiffSquared;       //sum of squares 
            var sumDiffSQuotient = sumDiffSquared/299;                    // divide by n-1
            Power_StdDev = Math.sqrt(sumDiffSQuotient);                  // set std to calculated value
        }
    return Power_StdDev;                   // return to numeric meta data point
    

    posted in Scripting general Discussion read more