Need help with designing some logic

sparkytex

Lifetime Supporting Member
Join Date
Jun 2013
Location
Port Hardy B.C.
Posts
354
hello again,

lets disregard that last thread I posted about the Panel Builder 1200. What I really need help with is some logic design. Here's what's going on, Our bleach Screen room has a "dump flush cycle" 1-2 times per 12 hour shift initiated by the operator on the HMI with the "Dump" button icon. They keep log of the times of the last 4 dump flush's which they take off of the HMI indication. Since the HMI is an old Panel view 1200 and I'm replacing it with a touchscreen and Wonderware I need to mimic this. Here's what I need to do:

I need to create logic to Keep track of the times of the last 4 dump flush cycles and display it onto Wonderware in real time. The old display looked like this

1.) Last dump cycle - 7:30
2.) 2nd Last dump cycle - 18:06
3.) 3rd Last dump cycle - 12:01
4.) 4th Last dump cycle - 17:44

it constantly cycles down the integer value from "Last" to "4th Last" every time you press the "dump" button. I tried doing this with a FFL-FIFO but just couldn't quite figure it out. I'd be much appreciated if one of the Wiz's on this site could help me design this for RSLogix 5.

Thanks, Tex
 
(edited for PLC/5)

Use the COP instruction.

Arrange your four times so they are in sequential order in a file with the oldest first and the newest last.

So if the hours are stored at N7:56 to N7:59, then when you have a flush, use
COP #N7:57 #N7:56 3
This will copy N7:57 down to N7:56,
then copy N7:58 down to N7:57,
then N7:59 down to N7:58.
Now you can store the newest data at N7:59.

You have to copy down, not up. If you copy up you will end up overwriting the data you are going to shift next and your array just ends up with all elements containing the same number.

When you display them on the HMI arrange the tags to display the values in the desired order

In the attached image, flush hours are stored N7:57 (oldest) through N7:59 (newest), and flush minutes are stored N7:60 (oldest) through N7:63 (newest).

I don't show it in the image, but you need a oneshot (ONS) instruction or similar logic to make sure this only executes once per flush.

tc06121402.jpg
 
Last edited:
Thanks a lot that works awesome, exactly what I wanted to accomplish. Another question for you, how do I go about getting real time into Array #3 for my HMI indication. I know there's status "S" files you can use in the PLC for real time but I'm not sure which ones. What I would like is once that "dump" button is pressed it triggers a CPT function that computes the real time then stores it into an address which would be the array#3 address, this make any sense?

***edit

S:22 - is for minutes?
S:21 - is for hours in military time?
 
Last edited:
Yes, in the PLC/5 S:21 and S:22 are the address for hours and minutes. This method is dependent on the PLC being set with the correct time. If you use a different time source then adjust accordingly.

On keeping the PLC/5 time set correctly:
A couple of options.
1) You can have an event in the HMI software trigger the PLC to reset the time. Say everyday at midnight the HMI software triggers a bit in the PLC and the PLC program sets hours, minutes, and seconds to 0.
2) You can have the HMI software continually write the time to another set of registers in an N file and use those registers as your time reference.
 
Last edited:

Similar Topics

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...
Replies
11
Views
342
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
169
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
70
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
319
Back
Top Bottom