Sign in to follow this  
Followers 0
Bill Linne

Logix 5000 Date-Time Stamp (GSV) to Text

12 posts in this topic

Surely somebody has come up with a "trick" way to present date-time stamps on Scada. I'm using GSV instructions to time-stamp some events to DINT[7]. Once that data is contained in the DINT, how does one go about concatenating or condensing it into a single piece of information presentable on HMI screens? (Trying to avoid presenting several different tags every time we want one date-time stamp displayed.) We've done this using a script running in the HMI (iFix), but that requires a trigger to run the script rather than updating dynamically when the value changes. I envision a new (text?) tag into which the concatenated data is written. Anyone able to steer me in the right direction? Thanks, Bill

Share this post


Link to post
Share on other sites
The 'trick' will be a lot of DTOS instructions and a bunch of CONCAT instructions to assemble all of these into one string. The hardest will be preserving leading zeroes if you want them. Good luck.

Share this post


Link to post
Share on other sites
Unfortunately, that's pretty much what we figured. Thanks for confirming. Would hate to do all that AND THEN find out there is an easier way!

Share this post


Link to post
Share on other sites
Actually it shouldn't be that bad. DTOS each item you want each into its own string. You get leading zeroes, if needed, by doing a STRCAT of the result from one of the previous on to the right side of a string consisting of 1 '0' (the character zero). Then use the MID command to keep the rightmost 2 characters. Finally do a bunch of STRCATs of these strings along with seperating strings (eg '/' or ':') to form the final string. Edited by b_carlton

Share this post


Link to post
Share on other sites
Thanks, Bernie. I'll give it a try over the weekend when things are a bit quieter around here. The "bad" part is the number of these time-stamps I'm looking at doing. Was hoping to at least find a method involving indirect addressing that would allow me to create one routine and feed any number of source DINT's into it. The good part is that nothing in the process is dependant on getting this feature working. It is just "nice to have" info. Bill

Share this post


Link to post
Share on other sites
Make a UDT of the structure for the time/date info. Then create an AOI (ver 16 or up) to take a variable of the UDT type as an argument and return the finished string as the result. Work it all out just once. Edited by b_carlton

Share this post


Link to post
Share on other sites
Here a a copy of the AOI I threw together awhile ago to do just what you are looking for. Hope that helps. Date_Formatter.zip PS If you have any questions or suggestions regarding my code please let me know

Share this post


Link to post
Share on other sites
Nice - I thought there would be someone who had already done this.

Share this post


Link to post
Share on other sites
Welcome aboard HandeledException. Looks like just the ticket! Will get into the thick of it over the weekend, and I really appreciate that your first post on this forum was a "home run" for me (I fully expect it will be). Thanks, Bill

Share this post


Link to post
Share on other sites
Thanks for the welcome Bill, I hope it works out for you.

Share this post


Link to post
Share on other sites
On the PLCs.net board I posted a routine that will do this. http://www.plctalk.net/qanda/showpost.php?...amp;postcount=5

Share this post


Link to post
Share on other sites
Up and running! Works perfectly as designed. I am thinking about modifying your version to eliminate the year and milliseconds to better suit what our Operators want. Very generous of you to share all that work. Thanks again! Bill

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0