1 <?xml version="1.0" encoding="UTF-8"?>
5 * Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
6 * Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
7 * Copyright (C) 2011 - Bernard DUJARDIN <bernard.dujardin@contrib.scilab.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * See the file ./license.txt
25 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="Counter" xml:lang="en_US">
27 <refname>Counter</refname>
28 <refpurpose>Counter</refpurpose>
31 <title>Block Screenshot</title>
35 <imagedata fileref="../../../../images/palettes/Counter.png" align="center" valign="middle"/>
40 <refsection id="Contents_Counter">
41 <title>Contents</title>
45 <link linkend="Counter">Counter</link>
52 <xref linkend="Palette_Counter">Palette</xref>
57 <xref linkend="Description_Counter">Description</xref>
62 <xref linkend="Datatypes_Counter">Data types</xref>
67 <xref linkend="Dialogbox_Counter">Dialog box</xref>
72 <xref linkend="Defaultproperties_Counter">Default properties</xref>
77 <xref linkend="Example_Counter">Example</xref>
82 <xref linkend="Interfacingfunction_Counter">Interfacing function</xref>
87 <xref linkend="Computationalfunction_Counter">Computational function</xref>
92 <xref linkend="Seealso_Counter">See also</xref>
99 <refsection id="Palette_Counter">
100 <title>Palette</title>
104 <link linkend="Sources_pal">Sources palette</link>
109 <refsection id="Description_Counter">
110 <title>Description</title>
112 This block counts with an increment/decrement value equal to one from <emphasis role="bold">Minimum</emphasis> to <emphasis role="bold">Maximum</emphasis>
113 or from <emphasis role="bold">Maximum</emphasis> to <emphasis role="bold">Minimum</emphasis> depending
114 on the choice of the <emphasis role="bold">Rule</emphasis> parameter.
117 <refsection id="Datatypes_Counter">
118 <title>Data types</title>
122 Output: scalar double.
127 <refsection id="Dialogbox_Counter">
128 <title>Dialog box</title>
132 <imagedata fileref="../../../gui/sources_pal/en_US/Counter_gui.png" align="center"/>
140 <emphasis role="bold">Minimum</emphasis>
142 <para> The lowest number of the counter.</para>
143 <para> Properties : Type 'vec' of size 1. </para>
147 <emphasis role="bold">Maximum</emphasis>
149 <para> The highest number of the counter.</para>
150 <para> Properties : Type 'vec' of size 1. </para>
154 <emphasis role="bold">Rule (1:Increment, 2:Decrement)</emphasis>
156 <para> The rule of counting :</para>
160 <emphasis role="bold">1</emphasis>: Counts from the lowest number to the highest number. The count is increasing.
165 <emphasis role="bold">2</emphasis>: Counts from the highest number to the lowest number. The count is decreasing.
169 <para> Properties : Type 'vec' of size 1.</para>
173 <refsection id="Defaultproperties_Counter">
174 <title>Default properties</title>
178 <emphasis role="bold">always active:</emphasis> no
183 <emphasis role="bold">direct-feedthrough:</emphasis> no
188 <emphasis role="bold">zero-crossing:</emphasis> no
193 <emphasis role="bold">mode:</emphasis> no
198 <emphasis role="bold">regular outputs:</emphasis>
201 <emphasis role="bold">- port 1 : size [1,1] / type 1</emphasis>
206 <emphasis role="bold">number/sizes of activation inputs:</emphasis> 1
211 <emphasis role="bold">number/sizes of activation outputs:</emphasis> 0
216 <emphasis role="bold">continuous-time state:</emphasis> no
221 <emphasis role="bold">discrete-time state:</emphasis> yes
226 <emphasis role="bold">object discrete-time state:</emphasis> no
231 <emphasis role="bold">name of computational function:</emphasis>
232 <emphasis role="italic">counter</emphasis>
237 <refsection id="Example_Counter">
238 <title>Example</title>
240 This diagram shows the Counter block output versus time.
244 <link type="scilab" linkend="scilab.xcos/xcos/examples/sources_pal/en_US/counter_en_US.zcos">
247 <imagedata fileref="../../../../examples/sources_pal/en_US/counter_en_US.zcos" align="center" valign="middle"/>
251 <scilab:image><![CDATA[
252 importXcosDiagram(SCI + "/modules/xcos/examples/sources_pal/en_US/counter_en_US.zcos");
253 xcos_simulate(scs_m, 4);
257 <refsection id="Interfacingfunction_Counter">
258 <title>Interfacing function</title>
262 <link type="scilab" linkend="scilab.scinotes/scicos_blocks/macros/Sources/Counter.sci">SCI/modules/scicos_blocks/macros/Sources/Counter.sci</link>
267 <refsection id="Computationalfunction_Counter">
268 <title>Computational function</title>
271 <para> SCI/modules/scicos_blocks/src/c/counter.c (Type 4)</para>
275 <refsection id="Seealso_Counter">
276 <title>See also</title>
279 <link linkend="Modulo_Count">Modulo_Count</link>