RedLion HMI to AB CompactLogix time sync

MATT116

Member
Join Date
Dec 2009
Location
Dallas, TX
Posts
330
Hardware: Redlion G310 C3 and a AB Compactlogix 1769-L32E RSLogix 5000 V19.

I need to sync the time in the HMI with the PLC. I've got a tag DATE_TIME DINT[7] setup in the PLC using the wall time clock. I'm just not sure how to get the HMI to read the time. I tried using SetNow() function in C3 SetNow(date(Y,M,D)+time(hr,min,sec)) where Y=DATE_TIME[0] M=DATE_TIME[1]...etc. but I cant seem to make this work. Am I even on the right track? or should I be using the Time Manager in C3?

Thanks Matt
 
Last edited:
From the reference manual

Sets the current time via an integer that represents the number of seconds that have elapsed since 1st January 1997. The integer is typically generated via the other time/date functions.

looks like you need to calculate the no of elapsed seconds from
1 jan 07 lol and store it in a Integer Tag, then trigger it.

SetNow(MyIntTag)

i usually go the other way HMI sets PLC
i.e
PlcYearIntTag := GetYear(GetNow());
PlcMonthIntTag := GetMonth(GetNow());
PlcDayIntTag := GetDate(GetNow());
PlcHourIntTag := GetHour(GetNow());
PlcMinuteIntTag:= GetMin(GetNow());
PlcSecondIntTag:= GetSec(GetNow());
 
I normally just map the integers into a folder of tags called TIME_DEV, where DEV is my short nickname for the device, and then make a clock display exaclty as I want it, and put it on a screen used exclusively as a master slide. Group the clock, and then you can copy and paste it easily without disturbing the members of the group. The graphic editor in Crimson rocks, by the way, but I have some awesome ideas there...

I love using the Master Slide concept in Crimson 3.0. I have a template alarm/clock ribbon that is sweet on any of their HMI platfroms I have used so far. Use the Master slide as a selectable overlay that you can apply to a screen. When editing, it is shadowed, so you can build features that you want in a lot of places into master slides. My master slide has a menu button or two at the bottom, and alarm ticker and clock at the top, and I make a folder of screens called master slide, so I can give them unique features, and background colors too.

To get fancy, with clocks, I choose the direction with an internal Crimson flag and then that switch/cases the code that executes inside the tags defs ... I have not yet tried the network master clock features yet, and this, my Home PC, was just upgraded to Win7 32-bit at home, I am downloading C3 now...slowly through a cell phone booster...
 
Last edited:
Thanks for the help guys. I think I will just leave the times separate but atleast display the PLC time on the HMI so they can see if its getting out of sync
 
Ok I found a solution. You can use the GSV to get the CurrentValue which is the current microseconds UTC since 0000Hr January 1st 1970 and put it in a LINT. You can then download a AddOn from AB that will convert microseconds to Seconds and put that in a LINT you can now copy that to a DINT which the RedLion can use. Now the RedLion's time is from 0000Hr January 1st 1997 so you must subtract time difference in seconds from 1970 to 1997 which is 852,076,800. So in the Redlion I have a program triggered every 48 hours to sync with the PLC.
TAG2=((TAG1-852076800)-Time zone in seconds) - daylight savings time in seconds;
SetNow(TAG2);
 

Similar Topics

I have 8 of these systems all running the same code. Just this one seem to gain about 30 seconds in time everyday. So in 48hrs time will be...
Replies
3
Views
648
Hello, can anyone help with what driver to use in Crimson to communicate Ethernet/IP to a Prosoft PLX31-EIP-MBS gateway. The gateway will pull...
Replies
6
Views
816
Hi, I am using a Micrologix 1400 for a project, and we were supposed to use a 4.3in PanelView HMI. By means of delivery times, that won't be...
Replies
1
Views
967
Hi Experts! I am trying to get a Redlion Crimson 3.0 HMI to talk to a Rockwell Emulator. I imagine I'll have to use OPC DA. Has anyone done this...
Replies
0
Views
1,167
How to change Daylight saving time ON/OFF automatically in Crimson3.0&3.1/Redlion HMI How to change Daylight saving time ON/OFF automatically in...
Replies
5
Views
2,175
Back
Top Bottom