Write Red Lion time to MicroLogix

Ken Roach

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Seattle, WA
Posts
17,478
I know there are a lot of veteran Crimson 3 users here, so I'm going to ask what is probably a fairly simple question.

I know how to set the MicroLogix 1400's Real Time Clock (RTC:0) by using the Copy Word instruction to move integer values into each element of the RTC.

But how can I get the Red Lion (I'm using a G308) to write the Time from its Time Service into a set of MicroLogix integer registers ?

As I understand it, the Red Lion holds the Time as a long integer, counting seconds starting from 1/1/97. You can show this time as a "Time" or a "Time/Date", and I'm doing that just to show "08-13-2012 11:04:23 AM".

Where my understanding lapses is how I can use the "GetNow()" or something similar to connect up to a Gateway Block so it's automatically updated in the MicroLogix.

Do I need to write a Program for this, or is there a simple way to create a tag with an Expression that holds the current Minute, or Hour, etc ?
 
Maybe I should take my sig line to heart; I figured this out shortly after posting.

This takes just two steps:

1. Define an internal Tag with a "General" data source, and type a simple Expression using one of the GetTimeDate family operators and GetNow() as the actual data source.

In my case I have six Tags, named "TimeService_Year", "TimeService_Month", etc. Each one has an expression like "GetYear(GetNow())".

You don't need a Program, or a Complex Expression. Just an ordinary Expression in a General type tag.

2. Configure a Gateway Block. I addressed a Gateway block to a set of MicroLogix integer registers, N14:20-25. Each of the TimeService_xxxx tags was just dragged from the Resource Pane into the Gateway Block configuration.

And wham, that's it. I have the Year, Month, Day, Hour, Minute, and Second from the G308 in my MicroLogix 1400 integer registers.

I think these update only when there's a value change... I'm going to experiment to see if I can make them update every time there's a Minute value change.

TimeService_Gatway_Tags.PNG
 
An addendum: I could not figure out why "GetDay(GetNow())" was returning a value of 1, instead of a value of 13 (today is August 13).

A couple of minutes on hold at Red Lion Tech Support, and I spoke with "Dan" (who might be Dan Yost).

"As it should", he said. "It's Monday".

Of course... GetDay is the Day of the Week. GetDate is the Day of the Month.
 
An addendum: I could not figure out why "GetDay(GetNow())" was returning a value of 1, instead of a value of 13 (today is August 13).

A couple of minutes on hold at Red Lion Tech Support, and I spoke with "Dan" (who might be Dan Yost).

"As it should", he said. "It's Monday".

Of course... GetDay is the Day of the Week. GetDate is the Day of the Month.

This is one of those questions that could also be easily avoided with just the slightest additions or examples added to the help/manual. I haven't had the chance to visit the forums much today to pitch in, but it looks like you kicked it in the pants in 15 minutes anyway.
 

Similar Topics

Happy New Year everyone, I am working on a Prototype project using a AutomationDirect Click Ethernet PLC and a Red Lion G306 HMI. I have the HMI...
Replies
3
Views
1,702
Regards everybody. I need your help for resolve a problem with some bits that I want to write to PLC Micrologix 1400. In the HMI (Red Lion...
Replies
1
Views
3,850
Hi Guys I have a question concerning a Red Lion G306C HMI Screen connected to a Direct Logic 205 PLC. I am having a problem writing to a...
Replies
1
Views
3,509
Hello All, getting my feet wet currently with Node-red, curious if anyone has experience with the SMB share add-in(or whatever the terminology...
Replies
2
Views
294
Can you please help me to write the whole code for the function (MSG_Modbus2) using Structured Text at Connected Components Workbench (CCW). When...
Replies
0
Views
1,315
Back
Top Bottom