Get time? Crimson 3.0 question

I think it constantly runs because you are constantly calling it. What you need is a one-shot - are you up for a script? You could probably do alarm or trigger, but an option is a script. When the button presses, choose User Defined action and call the program. In here, write whatever value you were intending, but also assign a tag the value of GetNow() or what have you - that way it only runs when you press the button.

There are likely plenty of ways to approach this - others will have some good ideas to.
 
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.

This is for C3.

Create an internal integer tag (My example below calls it EventTime) and format it as Time and Date and set the correct Format Mode. You can make the Internal Tag Retentive by setting the Storage value to Retentive.

Put this Internal Tag next to the button you want to monitor.

Configure the button as user defined and make the "On Released" event match what you are currently doing with your button. This may require writing a program.

In the "On Pressed" event enter EventTime = GetNow().

You could also just add this to the Program for the "On Released" Event if you want to.
 
This is for C3.

Create an internal integer tag (My example below calls it EventTime) and format it as Time and Date and set the correct Format Mode. You can make the Internal Tag Retentive by setting the Storage value to Retentive.

Put this Internal Tag next to the button you want to monitor.

Configure the button as user defined and make the "On Released" event match what you are currently doing with your button. This may require writing a program.

In the "On Pressed" event enter EventTime = GetNow().

You could also just add this to the Program for the "On Released" Event if you want to.

BINGO!.....Thank you sir....I wish I could honestly say your fee is in the mail.
 
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.


Write a program to assign GetNow() to a tag formatted for Date And Time:

PB_Time:=GetNow();

Run the program on the rising edge of the button when the system is not already running.

This part you may want to do with an event to call the program. You can call the program right from within the tag events setting.

Now, if the PLC needs to know this time value, you may want to scratch this approach and go a whole different route.
 
nice....

Write a program to assign GetNow() to a tag formatted for Date And Time:

PB_Time:=GetNow();

Run the program on the rising edge of the button when the system is not already running.

This part you may want to do with an event to call the program. You can call the program right from within the tag events setting.

Now, if the PLC needs to know this time value, you may want to scratch this approach and go a whole different route.

When you say rising edge, do you refer to edge triggered event in the alarms tab of the applicable tag?
I'll have to fiddle around with some"if - else" statements, because I need to use the same button to set each different instance of the process requiring a time stamp into motion.....With my C skills it becomes a little convoluted but so far I have managed to get it all working off of the same few buttons this way.
 
When you say rising edge, do you refer to edge triggered event in the alarms tab of the applicable tag?

Yes, that is what I would use if I was doing all the time keeping and storage in the G3.

I'll have to fiddle around with some"if - else" statements, because I need to use the same button to set each different instance of the process requiring a time stamp into motion.....With my C skills it becomes a little convoluted but so far I have managed to get it all working off of the same few buttons this way.

Not sure I understand. You can write a program that only contains code you want to execute when the button is pressed. Then just call that program from the button Action tab.

Or, if you need the same button to do different things depend on other conditions (be careful, this can create operator confusion)...

You may want to create a tag that assigns a numerical value to the conditions, then have the button call your "time_stamp" program, and use a case/switch structure in the program to determine which tags need to be updated.

I am not sure I am giving good advice, not having a firm understanding of the "big picture" of your machine and its controls...but hopefully this will help anyhow.
 
Or, if you need the same button to do different things depend on other conditions (be careful, this can create operator confusion)...

You may want to create a tag that assigns a numerical value to the conditions, then have the button call your "time_stamp" program, and use a case/switch structure in the program to determine which tags need to be updated.

I am not sure I am giving good advice, not having a firm understanding of the "big picture" of your machine and its controls...but hopefully this will help anyhow.

Indeed this is how I have been doing it basically....There is no worry of operator confusion because they only see "start button" or "End". However, all the buttons have different instances of control depending on a numerical tag value representing different states.

Thanks again for the insight......

Kyle
 

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,780
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,227
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,731
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,770
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,599
Back
Top Bottom