d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Abel Programming > Need A Little Help
Add Reply New Topic New Poll
Member
Posts: 3,830
Joined: Nov 25 2008
Gold: 3.02
Oct 30 2013 07:40am
Hello everyone,
I am programming a GAL16V8B and I ran into a little speed bump. I have most of my logic how I am wanting, and I tested to make sure it is all working, which it is. I am stumped on one part of my logic though. I am wanting to automatically either fill or empty a jug of water.

I have 2 sensors, one at the bottom of my tank, and one at the top. When the level reaches the top, I am wanting to have my pump suck out the water until it reaches the bottom and turns off. I am then wanting it to wait until it is full again to turn back on the pump

Here is my logic for when the pump is sucking out the water (Low/High)

[0,0] > 0
[0,1] > 1
[1,0] > 1
[1,1] > 1

Here is my logic for when the pump is waiting to suck out the water (Low/High)

[0,0] > 0
[0,1] > 0
[1,0] > 0
[1,1] > 1

Both 0,0 and 1,1 have the same logic in both statements, but what I am looking for is something that ignores the middle 2 statements until it reaches the conditions. I tried this, but it is simply placing a 0 rather than ignoring:

[0,0] > 0
[0,1] > .X.
[1,0] > .X.
[1,1] > 1

Any suggestions?
Member
Posts: 3,830
Joined: Nov 25 2008
Gold: 3.02
Oct 30 2013 08:21am
I was thinking about using an When-Then-Else statement, but I am unsure if this is the thing to use, let alone the proper syntax:

WHEN ( A & B ) THEN A # B;


ELSE WHEN ( !A & !B ) THEN A & B;

This post was edited by Xenial on Oct 30 2013 08:21am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll