PDA

View Full Version : [LOGIC] Up -Down Counter



null null
11-13-2004, 05:25 PM
Hi Enrico
Is there a UP-Down Counter for the [logic] section

This counter would be event driven.

If cutoff1 > 0 then counter (0 to 100)
ValveTransitEng1 = 1
else
ValveTransitEng1 = 0
endif

This counter would count up from 0 to 100 as long as cutoff1 > 0,
While it is counting the event would be true, and when it reached the
final value it would turn false.

If the state of cutoff1 > 0 became false and the counter had not
reached 100, it would start counting back down to 0 from the number it
reached when the state of cutoff1 > 0

So if had counted to 50 and there was the change of state it would
count down from 50 to 0 and then it would turn false. In this example
the total time 0 to 50 to 0 would be equal to a uninterrupted count
from 0 to 100

David

Enrico Schiratti
11-24-2004, 06:11 AM
Hi,

how is this not possible with existing tools? (if I understood)

if cutoff1 > 0 then
if valvemovecounter
else
if valvemovecounter > 0 then valvemovecounter = valvemovecounter - 1
endif

then check on valvemovecounter?

or even better (using a delay of 15 seconds)

if cutoff1 change
if ValveTransitEng1 = 0
ValveTransitEng1 = 1 [15]
else
ValveTransitEng1 = 0 [15]
endif
endif

Ciao

Enrico

"David Allen" wrote in message
news:269490.53489@wb.onvix.com...
> Hi Enrico
> Is there a UP-Down Counter for the [logic] section
>
> This counter would be event driven.
>
> If cutoff1 > 0 then counter (0 to 100)
> ValveTransitEng1 = 1
> else
> ValveTransitEng1 = 0
> endif
>
> This counter would count up from 0 to 100 as long as cutoff1 > 0,
> While it is counting the event would be true, and when it reached the
> final value it would turn false.
>
> If the state of cutoff1 > 0 became false and the counter had not
> reached 100, it would start counting back down to 0 from the number it
> reached when the state of cutoff1 > 0
>
> So if had counted to 50 and there was the change of state it would
> count down from 50 to 0 and then it would turn false. In this example
> the total time 0 to 50 to 0 would be equal to a uninterrupted count
> from 0 to 100
>
> David
>

null null
11-24-2004, 03:23 PM
On Wed, 24 Nov 2004 05:11:08 EST, Enrico
Schiratti wrote:

Small Cut

>or even better (using a delay of 15 seconds)
>
>if cutoff1 change
> if ValveTransitEng1 = 0
> ValveTransitEng1 = 1 [15]
> else
> ValveTransitEng1 = 0 [15]
> endif
>endif

I could not get this to work :-(

Maybe a better explanation:

A young man and his new bride live within a 10 minute walk of the a
Ferrari sales office. He decides to walk to the sales office to
purchase a used F-355 Spider, half way to the sales office he realizes
he has forgotten his PM checkbook, and heads back home. He has been
gone from home a total of 10 minutes. He is greeted by his lovely wife
who wipers in his ear that she would like to become pregnant. 2 hours
later that day he sets off again with his checkbook for the Ferrari
sales office. After walking 2 minutes he realizes that he has no pants
on and walks back home. The total elapsed time is 4 minutes. He is
again greeted by his lovely wife who wipers in his ear they should try
again. The next day he again sets off to the Ferrari sales office, he
arrives at the sales office in 10 minutes. He purchases the car and
drives away. Fifteen years later his son ponders what happened along
that 10 minute walk to Ferrari sales office. The now older man returns
to the Ferrari sales office and sells the high mileage F-355 and walks
the 10 minutes home. He is greeted by his lovely wife, and she wipers
in his ear. "The walk to and from Ferrari sales office was only 20
minuets my love, a lot has changed in 16 years."

Thanks

David