Sign in to follow this  
Followers 0
marcinmrag

Total Power On Time in auto mode

8 posts in this topic

Hello Experts!

I would like have total time of working machine in auto cycle. It is any function in sysmac studio that can do it? How I can handle this ?

Share this post


Link to post
Share on other sites

I think I found the way to do it.

auto.JPG.eb2e928e4766497af1e5caaeec107f1

But How to display it right in HMI. I have something like: 1d.22:21:32. I would like to display this in better way like :  1 day 22h 21 min 32 s

 

Share this post


Link to post
Share on other sites

You can use the DTToDateStruct function to break each part of the DT variable out into integers and then display the ones that you want on the HMI individually.

Share this post


Link to post
Share on other sites

THX. I have to play a little bit with this to create some good function but seems to be works.

Edited by marcinmrag

Share this post


Link to post
Share on other sites

I found out something streng. When the timer is on...timer is running 2-3 faster then time in real. This is happened when i run simulation.

Share this post


Link to post
Share on other sites
2 hours ago, marcinmrag said:

I found out something streng. When the timer is on...timer is running 2-3 faster then time in real. This is happened when i run simulation.

Yes, your code does not look like it would work.  

Try this:

5c1bc524abc2f_Accumulatingtimer.thumb.jp

Make sure to set the TotalSeconds variable as retained:

5c1bc52435116_GlobalVariables.jpg.79368a

This will work and you will get this:

Watch.jpg.6cfb488a45b021548448a54d94651b

To get your time in years you will have to do this: AutoTimeDateStruct.Year - 1970

To get the time in months, you will have to do this: AutoTimeDateStruct.month - 1

To get the time in days, you will have to do this:  AutoTimeDateStruct.day - 1

The other variables can be used without any math. 

Share this post


Link to post
Share on other sites

It doesn't matter if i run my logic or your. In Symac 60s on mobile phone stoper shows : 20s. Could you explain my it happened?

Fixed

Looks like in simulation timer run faster than in real working with plc. When im online everything is fine

Edited by marcinmrag

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0