Page 1 of 1

Loop Control Help!

Posted: Mon May 19, 2014 9:01 am
by sabretooth4
Hello All,

I need some help please :)

I have a complex programme running through a MIAC which controls an inverter via the outputs, so i have specific commands eg output 1 = on for 30 s and then output 2 on for 10s

The problem i have is controlling the relay, i want to have the relay on but once the input is activated turn the relay off and as soon as the input drops then the relay to come back on instantly without having to wait for the loop top start again.

Can any one help please??

Thanks :)

Re: Loop Control Help!

Posted: Mon May 19, 2014 11:37 am
by LeighM
One way around this is to avoid long delays.
Rather than waiting in a delay, keep going round the loop.

So in the case of a 10 second delay, have say a 10mS delay in the loop, but count the number of times round the loop.
When the counter gets to 1000 the 10 seconds will have elapsed so activate the relay.

This does mean that in the meantime, whilst in the loop, you can check other inputs, change status variables, reduce or increase the delay time, etc

Leigh