KenMandile Posted November 13, 2013 Share Posted November 13, 2013 I am monitoring the status of our CNC machine tools. A zero means the machine is running and a 1 means that it is not running. I want to calculate the average run time for the past hour, so I need to sum my readings. I know that if my total of the 1200 data points is zero (reads once every 3 seconds) then the machine ran 100% of the time. Is there a function for summing the values in the channel history? Link to comment Share on other sites More sharing options...
AzeoTech Posted November 13, 2013 Share Posted November 13, 2013 Sure: sum(myChannel) though in your case its the "anti-sum" so to speak. You want: sum(myChannel == 0) Or if you want just the last hour: sum(myChannel[systime(), systime()-3600] == 0) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.