ayatec logo
Home Store Blog Contact
unicontrol user guide by ayatec
Home Store Blog Contact

Topics

  1. Welcome
  2. Getting started
    1. What is unicontrol
    2. How it works
    3. Connectivity
    4. Integration options
    5. Default hardware
    6. Hardware extensions
    7. Special sensors
    8. RGB driver
    9. Audio driver
    10. Network API - HTTP
    11. Network API - MQTT
    12. Network security
    13. Downloads
  3. Web Interface
    1. Processes
      1. Process
      2. Name
      3. Main state
      4. Initial state
      5. Display
      6. Constraints
        1. Process timer
        2. Variable contraints
        3. Force output
      7. Input
        1. Input source
        2. Channel
        3. Control period
        4. Value
        5. Publish
        6. Frequency
        7. Subtopic
      8. Events
        1. On/Off event
        2. Condition
        3. Idle/running time
        4. Delay on/off
        5. Fade in/out
        6. High/low input
        7. Mid point/Tolerance
        8. Out on when
      9. Output
        1. Primary output
        2. Action
        3. Type
        4. Invert
        5. Duty cycle
        6. Mem value
        7. High/low output
        8. Folder/Track
        9. RGB mode
        10. RGB color
        11. RGB brightness
        12. RGB speed
        13. Publish
        14. Subtopic
        15. Secondary outputs
      10. Cycle
        1. Cycles
        2. High/Low phase
      11. On/Off button
    2. Peripheral
      1. Hardware
      2. Type
      3. Calibration
      4. Mapping (edit)
      5. IR remote (edit)
      6. Impulse_counter (edit)
      7. RGB driver (edit)
      8. DS18B20 (edit)
    3. Device
    4. Network
    5. System
    6. License
  4. Tutorials
    1. First boot
    2. First process
    3. Connect to MQTT
    4. Process sequencing

    5. DIY Project: Bath Fan

In this article

  • Introduction
advert
unicontrol > Tutorials > Process sequencing

Process sequencing

Sequencing

Although the Secondary outputs primarily enable the user to control multiple Outputs simultaneously by linking other Processes and controlling their Outputs, when combined with the Timeout Off event, they can be leveraged to effectively support user-defined output sequences.

The fundamental concept of sequencing is that each step in the sequence is represented by a single Process. Each of the defined processes remains active for a specified Timeout duration, after which it automatically initiates the subsequent Process in the series. For this mechanism to function properly, each of them must have:

  • The Process representing the immediately following step in the sequence selected as one of the Secondary outputs with an Off -> On Response. This ensures immediate initiation of the following step once the preceding step ends. Naturally, this does not apply to the last step of the non-repeating sequence.
  • A non-zero Running time set for the Timeout, selected as an Off event. This defines the length of each individual step in the sequence.
  • An empty On event, to ensure the smooth progression of the sequence without disruption.
The Secondary outputs are activated only when they are directly invoked and do not respond if the calling process itself is triggered as a Secondary outputs of another Process. For more information, follow here...

To illustrate, let us use a 4-channel relay module, where Relays 1-4 are connected to pins D0, D5, D6, and D7, respectively. These are tasked with controlling a prefabricated light board as follows:

Light array to be used for the sequencing

Sequence start

Start by choosing four Processes and Naming them Seq_1, Seq_2, Seq_3, and Seq_4, respectively. Starting from the default setting, configure all four identically with the following parameters:

  • Main state: Auto
  • Off event: Timeout
  • Running time: 1 sec

These settings will ensure that the designated Relays automatically turn OFF one second after being activated. However, turning ON of these processes must be controlled externally, as they will not initiate on their own.

Next, define the first step of the sequence, which involves flashing the first light (Relay 1 connected to D0). To do this, navigate to the Seq_1 process and set its Primary output to D0 (Relay 1). Finally, click ON within the same process' Output section to initiate the sequence:

Your browser does not support HTML video.
A single-step sequence.

Next steps

While you are still in the Seq_1 process, select Seq_2 as the Secondary output with the Off -> On Response. Now, go to the Seq_2 process and choose D5 (Relay 2) as the Primary output. Back in the Seq_1, press ON again.

Your browser does not support HTML video.
A two-step sequence.

This time, dimming the first light automatically turns ON the second light. Proceed by completing the sequence with all four lights by filling in:

Process Primary output Secondary output
Seq_1D0Seq_2, Off -> On
Seq_2D5Seq_3, Off -> On
Seq_3D6Seq_4, Off -> On
Seq_4D7-

In the Seq_1, press ON:

Your browser does not support HTML video.
Completed sequence.

For an additional exercise, you can rearrange the sequence according to the table provided below and start the sequence once more:

Process Secondary output
Seq_1Seq_3
Seq_2Seq_4
Seq_3Seq_2
Your browser does not support HTML video.
Rearranged sequence.

Closing the loop

At this point, you can create a loop by choosing Seq_1 as the Secondary output with an Off -> On Response in the Seq_4 process. When all steps are completed, this setup will cause the sequence to revert back to the first process and start over.

With this configuration, the sequence can be initiated from any process within the sequence. The sequence will continue from that step and will then proceed to loop indefinitely.
Your browser does not support HTML video.
A looped sequence.
The sequence is virtual, composed of a predefined set of rules. Once it is running, there is nothing preventing you from initiating it again at a different step. The following sequence is identical to the above video, however, while the sequence was in progress, it was started again:
Your browser does not support HTML video.
Sequence running in two different waves.

Adding pauses

Until now, the lights have been operating in immediate succession with no pauses in between. To introduce pauses, you'll need to create four additional Processes. Name these new Processes Seq_1p, Seq_2p, Seq_3p, and Seq_4p, respectively, and set them up as follows:

  • Main state: Auto
  • Off event: Timeout
  • Running time: 0.5 sec
No output is needed for the pause Processes.

Now, rearrange the Secondary outputs according to the table below:

Process Primary output Secondary output
Seq_1D0Seq_1p, Off -> On
Seq_1p-Seq_2, Off -> On
Seq_2D5Seq_2p, Off -> On
Seq_2p-Seq_3, Off -> On
Seq_3D6Seq_3p, Off -> On
Seq_3p-Seq_4, Off -> On
Seq_4D7Seq_4p, Off -> On
Seq_4p-Seq_1, Off -> On

Result is visible on the video below:

Your browser does not support HTML video.
Sequence with pauses.
© 2024 ayatec.eu • Found a mistake?  Let us know!