I need help to make a Working Schedule for Make-up Air unit

Duchx2

Member
Join Date
Apr 2024
Location
Quebec
Posts
5
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for HVAC programming.

My question is this: we want to program a Make-up Air Unit that will operate according to a request on an HMI. For example, the operator could decide to start the MAU between 9 am and 2 pm, but the following Tuesday he could decide to start it only from 8 am to 10 am.
I know how to use WallClockTime, but I don't know how to compare DINT tags (from HMI) with GSV values.

I've linked a quick sketch of the HMI in question

 
[...] but I don't know how to compare DINT tags (from HMI) with GSV values.

It's bookkeeping.

IIRC there is a family of routines at the Rockwell Automation website that can do operations on the 64-bit WallClockTime values you get in Logix.

Where is the comparison being done, in the Logix or in the HMI?

TL;DR

all time representations are relative, so all time representation have a zero epoch (time); e.g. it is often the Unix™ epoch of 1970-JAN-01 00:00:00.

most time representations have a time zone.

all time representations have a rate i.e. time interval per count.

The trick is to get the two times, DINT from HMI and DINT[2] or LINT GSV from CompactLogix/ControlLogix, into the same time representation i.e. same zero epoch, same time zone, same interval per count.

So the first thing is to figure out the details of the two systems.
  • If the HMI time is a DINT, I am going to take a wild guess and say it is likely a 32-bit count whole seconds since Unix™ zero epoch.
    • The current value today is around 1.7 x 109,
    • But you should confirm this by obtaining a sample value and comparing it here.
    • Note that we are about 14y from 2038 when that 32-bit DINT will roll over 2G to a negative value; you can get another 68y of breathing room by COPying the DINT bits to a UDINT (assuming the comparision is being done in a 5x80(?) Logix)
  • The Logix GSV WallClockTime object (cf. here*) is something like a 64-bit count of µs since the Unix™ zero epoch.
    • The current value today is around 1.7 x 1015
* non-@OkiePC-safe link ;).

Issues of drift, the accuracy required, keeping the Logix and HMI clocks synced, etc., are specific to the installation but should be considered.

Assuming timezone is a non-issue and the two times have the same epoch, all that remains is matching the rate. You can
  • either divide the WallClockTime by 106 so the DINT result is seconds since the epoch and can be compared directly to the DINT from the HMI,
  • or multiply the HMI DINT by 106 so the LINT (or DINT[2]) result is µs since the epoch and can be compared to the WallClockTime from the Logix (messy if DINT[2], but doable).
It might be easiest to move everything into LREALs, if available, which have 53 bits of precision and are good for 286y+ of microseconds. and 286My of seconds, and do the multiply or divide there without concern for overflow.
 
The HMI DINT could also be converted to year, month, day, hour, minute, second, and compared to the GSV WALLCLOCKTIME.DateTime DINT[7] from Logix, but that comparison gets messy.
 
Good, thank you for your reply. It does seem rather complicated for my expertise with Logix Designer. I was going to use a DINT tag called Monday and use the sub-divisions Monday.8 = 8h am, Monday.9 = 9h and so on. So if I have from 8h to 10h, I have the bit Monday.8, Monday.9 and Monday.10 at 1, the value is 1792 and I could compare it to the WallClockTime

But I'm a self-taught person, so I'm going to start by understanding what you've suggested.
 
Ah, I did not understand the application.

You would have 7 DINTs, one for each day of the week, and each of the first 24 bits of each DINT represents an hour of its day?

So all the PLC needs to know is the current day of week, which tells it which DINT to look at, and it could know which bit to examine for the current hour from DINT[3] of the WallClockTime/LocalDateTime GSV?

That's not a bad idea. Converting the day of week and hour operator input to a seconds-since-epoch DINT value on the HMI side would be messy, so doing everything in day-of-week should simplify things a bit. If you search this forum and/or the Rockwell site for "day of week" you will probably find a suitable AOI. Or, knowing that the 1970-Jan-01 epoch was a Thursday, you could divide the GSV WallClockTime/CurrentValue by 86,4000,000,000 (µs/d; truncated) to get days since the epoch, then reduce that modulo 7 to get the day of week offset from thursday (0=thursday, 2=friday, ..., 6=wednesday), or shift it by 4 first to get the offset from Sunday:

Code:
GSV WALLCLOCKTIME CurrentValue wallclock_LINT   ### Get CurrentValue of WALLCLOCKTIME, µs past epoch
MOD wallclock_LINT 86400000000 working_LINT     ### Get µs of current day
SUB wallclock_LINT working_LINT working_LINT    ### CurrentValue truncated to start of Today
DIV working_LINT 86400000000 working_LINT       ### Today offset from epoch, d
ADD working_LINT 4 working_LINT                 ### Today offset from Sunday 1969-DEC-28, d
MOD working_LINT 7 working_LINT                 ### Day of week, offset from Sunday, d
 
Ok so now I'm able to output the day of the week in my PLC and if on my HMI the operator decides to take Monday as the day I've got something to compare. Now how do I run my machine according to the time of day, for example from 8 a.m. to 5 p.m., which can be modified according to demand? I've made several searches on the forum and I haven't found anything about a working hour.

And thank you, I really want to solve this operation because it would be the last step of my project.
 
I did what you told me and if the operator presses the 8 o'clock MONDAY square, a MONDAY bit is set and if the comparison is true, I can confirm the day.
 
Something simple to do and play with it.GVS DOW-AOI.png

You can download the Day of Week AOI from Rockwell. It's just a few compute functions. Yellow rectangle.
 
Hi guys, I've been working on my prog with the advice you gave me. Now I've been told to look at how to manage time drift. Do you have any advice on this?

THANKS
 

Similar Topics

So the quick and short of the situation is that I designed an axle press that was sent to one of my company's other facilities. That facility just...
Replies
19
Views
4,287
Hi all, One question - why doesn't this work? SIZE Storage[0] 0 StorageSize COP Zeros[0] Storage[0] StorageSize Storage and Zeros arrays...
Replies
9
Views
3,079
Hi all, I have my DataMan 8100 all set up in RSLogix 5000 (compactlogix controller). The scanner reads bar codes just fine and brings in the...
Replies
1
Views
1,873
HI! I'm student and I have to netwok some PLCs. I have 1 SLC5/03, 1 SLC5/02 and 2 micrologix 1000. I want to network them all in a DH-485 network...
Replies
0
Views
1,475
hi there ,,,,,,,,any body plz help me out,,,,, anybody knows about messung plcs????? i m working with one of it in my project,,,,,,myself is doing...
Replies
3
Views
4,655
Back
Top Bottom