Crimson logging on the hour and on button push

Randy Turner

Member
Join Date
Dec 2009
Location
Montpelier, Ohio
Posts
21
I am currently using the data logger in Crimson 3.0 and sending the log files to our SQL server. The log is triggered by a button push, but I would also like to trigger the same log every hour. I want to write to the same log, not create another log set to continuous mode. I would like to trigger based on the button push, or when the GetMin()=00, but I have to use two flag tags with the "or" logic in the log trigger. I can't seem to figure out how to get a flag tag to be true when the minutes of the internal clock = 00.
 
Create a new flag tag and make its source be a general statement that is "GetMin()==0? 1:0"

Note, be careful with your equals syntax. Use == or a double equals character for is equal comparrisons. Use = or a single equals character for value assignment. Its probably a good habit to avoid using a single = character just to avoid confusion, use := for assignment.
 
Last edited:
Create a new flag tag and make its source be a general statement that is "GetMin()==0? 1:0"

Note, be careful with your equals syntax. Use == or a double equals character for is equal comparrisons. Use = or a single equals character for value assignment. Its probably a good habit to avoid using a single = character just to avoid confusion, use := for assignment.

That doesn't seem to work. I've seen about every imaginable syntax error when I try to put that in the source of the flag tag. I've tried every iteration that I can think of.

Thanks,
Randy
 
D'oh!šŸ™ƒ.

GetMin doesn't retrieve the system time, it returns the minute when its given a time argument.

You need to use GetMin(GetNow())==0?1:0 to get the current minute and set the tag true when it is zero.

BTW, you'll want to be sure to configure a way to set the time in your HMI panel. If you don't know how to do that post back and I'll walk you through that.
 
D'oh!šŸ™ƒ.

GetMin doesn't retrieve the system time, it returns the minute when its given a time argument.

You need to use GetMin(GetNow())==0?1:0 to get the current minute and set the tag true when it is zero.

BTW, you'll want to be sure to configure a way to set the time in your HMI panel. If you don't know how to do that post back and I'll walk you through that.

Thanks, TConnolly. That did the trick. It makes sense to me now that I have seen it. I was thinking along those lines, but couldn't put it together correctly in my head. Also, I agree with you on providing a way to change the time, and no, I haven't done that before either, other than through the Crimson 3 software. I do display the date and time, but I'm sure there is more of what you showed me, but in reverse, to set the time. Can you give me some guidance? Thanks for your help.
Randy
 
I do something similar to the example provided. In my case this gives me the minute needed to know when to trigger logging: GetMin(TimeNow).

If you need to get additional specific minutes of an hour you can also use ModU32(GetMin(TimeNow), RATE#), where the RATE# constant allows you to pick odd/even numbers in different increments.
 
I somehow missed Randy's follow up request on how to set the time from the terminal. Sorry about that. I hope its not too late.

On a screen place a data box primitive. It will need to be fairly wide, I make mine 230 pixels wide with a Hei 12 font. Open the data primitive properties. On the Data tab under Data Source, select General and put the system variable TimeNow. Under field type select contents as Label and Data. Set operation to Data Entry. On the format tab under label type "DATE TIME M-D-Y H:M:S. Select the format type to Time and Date. Under time format pick your preference, 24 hour or 12 hour. Choose whether you want to show seconds or not. Configure any other options you want and click OK. At run time you will then be able to change the system time.
 
TConnolly -

Yes, I did figure it out after I had posted back to you.
Thanks for your help. It turned out that allowing the
time to be adjusted was simple, after I looked around a
little more. Data logging is working well on the Red Lion
G310 HMI.

Randy
 

Similar Topics

Hi Everyone, Got a new project and the specs call for me to log about 6 Real Tags every 15 minutes. Normally this is a very easy to do in...
Replies
15
Views
3,865
Currently, I am triggering the data using a bit and collecting the data values each and every time the data is triggered and every mid-night new...
Replies
7
Views
1,826
I am building a program for a load-out station. When the flow meter kicks on it will start tracking how much the truck loaded. Then when the flow...
Replies
2
Views
1,320
Greetings PLCS.net Community! :thumb: I've been a lurker here for a little while, and I've already found tremendous value in the posts I've...
Replies
2
Views
2,194
Hi, I'm looking for some guidance on how to set up the Triggered snapshot logging feature. I want to take a snapshot log of 6 tags at the end of...
Replies
1
Views
2,112
Back
Top Bottom