Author Topic: Hour Meter or function timer  (Read 8201 times)

Offline SJ Industries

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +2/-0
Hour Meter or function timer
« on: January 02, 2020, 08:47:48 AM »
Can someone advise on the best way to set up an hour meter that logs the length of time a function has been used. I need to set a 12month reminder to have a component sent for calibration which I can run of the RTC but I am unsure how to save the last Cal and reset the 12month period. Also would like to record the length of time 2 functions are used. No need for huge accuracy levels.

I am wary of the NV mem use as I don't fully understand it and don't want to brick a display.

I am setting it all to be set and reset within the display program as my end users will never have access to Service tool.

Thank you.

Offline Mike

  • PLUS+1 Developer
  • ***
  • Posts: 43
  • Karma: +2/-0
Re: Hour Meter or function timer
« Reply #1 on: January 02, 2020, 10:08:46 PM »
you will need to use memory to save the time since otherwise you will lose count if you lose power. Make sure you use a positive transition before the write trigger to prevent it writing multiple times when the signal is true.

Other than that it is a trade-off of precision in your timer and life expectancy of the machine. In the datasheet you can find the number of cycles the memory is rated for. Typically it's good for a couple million cycles.

On something that long term I would set an oscillator to pulse every couple minutes and add to the value in memory on every pulse.

Offline acmall

  • PLUS+1 Guru
  • *****
  • Posts: 201
  • Karma: +37/-1
Re: Hour Meter or function timer
« Reply #2 on: January 06, 2020, 09:23:20 AM »
In the OS inputs there is are two signals CK1S set for one processing loop every second and CK60S that is set for one processing loop every minute. If you do not need accuracy you could use CK60S to trigger a count of minutes.

Don't worry about using NVMem. As Mike has said just be sure not to leave the write signal true, which would mean the write would happen every processing loop. Also if you are using one of the newer displays they use FRAM for the NVMem and are rated for 100 trillion cycles.






Offline SJ Industries

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +2/-0
Re: Hour Meter or function timer
« Reply #3 on: January 06, 2020, 11:38:06 AM »
Hi thanks guys, it is the DM430E. I have seen the memory info for the MCs somewhere but could not find a definitive answer on the memory for this display other than it has 32mb. Im not sure how the memory write and re-write thing work completely with how to best figure it out. I cant see any specs which mention FRAM?

Offline acmall

  • PLUS+1 Guru
  • *****
  • Posts: 201
  • Karma: +37/-1
Re: Hour Meter or function timer
« Reply #4 on: January 06, 2020, 01:33:02 PM »
The DM410E does not appear to have the CK1S & CK60S signals that some of the other screens do so you will need an oscillator as Mike suggested.

The attached block is a very quick (and basic) example of one way that you could use the NVMem components to do this. You may want to add a bit more logic and error checking but this will hopefully get you started.

If you are using the date you will also need to consider what will happen if the RTC is not set to the correct Date/Time or what happens if someone changes the date time.

Offline SJ Industries

  • PLUS+1 Expert
  • ****
  • Posts: 60
  • Karma: +2/-0
Re: Hour Meter or function timer
« Reply #5 on: January 06, 2020, 09:17:57 PM »
Thank you acmall. That will help me get started.

Offline jashom1

  • PLUS+1 Expert
  • ****
  • Posts: 80
  • Karma: +6/-0
Re: Hour Meter or function timer
« Reply #6 on: January 15, 2020, 10:28:18 PM »
If it helps at all, there is a hour counter function in the Inverter FB library

Cheers,

John.