Adding - Subtracting Date & Time

damica1

Member
Join Date
Aug 2015
Location
Illinois
Posts
839
Hello:

I'm working in the Connected Component Workbench environment with a Micro820 PLC.

Is there a way to add-subtract date & time values.

Thanks
 
Thanks for the reply but I need to know how many days-hours-minutes there is between 2 date/time ranges: (Example) 10/24/48 -11:56:23 and 12/15/96 - 15:33:55
 
Did you try? Pg 108 says the SUBTRACT operation 'will' take two TIME values, SUBTRACT, and return a TIME value as the difference.
What is the result of your example?
 
Yes is does take 2 "TIME" values but will NOT take "DATE" values.

As I said before I need to know the difference(how many days, hours, minutes, seconds, have elapsed) between let's say (10/24/1948 - 11:28:32) and (12/24/2016 - 15:45:53)

Thanks again
 
I don't have CCW or the Micro820, so im just guessing..
can you take startdate - date(any) to dint and time to dint, combine them and then take stopdate - date(any) to dint and time to dint , combine and finally do the math. Convert dint(any) to date / time?
Just a thought.
 
kwade, that's an Idea! I will see what I can come up with. Thanks for the input
You're welcome.

You may have to break apart the result twice, once to calc the DATE portion and then again to calc the TIME portion.
If you are lucky, CCW has something similar to UNIX EPOCH datetime handling. See this for a tool to compare your results.

The manual shows support for LINT (long int) that may be needed in place of DINT in my earlier posts. Cell phone screens are too small.
It also mentions something in the ANY_TO_DATE (pg286) about TIME being added to DATE, so maybe there is some hope for this task.
 
Last edited:

Similar Topics

Hi I am trying to find the simplist way to add/subtract/multiply/divide from all the dint's in a 42dint array. The timing on our main oven loads...
Replies
3
Views
2,992
Hi Everyone, Currently we have three plants running with Controllogix PLCs (L72, L73, L74). In each of these plants we have 2 FTView SE...
Replies
0
Views
46
Hello, Im building project with 1756-L82ES controller and 1756-IB16S card but i cant find it when trying to add the card to IO configuration...
Replies
3
Views
125
Hello, I have a pair of redundant 1756-L71 controllers rev 24. These controllers currently have produced and consumed tag interfaces to 3 other...
Replies
2
Views
154
I'm adding an IAI Gateway with 2 axes connected to it. To an ethernet network on my PLC. So, I think the math is correct on the Input and Output...
Replies
0
Views
136
Back
Top Bottom