Looking for a Way to make a Time Stamp Logix 5000

showshocka

Member
Join Date
Mar 2011
Location
USA
Posts
510
Hello. I made up a GSV instruction for a Wallclock Time of my system. I'm not sure if this even possible or not, but is it some way that if an event output happens in the logic if I can use the Attribute info from the GSV to be recorded in some type of Timestamp of a particular event output? For instance, when output X was true, it came true at X Time - hour, minute and second.
 
Use the GSV, DTOS & CONCAT functions.

I convert the values into strings (DTOS), then use concatenate (CONCAT) to generate the time/date stamp.

Ash
 
When I need to do this, I create an array and use it like a rotating log with a pointer to the current (or last) value. Then make an AOI that logs the time stamp. A couple of system I also logged that data to a SQL database.
 
Thanks. I will research this in an Attempt to do these though I am lost on implementing either method in the replies Question: Can I still keep the same info that I am already using before I start on moving forward?

Time shot.jpg
 
I would reconsider what you are trying to achieve... Every "event" that you detect in logic will need a separate GSV to trap its "TimeStamp". That itself could be costly in terms of memory and execution speed.

But the timestamp data could also give you false information. It will tell you when you "looked at" the data (cyclic with your code "scan"), not when it actually changed.

If your "Events" are digital inputs, then you can trigger Event Tasks that will allow you to more accurately record the "Change-Of-State" of one or more inputs.

For recording timestamps, I would not burden your control system with deciphering the info from the WallClock, unless this info is going to be needed regularly, by that I mean every scan of your logic.

If you just store the "CurrentValue" attribute of the WallClockTime data, it is a 64-bit value representing the number of microseconds since 0000hrs, Jan 1st, 1970.

On the rare occasion you may need this info, SQL is easily capable of telling you the actual date/time of the timestamp.
 
I've been meaning to go back and try to find a neater/tidier way if possible but take a look at the attached run of code. I originally knocked this up the other week for a production report log, required the start time & dates etc...

It uses the information retrieved from the GSV function, then converts the data into strings using DTOS. Then use concatenate instruction to put them all together to produce a string that you require.

The messy bit that i don't like is the concatenate instruction to put them all together, also as the seconds/minutes/hours/days/months all can be single figures i put code in to add a preceding 0 if less than 10 to keep it tidy.

Ash

Example.jpg
 
I ultimately came up with this, that works just fine after I tested it numerous times. What do you guys think? The .ACC 2602 is What I put back in after I was sucessfully able to set the counter back to Zero, and the time that I did it was stamped. I MOVed it and have it sit in an EQU instruction where it does nothing. The Year and Month are down the road to be added, this is a daily reset for each morning's production.

Untitled.jpg

des.jpg
 

Similar Topics

Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
126
I have Allen Bradley plcs, I have had Circuit breakers and other automation equipment in the past. There's no solid buyers local. How much do you...
Replies
2
Views
193
can anyone has a good program to learn plc programming online. i have the basic looking into improve my skills thanks
Replies
1
Views
137
I want to monitor a couple signals in a place where there is no PLC but there is ethernet. I know I can use an AENTR or Flex I/O and a module but...
Replies
21
Views
740
I downloaded v24 for studio 5000 but can’t find where the download manager put it! Any help? I’ve done it before but can’t remember. Thanks
Replies
9
Views
378
Back
Top Bottom