ZEN V2: sequential reuse of output bits ?

MJG

Member
Join Date
Aug 2014
Location
Dunedin
Posts
19
Hi,

I am new here and would like to ask for help on how I might go about re-using previously used CPU unit output bits in my ladder program?

Basically, I have three relays I need to activate in sequence, i.e.:

WHERE

I0 = ON (for any length of time)

Q0 ON for 3 sec, then OFF​
Q1 ON for 1 sec, then OFF​
Q2 ON for 1.5 sec, then OFF​

Q0 ON for 4 sec, then OFF​
Q1 ON for 1 sec, then OFF​
Q2 ON for 1.5 sec, then OFF​

Q0 ON for 3 sec, then OFF​
Q1 ON for 1 sec, then OFF​
Q2 ON for 1.5 sec, then OFF​

Q0 ON for 4 sec, then OFF​
Q1 ON for 1 sec, then OFF​
Q2 ON for 1.5 sec, then OFF​

END

I have the sequential activation down already, but I cannot figure out how to re-activate Q0-Q2

Here's what my ladder program looks like so far:

I0
[N.O.]-------------[M0
M0
[N.O.]-------------TT0
T0
[N.O.]-------------[Q0
P0
[N.O.]-------------TT1
T1
[N.O.]-------------[Q1
P1
[N.O.]-------------[TT2
T2
[N.O.]-------------[Q2
P2
[N.O.]-------------[Q0

This is as far as I have got. When I run this program, Q0 is NOT activated in at line 2; it will ONLY activate at the last line.

I would really appreciate any advice & help anyone can offer. I have spent 10+ hours now learning how to use the ZEN and get this program up and running!

Thanks in advance!
 
Last edited:
i0
[n.o.]-------------[m0
m0
[n.o.]-------------tt0
t0
[n.o.]-------------[q0
p0
[n.o.]-------------tt1
t1
[n.o.]-------------[q1
p1
[n.o.]-------------[tt2
t2
[n.o.]-------------[q2
p2
[n.o.]-------------[q0


p2
[n.o.]-------------[q0
t0 |
[n.o.]--|



I'm not familiar with the ZEN platform at all, so I can't help with specifics. Something like the above might be a start. If you write the the output in multiple places, then the last one wins. You should only use one per output. If you combine them in an OR, then the output turns on if either one is on.

However, this makes it slightly more complicated to program your sequence. What I often do is use an integer to store what step i'm on, and then base my control on that.
 
Thanks mk42!

I tried OR statements in a slightly different configuration and it seems to have worked. It might be a little clumsy & inelegant, but here's what I did for P2 onward:

P2
[n.o.]------------TT3
T3
[n.o.]------------[Q0
T0---|
P3
[n.o.]------------TT4
T4
[n.o.]------------[Q1
T1---|
P4
[n.o.]------------TT5
T5
[n.o.]------------[Q2
T2---|

So that's essentially the second set of repeated outputs taken care of. I'm experimenting now with sets 3-4 and have had success, but only if I make a new set of timers and include two OR statements for each.

If anyone has a more elegant suggestion I love to hear it!

Thanks!
 
Last edited:
program 6 unit timer

3 unit timer for 1st block

and

3 unit timer for 2nd block

after 1st block timer complete

program M0 (SET)

and reset M0 (RESEST)

by 2nd block timer the last timer

2 block timer will share to output

and make interlock
 
Hi, thanks osmanmom - I'm not quite sure what you mean by "3 unit timer"?

In the Zen manual (pp. 74-75) it lists:

- ON delay timer
- OFF delay timer
- One-shot pulse timer
- Flashing pulse timer
- Twin timer
- ON delay holding timer

Which of these did you mean?
 
I should have mentioned that the solution depends on recognizing that there are basically two identical 12-second sequences. So one 12-second timer, run 2 times, solves the problem.

My program cycles continusouly until the switch is turned off, but it could be stopped after any number of cycles by making a small addition.
 
This looks very elegant Lancie1 - thanks so much for putting the time in to create the ladder diagram.

I should have clarified above, my I0 switch is a N.O. spring-loaded switch, i.e., for discrete not continuous switching. As soon I take my finger off it, it returns to an open state. I'm really just planning on using it to get the sequence started and have the program terminate at the 4th iteration of Q2.

Also did I understand you correctly - you are suggesting two identical 12 second timers for two repeats each of Ttotal=5.5 sec & Ttotal=6.5 sec?

Set 1 = 5.5 sec
Set 2 = 6.5 sec (Q0 is 1 sec longer)
Set 3 = same as Set 1
Set 4 = same as Set 2
 
I'm really just planning on using it to get the sequence started and have the program terminate at the 4th iteration of Q2.
Then all you have to add to the program is an internal "System RUN" relay, that seals itself ON when the Start button is pressed.

Also did I understand you correctly - you are suggesting two identical 12 second timers for two repeats each of Ttotal=5.5 sec & Ttotal=6.5 sec?
No what I meant is that your sequences are really 2 repeating steps. You can see that if you write them like this in a table:
 
Q0 Q1 Q2
3 1 1.5 } Step 1, total 12 seconds
4 1 1.5 }
3 1 1.5 } Step 2 repeats Step 1
4 1 1.5 }


Those two 12-second steps are built into my program, using one 12-second timer that repeats itself 2 times for each cycle. All you need to add is a way to stop it. I would add a Counter, and Count Q2 going ON to OFF, and when Counter C0 = 4, break the "System Run" relay circuit.

I can make those fixes if it will help you.
 
Last edited:
The OP request 2nd Output timer low then 1st Output Timer from original post.
That is not what I read. Yes, you could use 2 timers, but the problem is that the ZEN is a limited smart relay. It only has 15 comparison bits, P0 to Pf. I used 12 of those, up to "Pc". If you used 2 timers, you would need 11 more P bits, and they are not available in the ZEN. So the 1-timer solution fits the available equipment better than the 2-timer solution.

Here is Revision 1, with the Run Relay, and the Counter to stop the sytem after Q2 has operated 4 times (which means the counter only counts to 2 (2 cycles x 2 steps each cycle = 4 times for each Output). I ran it in the ZEM Simulator, and it works as intended, making all Outputs Q0 to Q2 go ON/OFF 4 times, then stopping.
 
Last edited:
Very nice Lancie1 - it took me a while to understand it but I think I have it figured now :)

My solution ended up using 10 timers and 10 comparators. Your's is much simpler, so I'll use yours.

One more thing, if I wanted to introduce a N.O. cut out switch for Q2 could I just insert in line 18 of your program a N.O. I1 relay?

Just to explain that a little more, Q2 drives a SSR that in turn activates a low speed DC motor. I thought I could control each 360 degree rotation by timing the Q2 output (1.5 sec). This works OK up until about the 30th program iteration but then I get noticeable off-position spindle inaccuracy. So, my new plan is to fit a lobe to the spindle shaft that touches a switch, closing it and activating I1.

I'm not sure what I have below would work, i.e., proceed if M0 is ON, OR I1 is OFF?

M0...............P8.................P9.................Q2
[n.o.]-------[n.o.]---------[n.o.]---------[Q2
I1...........|
[n.o.]-----
 
One more thing, if I wanted to introduce a N.O. cut out switch for Q2 could I just insert in line 18 of your program a N.O. I1 relay?

Yes, no problems with that, except make it a NC instruction, and you don't have space for another in series.

ZEN only has 3 Input-type spaces. In which case you have to make do without the M0, and substitute a NC I1 in its place, as shown in the attached picture.

This works OK up until about the 30th program iteration but then I get noticeable off-position spindle inaccuracy.
Could the inaccuracy be caused by the "P" comparison overlaps? For each one, the previous "Q" will still be ON when the next one also goes ON. Normally this small overlap would not matter, but in your case where you need extreme accuracy, you may want to stagger the P values so there is no overlapping ON times from Q0 to Q1, and Q1 to Q2. For example, for Q0, P1 keeps Q0 ON up to and while T1 = 3 seconds. But P4 turns Q1 at T1 = 3 seconds also. For 0.01 seconds Q0 and Q1 are both ON. To prevent this, you could set P4 to "T1 >= 3.01" seconds. If you do all the other "P" bits similarly, then it seems that your timing accuracy should be improved slightly.

Sequential Outputs- MJG Shaft Switch.JPG
 
Last edited:
Suppose you get to the point where you need to change 1 of the 12 timer settings, but with only 2 timers, you really cannot do that?

Here is a way to do it so all 12 time settings have their own timer. With this method, you don't need any P comparison bits. There are only 8 regular timers, but you can use the 4 Holding Timers. You just have to reset them after each cycle. Becaue of the I1 Shaft Switch for Q2, the system runs 1 cycle more than the Counter setting, so if you want 2 complete cycles, set it for 1. If you want 3, set the counter for 2, and so on.
 

Similar Topics

My PLC is currently running the program and the process is still live. One of my 1769-if16C cards values are all frozen but the card is not...
Replies
1
Views
122
When E300 powered off, the ethernet device tag data stayed at last know state, for example, fault bit is still Off, ready bit is still ON, status...
Replies
8
Views
1,003
This hasn't become my problem yet, but it may soon... Ancient PLC-3 (yeah, I know) has been humming along for decades. It now has some analog...
Replies
5
Views
2,451
I need to print data produced by the program PLC (Beckhoff PLC) from a Citizen PMU 2300 printer. More precisely I need to send the data to the...
Replies
9
Views
3,992
I am very new so I will try to give as much information as possible. I cannot get a Prolific PL-2303TA USB to RS232 to connect to an Omron ZEN...
Replies
1
Views
1,587
Back
Top Bottom