Jump to content

Multiple outputs with delay


kpetro07

Recommended Posts

Hello All,

Can someone help to build a simple program for switching multiple outputs with delay ?

Condition is:

Input ON, Output 1 ON then delay XX seconds Output 2 ON, and .... delay XX seconds Output X ON.

Input OFF, Output 1 OFF then delay XX seconds Output 2 OFF, and .... delay XX seconds Output X OFF.

 

thanks in advance.

Link to comment
Share on other sites

  • MVP 2023

Is the delay between Outputs always the same?  What is the maximum value for X?

I would use a combination of a timer incrementing a pointer and a Set Bit block to tick the bits on in an integer tag or array, and then do a Num to Bits function to transpose the number to the outputs in bit form.  You could reverse the operation using the Reset Bit block to turn them off.

This method is above beginner level - what is your experience with manipulating bits in integer arrays?

Joe t.

Link to comment
Share on other sites

12 hours ago, Joe Tauser said:

Is the delay between Outputs always the same?  What is the maximum value for X?

I would use a combination of a timer incrementing a pointer and a Set Bit block to tick the bits on in an integer tag or array, and then do a Num to Bits function to transpose the number to the outputs in bit form.  You could reverse the operation using the Reset Bit block to turn them off.

This method is above beginner level - what is your experience with manipulating bits in integer arrays?

Joe t.

WeI do not have any experience with bits in integer arrays so we have done it as attached.... 

delay on.JPG

Link to comment
Share on other sites

  • MVP 2023

For a less sophisticated version of what Joe is talking about, forget the word "timers" completely.  I think him saying  "combination of a timer incrementing a pointer" is essentially referring to what I call a counter being incremented by 1 every time cycle.  I often mention that in many instances counter based systems are the much forgotten/ignored method that is a much better solution than a combination of timers, due to their simplicity of making outputs do whatever you want at a certain time......but for "time" read "a section of the count".

For the less sophisticated method, use compares that set your outputs on when they fall in range on the numbers coming up as the counter is running.  Once everything is on, stop the counter at that point but don't reset it.  To shut down, start the counter again and the outputs are shut down progressively as the compares do their stuff.  Once everything is finished, you stop the counter and reset it either at the stop or the next start signal.

Accuracy needed dictates what you use as your timer that increments the counter.

cheers, Aus

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.