Get time? Crimson 3.0 question

KNeland

Member
Join Date
May 2010
Location
Boise, Idaho
Posts
87
We are using the extremely excellent Red Lion G315C HMI in our plant. I have managed to get a lot of functionality applied to our needs, in large part due to the "Johnny on the spot" technical help from the gentlemen at R.L.....as well as excellent assistance with the complex programming from superior programmers here on this site(Thanks again Robert!).

Again I find need for some direction with complex code.
The question is how can I grab and "time stamp" chosen operations dictated by the operator using the G315? Currently I have registers for "hour","min","sec" coming from the plc that are tagged in the R.L. and grab them as part of a user defined operation when other actions are implemented. The issue is that I have many instances of needing these time stamps and due to certain network realities, our plc to G315C communication isn't real "snappy"(we are working to address the slow communication issue hardware wise)

My thought is it would be so much nicer to "snapshot" the time with the R.L. and write that to a PLC register as well as datalog it with the HMI. That way I could have the whole time (Hr,min,sec) is one swoop as opposed to separate registers for each.

I use the "getnow" to display the current time in databoxes on many pages, but have been struggling with other applications of the "time" system functions.


Anybody have experience with this?

Thanks in advance!
Kyle
 
I didn't mention that the primary need for the time stamp is for displaying purposes as well as datalogging to the CF card (please disregard the write to PLC register in original post as that didn't make sense).

Kyle
 
Have you looked at the GetNow() function? This provides a current timestamp. Depending on how you format it can look different, but it's the same data.

Right now, if I call this and and it is an INT (likely really a DINT) tag, the value is

455460054

but if I format as date/time and show seconds, it is

06-08-11 12:40:54 PM

on my display.

Is this helpful?
 
For display purposes you can simply place the Time/Date primitive on the display, which uses the TimeNow function.

For datalogging each line automatically gets a time stamp as part of our built in logging.

Thanks
Jeremy
 
Lots of "Get" instructions in G3

When you open your C3 software and look in the System Resource pane (on the right) look in the folder labeled function then the folder labeled time. You will find several Get functions. You can get all manner of date and time stamps here. I have used them and they are simple to implement in programs and you can trigger them directly from Tags.

One thing though. If you are using the Data or Event Log function on the G3 then it should already have the date stamp.

Are you rolling your own custom Data/ Event Logs?
 
GetNow() simply returns the number of seconds that have elapsed since 1/1/1997 (a 32-bit value), based on the G3's internal clock. The Date/Time display primitive, as well as the other date/time functions, are designed to manipulate and extract information from this format. So, in your situation, you could create a trigger tag based on some PLC condition that would transfer GetNow() into a 32-bit PLC register and/or a file on the CF--and there's your timestamp.

The point of all this being, the GetNow format is convenient because it consolidates an entire date/time string into one 32-bit value.

In my experience, however, the G3's internal clock isn't overly accurate. Expect to gain/lose several minutes per month, and there isn't any built-in mechanism to handle daylight savings time changes. That is, of course, unless they've implemented it in C3 (I'm still a C2 guy). There is an option to synchronize the clock with a time server on the network, if you have that available.
 
GetNow() simply returns the number of seconds that have elapsed since 1/1/1997 (a 32-bit value), based on the G3's internal clock. The Date/Time display primitive, as well as the other date/time functions, are designed to manipulate and extract information from this format. So, in your situation, you could create a trigger tag based on some PLC condition that would transfer GetNow() into a 32-bit PLC register and/or a file on the CF--and there's your timestamp.

The point of all this being, the GetNow format is convenient because it consolidates an entire date/time string into one 32-bit value.

In my experience, however, the G3's internal clock isn't overly accurate. Expect to gain/lose several minutes per month, and there isn't any built-in mechanism to handle daylight savings time changes. That is, of course, unless they've implemented it in C3 (I'm still a C2 guy). There is an option to synchronize the clock with a time server on the network, if you have that available.

I generally just put a primitive on a screen where I can adjust the time manually. If you want to get creative you can use the SetNow function and get the time from another tag that is filled by the PLC or some other device connected to the HMI

That is the cool thing with the G3 you can use whatever method strikes your fancy.
 
In my experience, however, the G3's internal clock isn't overly accurate. Expect to gain/lose several minutes per month, and there isn't any built-in mechanism to handle daylight savings time changes. That is, of course, unless they've implemented it in C3 (I'm still a C2 guy). There is an option to synchronize the clock with a time server on the network, if you have that available.
C2 can sync using Time manager with SNTP i think.
 
Have you looked at the GetNow() function? This provides a current timestamp. Depending on how you format it can look different, but it's the same data.

Right now, if I call this and and it is an INT (likely really a DINT) tag, the value is

455460054

but if I format as date/time and show seconds, it is

06-08-11 12:40:54 PM

on my display.

Is this helpful?

Hats off to you sir, as your previous help has been invaluable to me with this new (to me) G315C.

Indeed I use the GetNow() function with databoxes on each screen currently.

What I am looking to do is get a "snapshot" of the time...say...when a particular button was pushed starting a process. Just that moment. The GetNow() as I use it returns a constant updating ...like a real clock.
I want to display this snap shot time to the operator...so he can visually check what time he started the process via the "start time" box I have on the display.
We are in a time of slowly upgrading plantwide systems, but for now many things are still written down on the floor and processed later. This display of "start time" would assist the operator in his documentation. Eventually we will be moving all pertinent data directly to the servers through SCADA(which is still being specified) and these time displays will be unnecessary.

Kyle
 
For display purposes you can simply place the Time/Date primitive on the display, which uses the TimeNow function.

For datalogging each line automatically gets a time stamp as part of our built in logging.

Thanks
Jeremy

Doh! Did I mention that I am training to become a master of the obvious?
I did mention about the "Johnny on the spot" service from R.L......"Ask and ye shall receive"
 
You can use the edge triggered event under the alarms, to trigger a datalog, when a button or process starts. This will show up on the events history, but not on the active alarms. You could also use a trigger under the data tag, to move the getnow function to another integer, if you need to display this elsewhere on the screen.
 
Yes, you have so many tools and much power with Crimson 3.0 that it is easy to overlook datalog models that are event triggered and how to set them up.

I did custom logging first, then got some help from Jeremy and Mike G and others from Red Lion, I got much better results using their tools with the right settings.

For instance, to increase the longevity of the CF Card, the Red Lion Datalogger stores to retentive memory cache first, then only performs writes at user smartly calculated intervals, combine that with FTP Sync and soon to be explored new SQL Sync.

Learn to define your tags in Crimson 3.0 terms, starting top down with objects, tag structure to follow, and put all the display formatting, and even alarm delay timers in the Red Lion, and you can trust the logging process if you use FTP Sync and enable logs which can be multiple, and a mix of time and event triggered logs. Use a high quality CF Card and let your Crimson device format it. Now if there's a network problem and you don't check the logs, your data is stored in csv format on the card. I can store about a years' production on my checkweigher including security logs, 6 datalogs one of which is about 12,000 records (a CString, float, and integer) items per 16 hour day.

No worries though, as I can just log into the thing using Chrome browser and IP address and open the log files or save them.

All of things are done nicely and thoughtfully in Crimson, once you learn how to configure everything.

One thing I did on an air handling system that has about 50 users, was to give them each a personal log in. I used the export/import to copy them from Outlook pretty quick.

Now, when a Start PB (or any other button) is pressed on the touchscreen, my event log shows the Real Name of the user who pressed the button. theres an event tied to the tag, but no alarms, so it only shows up in the event log viewer on screen, but is also logged to CF and can't be remotely deleted. So all the users can log in from one of five PCs in the plant, so they don't even have to touch the screen to switch the air setpoint mode.

When they view the event history and see their name in the digital record, they tend to somehow magically quit doing idiotic things as often.
 
Last edited:
One thing I did on an air handling system that has about 50 users, was to give them each a personal log in. I used the export/import to copy them from Outlook pretty quick.

Now, when a Start PB (or any other button) is pressed on the touchscreen, my event log shows the Real Name of the user who pressed the button. theres an event tied to the tag, but no alarms, so it only shows up in the event log viewer on screen, but is also logged to CF and can't be remotely deleted. So all the users can log in from one of five PCs in the plant, so they don't even have to touch the screen to switch the air setpoint mode.

When they view the event history and see their name in the digital record, they tend to somehow magically quit doing idiotic things as often.

Sweet!....One question...If a user is logged into the system, how does the RL know which user pressed a given button?(figuring there are multiple users logged in concurrently) Does each user log in to his own personal "session", with a single user dedicated screen?

Kyle
 
Sweet!....One question...If a user is logged into the system, how does the RL know which user pressed a given button?(figuring there are multiple users logged in concurrently) Does each user log in to his own personal "session", with a single user dedicated screen?

Kyle
On the tags' Security tab, I turned on Write Logging: "Log Changes by Users and Programs" I think it was that simple. You have to set a security access level for the tag before that option opens up, but you can't log the name unless logged in anyway.

On the screens with controls, I put a text box with the text data:
Text: ="Welcome "+GetCurrentUserRealName()

So when the inactivity timeout expires it just says "Welcome". If you don't assign real names, I am not sure what appears in the logs. I went ahead and put whole first and last names in for maximum effect.
 
Last edited:
ok....ummm

The responses here have given me some great insight, but I still don't have an understanding how to display a "time stamp" as say a data box next to a button that the operator would push. I have been experimenting a bit with the getNowTime ...and Time....and GetNow.....All of these give me the current time...running....
The deal is I only need a snapshot of what the time was at the moment the button was pushed. So the operator can write that number down.
I see that with the event viewer, all events are logged with their time. I would like to not have the event viewer involved.
I am already pulling this off by using the PLC, but it requires a seperate register for starting HR, min, sec...and the ending HR, and min, and sec.....and I have a minimum of three instances of this process running simultaneously so that is a lot of registers to do such a simple task, especially considering that crimson already is keeping track of time on the display.

BTW, I don't need this "time snapshot" data sent anywhere just yet, only displayed for the current operator...I imagine I will set it up to clear when the process finishes automatically

I bet the answer is obviously but I am not seeing the forest through the trees.
 
Last edited:

Similar Topics

Hi Everyone, Hope you all are safe and well. I have a question about creating a Data Log snapshot in Crimson 3.1. I have created a HMI screen...
Replies
11
Views
2,757
Can you program the Help button on the Alarm Viewer to go to a different page? I want to create a separate page with the alarm details on it.
Replies
1
Views
1,222
Hey folks, looking for a bit of help. I have a G15 HMI, I am using Crimson 3. I have created a program with contents: if (Type == 150)...
Replies
6
Views
1,696
Hello, I am trying to use the animated image core primitive on a load screen. Not sure how i display more than 2 images. I would like to display 8...
Replies
7
Views
1,763
I just started working with Crimson 3.0. I have an animated gauge and it works fine but the needle is too thin. Is it possible to make the needle...
Replies
2
Views
2,595
Back
Top Bottom