emWait

Top  Next

emWait


embedded wait.

Since R2019b

 

Library: embeddedCreatorLib ( Dafulai Electronics) / emWait

 

emWait

 

 


 

Description


 

This block will wait for some time. But this is non-blocking block. It will end immediately even though time is not on.  When time block waits for is on, the output port "On" of this block will be "true" and keeps "true" and other output ports will be kept 0. Otherwise, "On" is "false, and related output ports will indicate how many hours/Minutes/Seconds left.   Actually, Simulink has "Delay" block, why do we provide this block?  The reason is that Simulink built-in "Delay" block consumes more memory and CPU Time when "delay" time is many samples.  And "Delay" block don't tell you how many time left.

 

Notes: Any Port name with "Right Arrow" (à) symbol contains "built-in" probe. So in PC side, you can watch its value directly by "Display" block, you don't need add "Probe" block (our emProbe) before "Display" block. Of cause, you can still use "Mux"  block to collect all watching variables and then connect one "emProbe" which connects "Display" block.  In this way, you can decrease communication traffic.

Parameters


 

Please double click this block to open parameters dialog below:

 

emWait_param

 

 

 

 

Let us explain parameters.

 

 

How many hours to wait?— 0 to 255 which is hours for delay.

 

How many minutes to wait?— 0 to 59 which is minutes for delay.

 

How many seconds to wait?— 0 to 59 which is seconds for delay.

 

How many ms to wait?— 0 to 999 which is milliseconds for delay.

 

Sample time in sec (-1 for inherited): — Sample time for this block. It is the same meaning as general Simulink block .

 

 

Ports


 

Input

 

En — "logical" data type's scalar. True means enable this block, and the block executes counting-down (Output ports "Hr"/"Min"/"Sec" will count down) . When counting-down to zero (time is on), output port "On" will be true, and  output ports "Hr"/"Min"/"Sec" will  be 0.  if "En" does not reset to false, output port "On" keeps true, output ports "Hr"/"Min"/"Sec" keep 0.  However, if "En" resets to false, output port "On" will be false, and output ports "Hr"/"Min"/"Sec" will be initial Value. But when initial/left hours are over 15, it will put output port "Hr" to 15.

 

 

Min — "uint8" data type's scalar.  It is minutes for delay. If this port connected, block will ignore all delay time settings in parameters dialog window.

 

Sec — "uint8" data type's scalar.  It is seconds for delay. If this port connected, block will ignore all delay time settings in parameters dialog window.

 

0.1Sec — "uint8" data type's scalar.  It is how many "1/10 seconds" for delay. If this port connected, block will ignore all delay time settings in parameters dialog window.

 

Outport


 

On — "logical" data type's scalar. True means "Delay time finish". False means "Delay is in progress but not finish" or "block is disabled"

 

Hr — "uint8" data type's scalar.  It is how many hours left. When left hours are over 15, it will be 15.  Please don't connect "Display" block before creating code (build command).   And you can connect "Display" block after creating code in order to monitor result.

 

Min — "uint8" data type's scalar. value range is 0 to 59.  It is how many minutes left. Please don't connect "Display" block before creating code (build command).   And you can connect "Display" block after creating code in order to monitor result.

 

Sec — "uint8" data type's scalar. value range is 0 to 59.  It is how many seconds left. Please don't connect "Display" block before creating code (build command).   And you can connect "Display" block after creating code in order to monitor result.

 

 

 

Examples