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
26 xmlns:scilab="http://www.scilab.org" xml:id="WRITEC_f" xml:lang="en_US"
27 xmlns="http://docbook.org/ns/docbook"
28 xmlns:xlink="http://www.w3.org/1999/xlink"
29 xmlns:svg="http://www.w3.org/2000/svg"
30 xmlns:ns5="http://www.w3.org/1999/xhtml"
31 xmlns:mml="http://www.w3.org/1998/Math/MathML"
32 xmlns:db="http://docbook.org/ns/docbook"
35 <refname>WRITEC_f</refname>
36 <refpurpose>Write to C binary file</refpurpose>
40 <title>Block Screenshot</title>
44 <imagedata fileref="../../../../images/palettes/WRITEC_f.png" align="center" valign="middle"/>
50 <refsection id="Contents_WRITEC_f">
51 <title>Contents</title>
55 <link linkend="WRITEC_f">Write to C binary file</link>
62 <xref linkend="Palette_WRITEC_f">Palette</xref>
67 <xref linkend="Description_WRITEC_f">Description</xref>
72 <xref linkend="Datatype_WRITEC_f">Data types</xref>
77 <xref linkend="Dialogbox_WRITEC_f">Dialog box</xref>
82 <xref linkend="Defaultproperties_WRITEC_f">Default properties</xref>
87 <xref linkend="Interfacingfunction_WRITEC_f">Interfacing function</xref>
92 <xref linkend="Computationalfunction_WRITEC_f">Computational function</xref>
97 <xref linkend="Seealso_WRITEC_f">See also</xref>
105 <refsection id="Palette_WRITEC_f">
106 <title>Palette</title>
110 <link linkend="Sinks_pal">Sinks palette</link>
116 <refsection id="Description_WRITEC_f">
117 <title>Description</title>
119 This block allows to user to write data in a C binary file with the name defined by the string <emphasis role="bold">Output File Name</emphasis>.
120 The file is a sequence of records. Each record has the length fixed by the parameter <emphasis role="bold">Input Size</emphasis> and the structure shown
125 <imagedata fileref="../../../images/palettes/sinks_pal/en_US/writec_f_record_en_US.gif"/>
128 <programlisting role="pic"><![CDATA[
139 <para>where the block inputs are numbered from top to bottom.</para>
141 The record fields must contains data of the same type defined by the parameter <emphasis role="bold">Output Format</emphasis>.
144 Each event on the activation input of the bloc writes a record in the file. Note that contrary in <link linkend="WFILE_f">WFILE_f</link>, the event dates are not recorded.
148 <refsection id="Datatype_WRITEC_f">
149 <title>Data types</title>
153 Input: a scalar or a column vector of size <emphasis role="bold">Input Size</emphasis>.
159 <refsection id="Dialogbox_WRITEC_f">
160 <title>Dialog box</title>
164 <imagedata fileref="../../../gui/sinks_pal/en_US/WRITEC_f_gui.png" align="center" valign="middle"/>
172 <emphasis role="bold">Input Size</emphasis>
174 <para>A scalar, the size of the input column vector.</para>
175 <para>Properties : Type 'vec' of size 1 </para>
179 <emphasis role="bold">Output File Name</emphasis>
182 A character string defining the path and the file name of the file to be write. The block support file name expansion and you can use environment variables like
183 <emphasis>HOME</emphasis> in the path, by example <emphasis>"HOME/my_data/foo.data"</emphasis>. Without file path, the file is wrote in the directory defined by the
184 <emphasis>PWD</emphasis> variable.
186 <para>The file path must exist, otherwise you will be prompted by an error message.</para>
187 <para> Properties : Type 'str' of size 1 </para>
191 <emphasis role="bold">Output Format</emphasis>
194 A character string defining the format to use. The following string "l", "i", "s", "ul", "ui", "us", "d", "f", "c", "uc"
195 are used respectively to write int32, int16, int8, uint32, uint16, uint8, double, float, char or unsigned char data type.
198 You must use the same format when you read the file with <link linkend="READC_f">READC_f</link>.
200 <para> Properties : Type 'str' of size 1 </para>
204 <emphasis role="bold">Buffer size</emphasis>
207 To improve efficiency it is possible to buffer the input data. Data writing on the file is only done
208 when the buffer is full.
210 <para> Properties : Type 'vec' of size 1 </para>
214 <emphasis role="bold">Swap Mode (0:No, 1:Yes)</emphasis>
216 <para>Endian IEEE format</para>
220 <emphasis role="bold">0</emphasis>: automatic bytes swap is disabled.
225 <emphasis role="bold">1</emphasis>: the file is supposed to be coded in "little endian IEEE format" and data are
226 swapped if necessary to match the IEEE format of the processor.
230 <para> Properties : Type 'vec' of size 1 </para>
235 <refsection id="Defaultproperties_WRITEC_f">
236 <title>Default properties</title>
240 <emphasis role="bold">always active:</emphasis> no
245 <emphasis role="bold">direct-feedthrough:</emphasis> yes
250 <emphasis role="bold">zero-crossing:</emphasis> no
255 <emphasis role="bold">mode:</emphasis> no
260 <emphasis role="bold">regular inputs:</emphasis>
263 <emphasis role="bold">- port 1 : size [1,1] / type 1</emphasis>
268 <emphasis role="bold">number/sizes of activation inputs:</emphasis> 1
273 <emphasis role="bold">number/sizes of activation outputs:</emphasis> 0
278 <emphasis role="bold">continuous-time state:</emphasis> no
283 <emphasis role="bold">discrete-time state:</emphasis> yes
288 <emphasis role="bold">object discrete-time state:</emphasis> no
293 <emphasis role="bold">name of computational function:</emphasis>
294 <emphasis role="italic">writec</emphasis>
300 <refsection id="Example_WRITEC_f">
301 <title>Example</title>
303 In this example the block is used to record the output of the sine wave generator. To record at the same time, the time
304 events, we use a TIME_f block and a multiplexer to form the input vector of the WRITEC_f block which record the data in
305 the file <emphasis>"TMPDIR/writec_f.data"</emphasis>. Then you can read these data with the block
306 <link linkend="READC_f">READC_f</link>.
310 <link type="scilab" linkend="scilab.xcos/xcos/examples/sinks_pal/en_US/writec_f_en_US.zcos">
313 <imagedata fileref="../../../../examples/sinks_pal/en_US/writec_f_en_US.zcos" align="center" valign="middle"/>
320 <refsection id="Interfacingfunction_WRITEC_f">
321 <title>Interfacing function</title>
325 <link type="scilab" linkend="scilab.scinotes/scicos_blocks/macros/Sinks/WRITEC_f.sci">SCI/modules/scicos_blocks/macros/Sinks/WRITEC_f.sci</link>
331 <refsection id="Computationalfunction_WRITEC_f">
332 <title>Computational function</title>
335 <para> SCI/modules/scicos_blocks/src/c/writec.c (Type 2)</para>
340 <refsection role="see also" id="Seealso_WRITEC_f">
341 <title>See also</title>
344 <link linkend="READC_f">READC_f</link>
347 <link linkend="RFILE_f">RFILE_f</link>
350 <link linkend="WFILE_f">WFILE_f</link>