In Grenton system, controlling the roller shutters takes place through controlling the time of switching on the roller. On the basis of the time of switching on, you can calculate and impose defined roller position. To control the rollers with the use of Slider, follow the below steps:


To realize the below functionality you will need:

  • CLU central unit
  • Roller Shutter module
  • mobile device with Home Manager application installed
  • the environment for creating the system logic - Object Manager


Realization of the aforementioned functionality will require the creation of:

  • a script
  • virtual object - Timer
  • mobile application interface
  • global variables


The configuration of CLU central unit

  1. Double click on the CLU icon to enter the module settings
  2. Go to "User features" tab and create four global variables of number type essential to create the correct realization of the functionality. For the needs of the project, they have the following names:

    • current_position – actual, imposed roller position
    • previous_position – roller position from the previous iteration,
    • cycle_time - the time of full opening/closing of the roller,
    • time - the time of a drive used at the time of logic work

    (Click to zoom in)


    ATTENTION! For different roller drives, the total time of full closing/opening (cycle time) can vary. Before typing the value, familiarize with the producer’s technical documentation or measure it by yourself.

  3. After creating the script (see the next paragraph), go to the "Events" tab and add two actions to OnInit event:
    • Launching the timer to download the values of the slider
    • Setting the roller in a full openness (calibration while launching or after the power drop in the system). It is also allowed that the initial point was the full closing of the window.

(Click to zoom in)



                    The event window after performing configuration should look as below:


(Click to zoom in)



        ATTENTION! The drive applied in the roller blinds must be equipped in limit switches. In another case, the drive may be damaged.


        4. Click OK to accept the changes


Logic configuration

  1. Create a work managing script. In the discussed case, we name it "roller_shutter"

    (Click to zoom in)


  2. Create a script realizing the logic of system by the use of Components tank on the right side of the Object Manager software window. You can find the information on how to create scripts in Grenton system HERE. The connections and logic conditions between created function blocks should look like as shown on the below scheme:


(Click to zoom in)



Below there is a full list of the components and the procedure of creating them.

  • Condition > ROLLER_SHUTTER >Embedded Features: State > Logic Condition"==" > Value: Stop
        The drive will not be switched on until the previously set position is not reached.

(Click to zoom in)



  • Condition > CLU > Defined Features: current_position > Logic Condition: "~=" > Value: Features > CLU > Embedded Features: previous_position
        Checking if the slider was moved, actual roller shutter position is the same as previously


(Click to zoom in)



  • Operations on variables > time > "=" > Feature > CLU > Embedded Feature: current_position
        Assigning the variable time the value of the actual roller shutter position

(Click to zoom in)



  • Operations on variables > time > "-=" > Features > CLU > Embedded Feature: previous_position
        Calculation of the difference of the remote and current position of the roller shutter

(Click to zoom in)



  • Operations on variables > time > "/=" > Value: 100
        Calculating the percentage value of roller shutter openness

(Click to zoom in)



  • Operations on variables > time > "*=" > Features > CLU > Embedded Features: cycle_time
        Calculating the time of switching the output necessary to achieve the preset roller shutter position

(Click to zoom in)



  • Condition > CLU > Defined Features: current_position >  ">" > Value: Features > CLU > Embedded Features: previous_position
        Checking if the roller shutter is to move upwards or downwards

(Click to zoom in)



  • Action > ROLLER_SHUTTER > Mehod: Up(Time) > Parameters: Time > Value: Features > CLU > Embedded Features: time
        Drive of the roller shutter upwards accordingly to specified time of switching output

(Click to zoom in)



  • Operations on variables > previous_position > "=" > Features > CLU > Embedded Features: current_position
        Rewriting the set value of the location is current.

(Click to zoom in)



  • Operations on variables > time > "*=" > Value: -1 > CLU
        Calculating the value of setting time to value being in the field of positive numbers

(Click to zoom in)



  • Action > ROLLER_SHUTTER > Method: Down(Time) > Parameters: Time > Value: Features > CLU > Embedded Features: time
        Drive downwards accordingly to set time of output switching.

(Click to zoom in)



  • Operations on variables > previous_position > "=" > Features > CLU > Embedded Features: current_position
        Rewriting the set value of location as current

            

(Click to zoom in)




 The above logic in text mode is as follows:

if(CLU->ROLLER_SHUTTER->State==0) then
if(CLU->current_position~=CLU->previous_position) then
CLU->time=CLU->current_position
CLU->time=CLU->time-CLU->previous_position
CLU->time=CLU->time/100
CLU->time=CLU->time*CLU->cycle_time
if(CLU->current_position>CLU->previous_position) then
CLU->ROLLER_SHUTTER->Up(CLU->time)
CLU->previous_position=CLU->current_position
else
CLU->time=CLU->time*-1
CLU->ROLLER_SHUTTER->Down(CLU->time)
CLU->previous_position=CLU->current_position
end
end
end


Virtual object TIMER

  1. Click on the clock symbol to go to virtual object creation window

    (Click to zoom in)



  2. From the drop-down list choose "Timer" position. This object will be used to check if the value of slider has changed.

    (Click to zoom in)



  3. Go to "Embedded features" tab, set Mode feature into Interval mode and type the value of Time feature – the frequency with which the slider value of the mobile application will be checked.

    (Click to zoom in)



  4. Go to the “Events” tab, add to the OnTimer event, the created roller_shutter script.

    (Click to zoom in)



  5. Confirm changes with OK button


Mobile application interface


        1. Place Slider Component on one of your mobile application interface’s sides



(Click to zoom in)



        2. Double click on the placed object to go to its settings and go to "Embedded features" tab. Type the parameters of the object as follows:

  • Min value – 0.0 – the beginning of the scope of the values adopted by the slider
  • Max value the end of the scope of the values adopted by the slider (the choice of a number from the scope of 0-100 will let to interpret graphically the percentage closing of roller shutter)
  • Text - $value$ - displaying set value of roller shutter position


(Click to zoom in)



        3. Next go to the "Events" tab, in which assign the command to ONSLIDE event which reassigns the value of the slider object to the value of defined feature current_position.



        4. After accepting the changes the window should look as below:

(Click to zoom in)


            5. To secure the logic from entering decimal values of a millisecond, which are misinterpreted by the performative modules, use LUA function, which up rounds the numbers math.ceil() applying it for $value$ argument


The field "Assigned commands" will look as follows:


(Click to zoom in)



            6. Confirm with OK button



Sending the configuration to the system


            1. After typing all changes sent CLU configuration with the use of the below button on the toolbar:


            2. Send the interface to mobile application Grenton Home Manager. To do this, mark the mobile interface on which there is a slider, and press the below button on tool bad and follow the instructions displayed on the screen.