RSLogix500, RTC into DINT, or maybe String? *NEWBIE*

rohan_hamer

Member
Join Date
Sep 2019
Location
Victoria
Posts
4
Hi guys,
Im a complete PLC newbie, I am trying to complete a Uni assignment.

I am struggling on my last step, I need to save a unique identifier at regular intervals, my thought was to use the MOV function and the PLCs RTC to save datetime into a DINT, It would be nice to be about to output this into something to prove it works but using the Emulation software I know the RTC doesnt count, so thats tricky. as the whole system is a virtual system.


I cant get the addressing quite correct so cant get the project to compile. anybody able to give me some guidance to tips on this one?

I have a rung that has a series of MOV instructions with the Source as RTC:0.YR ,RTC:0.MON etc but how do i put them into the dint as YYMMDDHHMMSS style. should I be using a string?
 
Hi

Look up the GSV instruction and look at the real time clock.
This will have the date and time into dint format already

Donnchadh
 
Hi

Look up the GSV instruction and look at the real time clock.
This will have the date and time into dint format already

Donnchadh

Hi mate,
I dont believe RSlogix500 has GSV only 5000

I have uploaded just the file im working on to play with this,
I have 2 different look ups for RTC using Status and one using the RTC, was just playing with how to get this going.
 
Hi

Look up the GSV instruction and look at the real time clock.
This will have the date and time into dint format already

Donnchadh

Looks like he's using Logix500, not 5000, Donnchadh.


rohan_hamer : Since the Logix500 family doesn't support DINTs very well, being a 32-bit machine, I would suggest you do some manipulation to create a string, as suggested.

Since the RTC was quoted, I'm guessing that the PLC in question is a MicroLogix, and the Year, Month Day data is in the RTC Function File. If it were an SLC, the date/time data is in the Status File, S:37 to S:42

From wherever you get the data, you can AIC (Integer to String) each value into separate 2-character Strings, and then use a bunch of ACN (String Concatenate) instructions to build the complete timestamp string. You might need to do some manipulation when a value is less than 10, as it will only create a 1-character string, and you may need to truncate the Year to just the last two digits.
 
Last edited:
Looks like he's using Logix500, not 5000, Donnchadh.


rohan_hamer : Since the Logix500 family doesn't support DINTs very well, being a 32-bit machine, I would suggest you do some manipulation to create a string, as suggested.

Since the RTC was quoted, I'm guessing that the PLC in question is a MicroLogix, and the Year, Month Day data is in the RTC Function File. If it were an SLC, the date/time data is in the Status File, S:37 to S:42

From wherever you get the data, you can AIC (Integer to String) each value into separate 2-character Strings, and then use a bunch of ACN (String Concatenate) instructions to build the complete timestamp string. You might need to do some manipulation when a value is less than 10, as it will only create a 1-character string, and you may need to truncate the Year to just the last two digits.

OK this is very helpful,
I will use the MOV to put them directly into strings and the ACN to complie into 1 string..
 
Looks like he's using Logix500, not 5000, Donnchadh.


rohan_hamer : Since the Logix500 family doesn't support DINTs very well, being a 32-bit machine, I would suggest you do some manipulation to create a string, as suggested.

Since the RTC was quoted, I'm guessing that the PLC in question is a MicroLogix, and the Year, Month Day data is in the RTC Function File. If it were an SLC, the date/time data is in the Status File, S:37 to S:42

From wherever you get the data, you can AIC (Integer to String) each value into separate 2-character Strings, and then use a bunch of ACN (String Concatenate) instructions to build the complete timestamp string. You might need to do some manipulation when a value is less than 10, as it will only create a 1-character string, and you may need to truncate the Year to just the last two digits.

MOV will not do it - you have to use AIC to CONVERT the data-types


Got this all working. I get nice repeatable single string containing a 13bit date/time. its abit ugly as its 16 rungs long but it will get the job done.

Thankyou everyone for the tips
 
please remember that the slc500 series has a limit on the following

number of series contacts in a rung.
# of nested branches (8 if I remember correctly)
# of parallel branches - I limit the rungs to 8,you can get away with 10, 12 has an issue executing the rung. discovered this in a 5/03

james
 

Similar Topics

Hi Able Engineers! How can I use Real Time Clock (RTC) to get flow per every hour and Day on RSL0gix500, Assuming I want to see volume of Liquid...
Replies
10
Views
3,118
Actually i am working on some project in which i have to control some digital inputs/Outputs with the real time. Means on day hours my All output...
Replies
2
Views
2,427
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
14
Views
172
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
543
Hello, I'm new to programming. I'm using RSLogix500 to modify an existing program for a SLC500. My plan was to use one of the existing inputs...
Replies
26
Views
2,002
Back
Top Bottom