Omron ZEN

Hello, I am new to the topic of PLC programming, but I'm trying to learn. I have already made some simple apps that are working perfectly, but I've got stuck on one thing and I'm looking for someone who could perhaps help me solve this problem. What I've been trying to do is to make a car wash. The car wash works 24/7, but from 6am to 8pm after inserting one coin you get 30 seconds of working time and from 8pm to 6am you get 60 seconds. The amount of coins you can insert is unlimited (9999 as this is the limit of the counter in ZEN) and after inserting coins you get to choose a washing mode whether water or foam. And this is where the problem begins. I do not know if it is possible in ZEN to proportionally increase the time on the timer depending on the value on the counter, because my program works just for one coin only. Additionally, even if I don't insert any coins I can still choose the washing mode and still get as much working time as I would get after inserting one coin. Is it possible to solve it somehow?
 

Attachments

  • ZEN 1.png
    ZEN 1.png
    89.7 KB · Views: 18
  • ZEN 2.png
    ZEN 2.png
    61.2 KB · Views: 18
  • ZEN 3.png
    ZEN 3.png
    39.1 KB · Views: 17
I wonder if it is possible to specify an integer variable as the preset of a timer.

If not, you could have two timers: one timer with a fixed 30s preset is active 6am-8pm; another timer with a 60s preset is active 8pm-6am. Then, assuming these are TONs, the code
  • either the code will
    • OR (put in parallel) the timers together to detect when the active timer has expired,
      • the inactive timer's expired flag will never be 1, so only the active timer's expired flag will contribute to the result
  • or the code will
    • (NOT daytimer AND NOT nighttimer) (inverse of OR; see De Morgan's Laws) the timers together to detect when the current timer has not expired.
      • the inactive timer's expired flag will always be 0, so only the active timer's expired flag will contribute to the result
There will be an edge case if an operation crosses the 6am or 8pm boundaries, but that can be handled.

[Updated: corrected logic; added more detail)
 

Similar Topics

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...
1
Replies
2,409
Views
Hi, after 30 years involved with automation I'm actually writing my first PLC program and am struggling a fair bit. My background is mechanical...
8
Replies
3,111
Views
Hi I am setting a system up as per the attached picture, 5 inputs that are always present. These are sensors I have in an injection mould, if...
5
Replies
2,659
Views
Hello all, new on here, and relatively new to plc programming. I am trying to write a program which counts as it receives a cycle end input, and...
4
Replies
2,756
Views
I am trying to write a program for a omron zen plc. 1st light on for 30 sec 2nd light on for 12 sec 3rd light on for 3 sec then start all over...
1
Replies
1,717
Views
Top