adccommunitymod (AutomationDirect) asked a question.

Adding and Subtracting Dates in a DL05

Created Date: February 28,2012

Created By: myfarm

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Good Day, I want to set up a program with a touch screen that will add and subtract dates similar to what I can do in excel. A formula with a date will be compared to today and if it is greater than 60 days from today a result will be given. Any suggestions on how to do that? Thanks


  • adccommunitymod (AutomationDirect)

    Created Date: February 28,2012

    Created by: Do-more PE

    I would convert the dates to Julian Date format and do the math from there. Wikipedia has the calculation.

    I would assume that either you have the clock module or that you are getting the current date externally since the DL05 does not have a clock/calendar built in?

  • adccommunitymod (AutomationDirect)

    Created Date: February 29,2012

    Created by: myfarm

    Thanks for the help. When I looked in the PLC instruction set matrix there was an "x " by the date instruction for the DL05 so I assumed it worked. I had one laying around so I was going to experiment with it for this project. If I needed to buy something better with a date function I could.

  • adccommunitymod (AutomationDirect)

    Created Date: February 29,2012

    Created by: Do-more PE

    You could get the time/date module for the DL05 (D0-01MC) for $59 or you could get a Click that has the time/date function built in for around $99 (C0-01DD1-D). Be aware that the base model Click does not have the time/date function built in. You need to step up a model to get it. Also with the Click, you would need a 24VDC power supply (C0-01AC, $39) to power the PLC since all models are DC powered.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 29,2012

    Created by: myfarm

    I have a Click PLC in use near where I want to add and subtract dates. I thought that I could not use it because it does not have a date or time function. I am also planning to hook a C-More panel to it so that we can input data to it. After looking around in the C-More software I found that I can use that clock and send the data to the PLC. I started doing a little bit of work on this and discovered a few things.

    I need to use dd type data for my Julian Dates because they are so large.

    I don't know which kind of data type to use for my tags on the C-More. I am sending 2 or 3 digit numbers from the PLC to the C-More should I use Signed int 16 or Unsigned int 16? I don't know the difference except Signed gives me a dash displayed on the C-More and Unsigned does not.

    Thanks for your help!

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 29,2012

    Created by: Do-more PE

    If you are going to use the Click, the data type will either be signed or unsigned. The difference being that signed numbers can be negative, Unsigned cannot.

  • adccommunitymod (AutomationDirect)

    Created Date: February 28,2012

    Created by: myfarm

    Good Day,

    I want to set up a program with a touch screen that will add and subtract dates similar to what I can do in excel. A formula with a date will be compared to today and if it is greater than 60 days from today a result will be given. Any suggestions on how to do that?

    Thanks

    Expand Post