RS Logix 500 date add prog

nilesh_1106

Member
Join Date
Dec 2011
Location
pune
Posts
34
Hi
I am using Micrologix 1400 (A),so I want to add int value as date to current date (read at different data register from RTC,so its not directly add to a RTC).so how it will be done?
 
Can you better explain what you want to accomplish?

Are you taking the RTC from the controller, and moving it into a different file? If so, you could just add to that file, and then put the destination as another file, not the RTC.

If you are not getting the date from the RTC, then where are you getting it from?
 
Thanks for reply.
yes. i have been taken the rtc from the controller and move into differnt data register (Suppose N7:200 to N7:205). right now I want to add integer value as date value to copied data register (N7:200 to N7:205).so how i can add this data as date Addition?
e.g
curreent date (copied reg.) 21/01/2012
suppose i want to add 30 days to current date(copied reg.).
so this addition must show the date 20/2/2012.
now, how it can be possible?
Note. this date addition only for date copied reg. not for a RTC.
 
You will need to convert the INT files to STRING. Use the AIC (ASCII Integer to String) instruction.

Convert each piece to a string, then use the ACN (ASCII Concatenate) instruction to combine the strings into a single string. The ACN only works on two strings at a time. You will have to add the first two, store it somewhere, then take that, and add the third, then the forth, then the fifth.

Use a blank STRING file and put the "/" character in it, and use that to add the "/" to your date.
 
I don't think he's worried about the string representation.

He wants to reliably add a certain number of days to a date so that the result ends up correct given the different number of days in months. This is a non-trivial application. Think about lapping over into the next year also.

Take the date of the month. Add the number of days you need.

Repeat this section as needed:

1. If the number of days is less than or equal to the number of days in the current month then you are done.

2. If the number of days is more than in the current month (this is where a table of the days in a month are needed. Make sure to account for leap year) then subtract the number of days in the current month and add '1' to the month.

3. If the month is more than 12 then add '1' to the year and change the month to '1'.

4. Go back to 1


I don't have the formula for converting to/from a Julian date otherwise you could use that:

Convert to Julian
Add number of days
Convert back from Julian.
 
Oh. I see.

I thought he was looking to add the individual date data files into a single expression.

That's what I get for trying to answer the question early in the morning.
 

Similar Topics

Just tuned a heating application where my natural period was 250 seconds. Everything I've read says that the loop update time should be 5-10 times...
Replies
1
Views
1,618
Hi all, I'm trying to update a Micrologix 1500 processor firmware to version 13, and I'm getting this error message: "Illegal command format...
Replies
9
Views
5,665
I am currently working on a SLC 5/05 project (I don't do a great number of these). I need to add a 1746-NO8I module, but RSLogix v6.00.00 I/O...
Replies
4
Views
3,423
Hi everybody! I'm trying to make an external lightening system time-controlable with AB SLC 5/05. I'm with some dificulty in compare specific...
Replies
9
Views
7,424
Hi everybody!!! I have a problem with the date data... I have a SLC500 /3 which has to start a system with 6 motors. The motors can be started...
Replies
11
Views
6,162
Back
Top Bottom