21 - 02 - 2019

Timers library

Block DayOfWeek

License: Hobby, Industrial

This block has a digital output for every day of week. For example, the output Monday gets high level every Monday, between 0.0h and 23.59h. The output WorkDay is at high level for days between Monday and Friday, output WeekEnd is at high level at Saturday and Sunday. The block has no parameters.

 

Block TimeInterval

License: Hobby, Industrial

Describes the time interval in which the output to be at high level.

Parameters:

  • OnOffInterval – describes the time interval. ON and OFF times are separated by the symbol ; If we want to describe more groups with ON/OFF times, they must be separated by the symbol & 

Examples:

8:20;16:10 - output will be at high level the in period 8.20 h to 16.10h every day;

22:00;6:00 - output will be at high level in period 22.00h of the first day until 6.00 h on the next day. This will happen every day;

7:20;9:00&11:10;12:10&17:00;19:00 - three groups of times are described, first group: 7:20;9:00, second group: 11:10;12:10, third group: 17:00;19:00. Separator between time groups is &

 

Block TimeOut

License: Hobby, Industrial

The block is widely used in charts when a digital signal needs to be delayed or to turn on a device for a certain time.

Block's parameters:

  • TypeTimeOut - may has the next values: Seconds, Minutes, Hours. Describes the type of a parameter TimeOut;
  • TimeOut - determines how long the OnOfff output of the block will be at a high level;

Block's inputs:

  • Start - when the inputs becomes at a high level, the block's output OnOff becomes at a high level for a time period described with parameters TypeTimeOut, TimeOut;
  • Stop - Resets the output OnOff before the TimeOut period expires;

Block's outputs:

  • OnOff - when running the TimeOut process, it becomes to a high level for the time described with the parameters TypeTimeOut, TimeOut;
  • OnEndTimeOut - becomes to high level for short time, when the TimeOut period expired and the output OnOff becomes to a low level;
     

Block TimeOutExt

License: Hobby, Industrial

The block is similar to the Timetable block, but has extended features.

Block's parameters:

  • TypeTimeOut - may has the next values: Seconds, Minutes, Hours. Describes the type of a parameter TimeOut;
  • TimeOut - determines how long the OnOfff output of the block will be at a high level;

 

Block's inputs:

  • Start - when the inputs becomes at a high level, the block's output OnOff becomes at a high level for a time period described with parameters TypeTimeOut, TimeOut;
  • Stop - Resets the output OnOff before the TimeOut period expires;
  • Pause - When the block is in timeout process, it can be suspended with a high level of an input Pause;
  • SetTimeOut - When the input becomes to high level, the parameter TimeOut will get a value of the input InTimeOut;
  • InTimeOut - works together with the input SetTimeOut;

Block's outputs:

  • OnOff - when running the TimeOut process, it becomes to a high level for the time described with the parameters TypeTimeOut, TimeOut;
  • OnEndTimeOut - becomes to high level for short time, when the TimeOut period expired and the output OnOff becomes to a low level;
  • Elapsed - when the block is in TimeOut process, the output shows the elapsed time from the beginning of the TimeOut;
  • Remaining - when the block is in TimeOut process, the output shows the remaining time to the end of the TimeOut;

 

Block DelaySignal

License: Hobby, Industrial

The block allows the input digital signal In to be delayed. The delay duration is specified in the parameter TimeOut. Time can be seconds, minutes, hours, determined by the parameter TypeTimeOut. TypeDelay parameter defines the front of the delay. Can be rising front - DelayOn, back front DelayOff, on both fronts DelayBoth. The input Clear stops the timeout process and clears to low level the output Out.

For example, if TimeOut parameter is 3, TypeTimeOut is seconds, TypeDelay is DelayOn, then 3 seconds after the input signal In become to hight level, the output Out will become to hight level too.

Block's Parameters:

  • TimeOut - timeout of the block;
  • TypeTimeOut - type of a TimeOut parameter. It can be in Seconds, Minutes, Hours;
  • TypeDelay - front of the delay: rising front - DelayOn, back front DelayOff, on both fronts DelayBoth;

 Block's inputs:

  • In - digital signal to be delayed;
  • Clear - stops the timeout process and clears to low level the output Out;

Block's outputs:

  • Out - delayed result of a digital input In;

Example:

 Demo diagram: DelaySignal.nsm

 

Block SequenceTimer

License: Hobby, Industrial

With this block we can add many timers that work in sequence one after the other. For each timer can be set - delay and run times. When the sequence is started, all the timer's outputs are in a low level. The block first waits to expire the delay time of the first timer. Then begins runing time of first timer and it's output becomes to a high level. The first timer is then turned off and the second timer starts - first time delay, then running time, etc.

Block's parameters:

  • TimeOut - the parameter is used only from block's timers with Running type set to % Adjustment. In this case, the runing time of the timer is a % from the value of the TimeOut parameter;
  • TypeTimeOut - describes type of TimeOut parameter. May be set to Seconds, Minutes, Hours;
  • Settings - the main parameter of the block, used to add sequence timers. When a new timer is added to the grid, its elements can be edited with double clicking with mouse button over the grid's row;

Every added timer to the Settings grid has the next elements:

  • Name - name of the timer. For each timer, a new group of block's inputs/outputs are created with names formed based on the Timer name. For example, if the timer name is Timer1, a new digital input Disable_Timer1 will be created, if the input is in high level, the timer will not work. For the same timer a new digital output will be created with name Timer1. The digital output will be at high level when the timers is runing;
  • Sequence - the runing sequence of the timers;
  • Cycle delay type - may be set to Seconds or Minutes. Describes the type of the time of the Cycle delay value;
  • Cycle delay value - describes the delay time of the timer;
  • Run time type - may be set to % Adjustment, Seconds, Minutes, Hours. Describes the type of the runing time of the timer. If the element is set to % Adjustment, the runing time will be gotten from the block's parameter TimeOut. Runing time = (% Adjustment * TimeOut) / 100. The time type will be gotten from block's parameter TypeTimeOut;

Block's inputs:

  • Start - when the input becomes to a high level, the sequence of timers will be run;
  • StopAll - stops the timers sequence;
  • RunTimeSec - used to set the value of the block's parameter TimeOut, which is used for timers with running time calculated as % Adjustment;
  • SetRunTimeSec - when the input becomes to a high level, the block's parameter TimeOut will be set with value gotten from the input RunTimeSec;

Block's outputs:

  • OnEnd - becomes to a high level for a short time, when the last sequence timer finished it's ruining time;

 

Block SequenceGroupedTimer

License: Industrial

With this block we can add many group of timers, every group works in separate sequence. The timers in one group work in sequence one after the other. For each timer can be set - delay and run times. When the sequence of the group is started, all the timer's outputs are in a low level. First expired the delay time (TimeOff) of the first timer of the group. Then begins runing time (TimeOn) of the first timer of the group and it's output becomes to a high level. The first timer is then turned off and the second timer from the group starts - first TimeOff, then running time - TimeOn, etc. All the groups of timers are independent and there is influence between them.

Block's parameters:

  • Settings - the main parameter of the block, used to add groups of sequence timers. When a new Group of timers is added to the grid, its elements can be edited with double clicking with mouse button over the grid's row;

When the button Add Group is pressed, a new interface is shown with Group name and Number of timers in the group. When the group is created (new row added to the grid), three timer columns will appear for each timer in the group: Timer(Name of the timer), TimeOff, TimeOn. Every column can be edited. Columns of the grid are:

  • Disable - if is checked, all the timers in the group will not work;
  • Group - the name of the group. For each group, new block's inputs/outputs will be created with names formed based on the Group name;
  • TimeType - may has one of the next values: Seconds, Minutes, Hours. All the times (TimeOff, TimeOn) in this group will be with this time type;
  • Adjusment - if is checked, the running time TimeOn of every timer will be calculated with value set from the group's input Group1_TimeSec: (Group1_TimeSec * TimeOn) / 100;
  • Preliminary Main - every group has an digital output Group1_Main. If the element Preliminary Main is different than zero, the digital output Group1_Main will become to a high value before the group sequence to be started. The preliminary time is described with this element. Group1_Main will be cleared when the last timer from the sequence stops work;

For every timer from the sequence there will be three columns in the grid:

  • Timer - name of the timer from the sequence;
  • TimeOff- delay of the start of the timer;
  • TimeOn - running time of the timer;

Block's inputs/outputs created for every Group of timers:
For example, if the Group name is Group1, new digital inputs/outputs will be created:

  • input Group1_Start - when the input becomes to a high level, the sequence of the timers will be started. A few seconds (time described with element Preliminary Main) before start of the group, the output Group1_Main will becomes to a high level;
  • input Group1_Stop - stops all the timers in the group;
  • input Group1_TimeSec - if the group is with Adjusment, the running off all the timers will be % from the value gotten from this input;
  • input Group1_SetTimeSec - sets the Adjusment time of the group;
  • output Group1_Main - becomes to a high level at the begining of the group sequence or before this momement, depends on group setting Preliminary Main;
  • For every added timer in the group, a new digital output is created with name of the group and name of the timer: Group1_Timer1_Out. This output is at a high level, durring the timer's running time;

Block's inputs:

  • StopAll - stops all the groups with timers;

 

Block TimeOutMiliSec

License: Hobby, Industrial

The block is used for time periods with big accuracy.

Block's parameters:

  • TimeOut - duration of the timeout period in milliseconds;

Block's inputs:

  • Start - when the input becomes to a high level, the output Out becomes to a high level, until the TimeOut period;
  • Stop - if the input becomes to a high level and the block's timeout is still active, the output Out will be reset;
  • InTimeOut - the parameter of the block TimeOut can be set with the value of this input;
  • SetTimeOut - works together with input InTimeOut and sets the parameter TimeOut with the value of the input InTimeOut;

Block MultiTimeOutMilliSec

License: Hobby, Industrial

If we have a large number of timers that need to work sequentially, they can be described in a database that can be loaded, for example, by an excel document. For this purpose, in one of the columns of the Excel Document on each row, we set the time of every timer. The loaded Excel document is submitted as a DataSet to the input InDataSet of the block MultiSimeOutMilliSec. The time of every timer is in Milliseconds.

Block's parameters:

  • Outputs - number of timers (rows in InDataSet). As many outputs will be created for each timer as the value of this parameter;
  • TimeDataSetColumn - the name of the column in InDataSet, which contains the times of the timers;

Block's inputs:

  • InDataSet - a DataSet with column, which contains the times of the timers;
  • Start - if the input becomes to a high level, the TimeOut sequence starts. Every timer will become to a high level until it's time expired, then the next timer will be started;
  • Stop - stops the timeout sequence execution;