<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=SINKFILE</id>
	<title>SINKFILE - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=SINKFILE"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=SINKFILE&amp;action=history"/>
	<updated>2026-08-02T15:59:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=SINKFILE&amp;diff=756&amp;oldid=prev</id>
		<title>ConvertBot: Interactively Output data from a Midas file/pipe to a FILE</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=SINKFILE&amp;diff=756&amp;oldid=prev"/>
		<updated>2020-04-27T22:04:47Z</updated>

		<summary type="html">&lt;p&gt;Interactively Output data from a Midas file/pipe to a FILE&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Interactively Output data from a Midas file/pipe to a FILE&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;in&amp;gt;       Name of the input file/pipe (source)&lt;br /&gt;
&amp;lt;out&amp;gt;      Name of the output file (destination)&lt;br /&gt;
&amp;lt;start&amp;gt;    Start OFFSET into file [DEF=0] (0-&amp;gt;size-1)&lt;br /&gt;
&amp;lt;duration&amp;gt; Length of buffer to play/split input file&lt;br /&gt;
&lt;br /&gt;
Keyword Only Parameters:&lt;br /&gt;
[CUTOPTIONS] - Table of optional arguments for the /CUT switch.&lt;br /&gt;
               { &lt;br /&gt;
                DIGITS=&amp;lt;int&amp;gt;,         ! Number of digits in the output filename&lt;br /&gt;
                NAMESCHEME=&amp;lt;String&amp;gt;,  ! Schema of output filename must be&lt;br /&gt;
                                      ! 'STD', 'YMD', or 'HMS'&lt;br /&gt;
                NEWFILEMSG=&amp;lt;String&amp;gt;,  ! Info message displayed when a new&lt;br /&gt;
                                      ! file is cut&lt;br /&gt;
                STARTNUM=&amp;lt;int&amp;gt;        ! Initial number used in output filename&lt;br /&gt;
               }&lt;br /&gt;
               &lt;br /&gt;
 &lt;br /&gt;
SINKFILE is designed for interactive use in a piped macro.  The buffer of&lt;br /&gt;
interest can be offset and lengthened/shortened interactively.  The device&lt;br /&gt;
can play in File mode, Oneshot, or Continuous (circular).  The routine comes&lt;br /&gt;
up by default in File mode and starts processing data as soon as the pipes&lt;br /&gt;
are up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;start&amp;gt; and &amp;lt;duration&amp;gt; are the beginning and length of the replay buffer.  If&lt;br /&gt;
duration is negative, it represents an index amount of samples.&lt;br /&gt;
&lt;br /&gt;
The /RTFILE switch causes the pipe fields in the output file header to be&lt;br /&gt;
updated with the current output byte pointer.  This can be used to effectively&lt;br /&gt;
'pipe' data to one or more independent macros.  The reader macro issues a&lt;br /&gt;
SOURCEFILE/RTFILE which reads the data throttled by the output pointer.&lt;br /&gt;
&lt;br /&gt;
Cutting Multiple Output Files From a Single Input File&lt;br /&gt;
=======================================================&lt;br /&gt;
Since NeXtMidas 3.3.0, SINKFILE has the ability to cut an input file into a &lt;br /&gt;
series of new files using the /CUT switch. The /CUT switch splits the provided &lt;br /&gt;
input file based on the DURATION specified into new files per elements or &lt;br /&gt;
time (seconds). The /CUT switch, when used with no /CUT options, will split &lt;br /&gt;
the files per the number of elements similar to /CUT=ELEMENTS. /CUT=TIME splits &lt;br /&gt;
a real time file for the duration specified based on the input file time and &lt;br /&gt;
/CUT=CLOCK_TIME is based on current system (clock) time.&lt;br /&gt;
&lt;br /&gt;
The /CUT switch has an options Table (CutOptions=) that can be used to provide&lt;br /&gt;
greater control over the output filenames. The STARTNUM option designates the &lt;br /&gt;
initial sequence number for the first spawned file (e.g. myfile_00003.tmp).&lt;br /&gt;
The DIGITS option designates how may digits are used when creating the sequence&lt;br /&gt;
numbers of the output filename. The NAMESPACE option designates what format to&lt;br /&gt;
use for the date/time in the output filename. The available NAMESPACE option&lt;br /&gt;
values are: &amp;quot;STD&amp;quot; (YYYYMMDD_HHMMSS), &amp;quot;YMD&amp;quot; (YYMMDD), or &amp;quot;HMS&amp;quot; (HHMMSS). &lt;br /&gt;
Note that these options apply only to the name of the output files, NOT &lt;br /&gt;
the data itself.  &lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  1. Continuously sink a file every 5K elements from the output of a waveform.&lt;br /&gt;
    nM&amp;gt; sd360/bg inf&lt;br /&gt;
    Open the debug terminal within the sd360 screen.&lt;br /&gt;
    nM&amp;gt; SINKFILE _waveb sfTab 0 50K&lt;br /&gt;
      sfTab.tmp&lt;br /&gt;
&lt;br /&gt;
  2. Split a file every 10000 elements using 5-digit numeric sequence naming.&lt;br /&gt;
    nM&amp;gt; RAMP myramp1 elem=100k&lt;br /&gt;
    nM&amp;gt; SINKFILE/CUT=ELEMENTS myramp1 sfTab1_ 0 10000 cutOptions={DIGITS=5}&lt;br /&gt;
      sfTab1_00000.tmp&lt;br /&gt;
      sfTab1_00001.tmp&lt;br /&gt;
      ... and so on.&lt;br /&gt;
&lt;br /&gt;
  3. Split a file every 100000 elements using time-based naming.&lt;br /&gt;
    nM&amp;gt; RAMP myramp2 elem=1000000&lt;br /&gt;
    nM&amp;gt; SINKFILE/CUT=ELEMENTS myramp2 sfTab2_ 0 100000 &amp;amp;&lt;br /&gt;
                              cutOptions={DIGITS=10,NAMESCHEME=HMS} &lt;br /&gt;
      sfTab2_00000000_160449.tmp&lt;br /&gt;
      sfTab2_00000001_160449.tmp&lt;br /&gt;
      ... and so on.&lt;br /&gt;
&lt;br /&gt;
  4. Split a file every 5.5 seconds using time-based naming displaying a message&lt;br /&gt;
     each time a new file is cut.&lt;br /&gt;
    nM&amp;gt; sd360/bg inf&lt;br /&gt;
    Open the debug terminal within the sd360 screen.&lt;br /&gt;
    nM&amp;gt; SINKFILE/CUT=CLOCK_TIME _waveb sfTab3_ 0 5.5 &lt;br /&gt;
                    cutOptions={NAMESCHEME=STD,NEWFILEMSG=&amp;quot;Spawning new file&amp;quot;}&lt;br /&gt;
      sfTab3_0000_121024_160449.tmp&lt;br /&gt;
      INFO: &amp;quot;Spawning new file&amp;quot;&lt;br /&gt;
      sfTab3_0001_121024_160449.tmp&lt;br /&gt;
      ... and so on.&lt;br /&gt;
&lt;br /&gt;
Messages:&lt;br /&gt;
  NAME       - (IN/OUT) DESCRIPTION&lt;br /&gt;
  ----------------------------------------------------------------------&lt;br /&gt;
  CUT        - (I)    Spawn a new file. [DATA=&amp;lt;new_filename&amp;gt;]&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
Switches:&lt;br /&gt;
  /TL                - Input transfer length in elements&lt;br /&gt;
  /RTFILE            - Enables the Real Time File mode&lt;br /&gt;
  /CUT=&amp;lt;spec&amp;gt;        - Split input file based on DURATION= (Since 3.3.0)&lt;br /&gt;
    ELEMENTS         - number of elements&lt;br /&gt;
    TIME             - number of seconds from input file&lt;br /&gt;
    CLOCK_TIME       - number of seconds based on system/clock time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>