News:

  • April 30, 2026, 04:06:14 PM

Login with username, password and session length

Author Topic: display up counter on HMI  (Read 20404 times)

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
display up counter on HMI
« on: November 09, 2018, 06:50:46 AM »
How can I display my up counter, or any counter, on the HMI. Example I see 19m 2.34s for the T0.ACC. I tried copy but that did not work. Move will not work either. I was trying to move it as a string but that is not going to work. Or is there another way to display a counter in minutes and seconds on the HMI. In DS I used division and POP to do it. I would take the total count and divide it out for minutes and seconds using POP. Do-More has to have a nicer way of doing this.  Would I use symbolic by creating DEV002 as my port? If so, what would be the tag name or element?

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: display up counter on HMI
« Reply #1 on: November 09, 2018, 09:23:42 AM »
Why will a string not work?  That is the simplest way to do it unless your HMI just doesn't support strings at all.

There are quite a few posts on how to do this, both here and on ADC's forum.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: display up counter on HMI
« Reply #2 on: November 09, 2018, 10:47:19 AM »
Which HMI?  C-more should have a Do-more Timer object already to reference T0 (not T0.Acc, it should know to look at the .Done bit vs. the .Acc based on the object type)

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #3 on: November 09, 2018, 01:00:04 PM »
I guess I am not asking the right question. How do I display a counter accumulative value in minutes and seconds on the HMI. I can get T8.acc but it is just a single double word integer. Was hoping for a simpler way then in DS.

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: display up counter on HMI
« Reply #4 on: November 09, 2018, 01:00:56 PM »
What is the HMI?

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #5 on: November 09, 2018, 01:42:02 PM »
EA9-10 inch

pbw

  • Hero Member
  • *****
  • Posts: 127
Re: display up counter on HMI
« Reply #6 on: November 09, 2018, 02:23:09 PM »
Is this what your looking for?
Under Help contents search for Scripting Language for more information and formats.
« Last Edit: November 09, 2018, 02:24:42 PM by pbw »

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: display up counter on HMI
« Reply #7 on: November 09, 2018, 02:41:18 PM »
Or are you looking for something more like this?

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #8 on: November 09, 2018, 05:34:34 PM »
Nice I will try both. Actually going to do this with a counter.
The counter is an up down counter represents cooling up and cooling down time. counting with the ST4, 1sec bit. Take the seconds and display then on the HMI as minutes and seconds. Counter counts up to 20 mins and turns on a bit, when cooling down it cools down to zero seconds, a bit is on.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #9 on: November 10, 2018, 05:29:18 AM »
Can you do that with a counter? I am getting frustrated reading the help file and there is no counter example. It does mention if doing a counter you have to pay attention to .acc, .done, etc. I am trying to but can not get the formatting correct to get the green light. There is no up down timer. Is that possible to add?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: display up counter on HMI
« Reply #10 on: November 10, 2018, 07:30:25 AM »
There is no up/down timer, but creating a down timer is very simple math...just subtract the .Acc from the total time in milliseconds. MATH D0 = 1200000-T0.Acc will time down for 20 minutes.

As for being frustrated with the counter, what are you struggling to do exactly?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #11 on: November 10, 2018, 09:05:53 AM »
I was trying to format the counter like in the timer example.

FMTCNT(CT0.acc,sec)
FMtCnt((CT0,sec)
Tried variations, but not getting anywhere

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #12 on: November 10, 2018, 09:10:54 AM »
The whole idea in this project is to allow the oven to heat up for 20mins before it is ready to go. This time would be displayed on the HMI.  Then if the operator turns off the oven, it will show how long it has been cooling down, showing that time on the HMI. So basically an up down time display. The range is 0 to 20mins. Both ways.

I have done this before in DS5 using division and the POP command.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: display up counter on HMI
« Reply #13 on: November 10, 2018, 10:07:13 AM »
This code is using the same timer for up and down. C11 is selecting up timer or down timer.

"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: display up counter on HMI
« Reply #14 on: November 10, 2018, 10:21:31 AM »
Thank you. I will try this out later.
Would you consider making this or something similar in an i_box?  ;D Or am I the only one doing an up down timer?