How hard is it to program Time of Day controls in InTouch?

defcon.klaxon

Lifetime Supporting Member
Join Date
Feb 2015
Location
Far NorCal
Posts
616
Hi guys,

I have a client who wants to be able to enable/disable a process with a user-adjustable time-of-day control (start time, and stop time, in an hours:minutes format). The HMI software is InTouch. I was wondering if any of you had experience setting this sort of thing up and how involved it would be; is there a way to format a string into time, and have it be user-adjustable? I have an example in a very old system and it uses a rather cumbersome pushbutton system to increment/decrement the hours and minutes; I'd really prefer to have the field be clickable and adjustable. So I would think animating the time setpoints to be strings would probably be the way to go about it, but how would I extract the hours vs minutes? Sounds like I need to write a script that would send an enable/disable bit from the HMI to the PLC...would love any input you guys could provide for how to do this gracefully via script. Thanks!
 
just a thought. what happens if the pc is down for updates when this process is supposed to happen? Id try and setup this process to trigger in the plc and just hand off the time you want the process to start from wonderware.
 
just a thought. what happens if the pc is down for updates when this process is supposed to happen? Id try and setup this process to trigger in the plc and just hand off the time you want the process to start from wonderware.

Hmm...not sure exactly what you mean. Let me provide some more details and maybe that'll clear things up.

The system is a water treatment plant, and it's running Allen Bradley Logix PLCs. HMI will be running on a racked server, and there will be a local workstation PC at the plant (and remote connectivity via tablet/phone/whatever via VPN). The idea is, during the wet season when demand is down, they only want to let the treatment plant run when it's staffed (i.e. 9-5) so they'd use this Time-of-Day control to automatically have the plant disable at the end of each day. During the summer the plant will run 24/7 but of course that means if there is ever an alarm or failure, you need someone on call to go and check the system out so the TOD disable allows them to lower their overtime costs.

So, my idea is that there is an "enable" time that'll be set for like 7am, and a "disable" time that'll be set at like 4pm (or whatever). If the system time falls between those two setpoint tags, then the system will be allowed to operate if called to do so (based on tank level setpoints).

So I guess you're asking why not have the time setpoints in the PLC and stored there with the enable/disable logic, so that the operation isn't dependent on the HMI running a script and all the logic is local to the PLC? Great question, and I'm open to either way. Perhaps the PLC has a function that can break up the string into integers, from which I can program the logic and I'm not reliant upon the HMI to perform a script and if comms ever fail, the time start/stop setpoints are already stored at the PLC instead of in the HMI. That's a great alternative.
 
I would put logic in the PLC instead of WW just because that would be more reliable.


The PLC has registers for the time values. Not sure what they are for AB...

Create 4 tagnames in WW: Start_Hr, Start_Min, Stop_Hr, Stop_Min

In the PLC, compare these values to the PLC clock to enable/disable your "System Ready" bit.
 
There are quite a few ways you can do this. I don't disagree with other members on just putting it into the PLC Logic instead of WonderWare, but if for some reason you cannot do that, you can absolutely do it quite easily in InTouch. InTouch has system tags that are "$Hour", "$Minute", and "$Second". In the touch links for any and all of your controls you can set a disabled condition to be from 4pm or whatever to 8 am, comparing to the "$Hour" tag. Doing this will make it so that during those hours, the button or whatever will be disabled and will not function. If you want it to be adjustable in runtime and not just in development, then instead of hard scripting in a value, compare the $Hour tag to a seperate tag that you define yourself.

Hopefully I was clear enough.
 
There are quite a few ways you can do this. I don't disagree with other members on just putting it into the PLC Logic instead of WonderWare, but if for some reason you cannot do that, you can absolutely do it quite easily in InTouch. InTouch has system tags that are "$Hour", "$Minute", and "$Second". In the touch links for any and all of your controls you can set a disabled condition to be from 4pm or whatever to 8 am, comparing to the "$Hour" tag. Doing this will make it so that during those hours, the button or whatever will be disabled and will not function. If you want it to be adjustable in runtime and not just in development, then instead of hard scripting in a value, compare the $Hour tag to a seperate tag that you define yourself.

Hopefully I was clear enough.


InTouch has both String (Message) and Integer system tags available for time and date data. It is easy enough to transfer the time as Integer data for comparisons in the PLC logic. You could also set the PLC clock(s) via an InTouch script.
 
Intouch has a demo application on Date and Time.
The app does all sorts of time and date calculations/conversions.
 
The easiest way I have done this, was by creating two integer inputs in hmi. As for the comparison, do this in plc, I have used a LIM instruction to set a enable bit. The input would be in 24hr format, also limit the input fields to 2359.
 
If they cannot handle 24hr format, you can add am/pm selector and use four inputs(starthour startminute stophour stopminute) and do math accordingly before compare.
 
Last edited:
This is a bit off-topic, but why would anyone use In-Touch with Rockwell systems as opposed to Rockwell HMIs? FactoryTalk View?
 
This is a bit off-topic, but why would anyone use In-Touch with Rockwell systems as opposed to Rockwell HMIs? FactoryTalk View?

Great question, and I'm not entirely sure about the answer; the design for this project was done before I worked here so I was not part of that process. The project in question is a modernization of a water treatment plant currently running Siemens P7 PLCs and InTouch for the HMI; maybe the customer requested Wonderware specifically? Our firm hasn't done AB work before so these are entirely uncharted waters; not sure what drove them to go with AB.
 
I think the better question is why not?

Because of support, different providers.
And because they don't integrate well. For example, an extremely powerful tool is being able to use structure tags in FactoryTalk View. Just recently, programmed conveyors and created an AOI for each conveyor that had identical stuff from the controls stand point. Then in the HMI program, I created just a single display with a parameter file with tags like these:

#1.Disconnect_On
#1.Faulted
#1.Running
#1.ClearFaults

And so on....

and then created simple parameter files where: #1 = Conveyor1 in one file
#1 = Conveyor2 in another file.

Huge time saver not having to make an individual display for each conveyor, and not having to retag all the animations and interfaces also.

So I never understood the concept of mixing various platforms and "making it work" --- what about the modularity factor? what about the maintainability? What about support? If using the Rockwell platform, then let your entire system be Rockwell. If Siemens, then let your entire system be Siemens.


But I suppose the integrator's job is to "make it work", really the end-user needs to be thinking about the things I mentioned.
 
Our firm hasn't done AB work before so these are entirely uncharted waters; not sure what drove them to go with AB.

Wow! Really? Hopefully you guys get some time to do some reading, learning, and tinkering. There are a lot of design considerations there in controllogix.
 

Similar Topics

Without RSLogix 500 Software and im unable to open this RSS file. Downloaded and installed the free version of RSLogix Micro from Rockwells...
Replies
2
Views
1,147
hello , it's my first post ,and I'm proud to be a part of an amazing community such as yours. so,currently I'm at the end of my training period...
Replies
9
Views
2,947
hi folks I did plc programming with other plcs but it is first time that i should program s-7 siemens for a project in cement factory Where can I...
Replies
2
Views
2,235
Hi - I'm a newbie to the PLC world but was recently asked if we could store more than the 2G that the CompactLogix 5370 allows by its max size SD...
Replies
13
Views
1,313
It's Saturday, so I thought it would be amusing to look at times gone by, imagine if you had to carry this to site "IBM 5mb Hard Disk 1950's.
Replies
16
Views
1,841
Back
Top Bottom