Scopic88

nj101 Works in simulation but not on the Unit

6 posts in this topic

Hi ,

I am trying to transfer and reset a few counters at 23:59:59 everyday....

it works in simulation but on the unit itself... DOESN'T...

Here I changed the time but same thing !

Thanks

 

Untitled.png

Edited by Scopic88

Share this post


Link to post
Share on other sites

I haven't tried this myself but what if you change your comparison to a range instead?

Share this post


Link to post
Share on other sites

Thanks..... I never even think about it !!!  not Enough Coffee I guess !

 

Worked... Thanks

Share this post


Link to post
Share on other sites

Thanks for posting back.

I'm not sure what the resolution is for the TOD. If it were 1 microsecond than your 'Equals To' would only be true for 1 microsecond. This would be much faster than the scan of your program therefore would miss quite frequently.

Share this post


Link to post
Share on other sites

That's exactly what I figured out ...  I haven't done PLC programming for some time so I was a bit rusted !

instead of my '' = '' I inserted a GT 23:59:58 and a LT 23:59:59

this gives 1 second for the PLC to process the commands !

and it works fine... :-)

 

Thanks again !

Share this post


Link to post
Share on other sites

So I guess you caught that the PLC clock variable you entered was wrong?  CURRENT_TIME must be something you created, as the PLC clock is stored to _CurrentTime

I have done this using theDtToDateStruct and then do a compare with the hour equal to zero and a rising edge trigger.

 

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