WallClock and AOI Method

remullis

Member
Join Date
Oct 2012
Location
Georgia
Posts
179
I setup this wallclock and using the AOI logic I don't get back the correct day as today would be the 5th day however I show 4 and for Wrk_F and G I am also not reflecting the correct number. I have updated the plc clock in properties to the current pc time. Is there something else I am missing. If I need to reference attached is the screen shot. Thanks Rich

datetime_aoi.jpg
 
yes I used the dayoftheweek.acd code but it seems to be giving me the wrong numbers back. I verified that my wallclock is working and in sync with my remote pc, everything seems to be right and I have checked the expressions a couple of times, any thoughts of other areas?
 
Are the tags "Inp_Month","Inp_Year" and "Inp_Day" actually written in the logic you display? I see the GSV, but no copy of the actual "DateTime[x]" to the three tags used in the calculation?

rslogix_dayofweek_no_aoi.jpg
 
I tried to do a move to these tags from the wall clock but your saying I should do a copy? I'll try this, the move gave me shorted errors.
 
I stripped the sample to the absolute mimimum to avoid any copy instruction.
Seems to work, although personally I always copy the result from the GSV to a custom DateTime UDT. That way the code remains somewhat readable.

rslogix_dayofweek_no_aoi2.jpg
 
Last edited:
I set the logic up identical to what your example shows but for Friday I still show the 4 th day which should be five. Same as the example, what am I missing?
 
No expert on this but try using "LocalDateTime" instead of "DateTime".

I think this will solve your problem.

EDIT: I see that you did use LOCAL I was looking at basti504 post. sorry about the mistake.

BCS
 
Last edited:
Yes I've tried both ways. I'm getting 2014 , 10 th month but looking at the expression that's what I would get because it's adding 9 to this month. I'm missing something
 
Sorry if I am wrong, I am not sure what you are trying to accomplish with the CPT instruction.
But you could just make a UDT for Time and Date and use that throughout your program where needed.

I am pulling the User-Defined Block for you now and will also post the Time and Date Routine I used so you can see if this will work for you.

Will post in a few min.

BCS
 
Here you go, you can import both of these into a blank program to play around with and see if you like this better.

I think it will populate the tags automatically so just be aware of this if you put it into your working program.

Good Luck
BCS
 

Similar Topics

Hello, Been struggling with getting a 1769 L33ER PLC clock to accept an HMI entered time. I can successfully get the date/time to change but it...
Replies
7
Views
7,200
I have problem to set wallclock for controllogix by using SSV.
Replies
4
Views
2,794
My Wall Clock , on a CompactLogix ,as been working great , until now. My Year , Month , Day , Minute , Second , and Microsecond is good , but my...
Replies
5
Views
1,877
Hi Guys, I am trying to get the PLC wall clock to trigger a reset. I have gone through various posts on PLCtalk website and other website did...
Replies
9
Views
3,434
Seniors and Experts, forgive me if this has been covered 10,000 times. I have yet to see the subject function work properly in any of the plc's...
Replies
10
Views
8,836
Back
Top Bottom