Skip to main content
15-Moonstone
December 24, 2018
Solved

Calculate M/C Running & M/C Idle Time using JS

  • December 24, 2018
  • 1 reply
  • 2031 views

I am using Proportional Chart to show Machine Running & Machine Idle time. It's working correctly  but when i am going to show it on value display it's shown wrong. Can anyone help me with any short script to differentiate time and show it on different value display like (Machine Running & Machine Idle).

Best answer by slangley

Hi @Swapnil_More.

 

Without a better understanding of your intent, it sounds like you could write a service to calculate these values.  We would recommend that if you are pulling these values from a connected device, that you calculate these values before pulling to the platform to conserve on resources.

 

If this does not help, please provide more information.

 

Regards.

 

--Sharon

1 reply

16-Pearl
December 27, 2018

The ValueDisplay can only show one Value at a time.

I suppose you have two individual values for Running and Idle times, right?

Then you would need 2 Value Displays to display the time...

 

or one ValueDisplay to show the percentage for running times, e.g.

 

runningPercent = (running / (running + idle)) * 100;

I hope this helps...

 

Cheers,

Michael

15-Moonstone
December 27, 2018

Yes, I have 2 value display.

I want solution for calculation of M/C Running & Idle condition

slangleyCommunity ManagerAnswer
Support
January 25, 2019

Hi @Swapnil_More.

 

Without a better understanding of your intent, it sounds like you could write a service to calculate these values.  We would recommend that if you are pulling these values from a connected device, that you calculate these values before pulling to the platform to conserve on resources.

 

If this does not help, please provide more information.

 

Regards.

 

--Sharon