cstime

Capsim Block Documentation

Short Description

Function outputs the "time" to all connected output buffers.

Top
Parameters
Num Description Type Name Default Value
0 Time between samples float time_scale 1.0
1 Time before stopping float time_stop -1.0
Top
States
Num Type Name Initial Value Description
0 float time_elapse 0.0
1 int no_obuf
Top

Declarations


 

	int i,j;



Top

Initialization Code



 

	if((no_obuf = NO_OUTPUT_BUFFERS() ) <= 0) {
		fprintf(stderr,"time: no output buffers\n");
		return(1); /* no output buffers */
	}




Top

Main Code



 


	/* put out a maximum of NUMBER_SAMPLES_PER_VISIT samples */
	for(i=0; i < NUMBER_SAMPLES_PER_VISIT; ++i) {

		/* dont continue if time has exceeded time_stop  */
		if(time_stop >= 0.0 && time_elapse >= time_stop) return(0);
		for(j=0; j
    
Top

Wrapup Code



 





Top

License



/*  Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks)
    Copyright (C) 1989-2017  Silicon DSP Corporation

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://www.silicondsp.com
    Silicon DSP  Corporation
    Las Vegas, Nevada
*/


Top

Description



 

/* cstime.s */
/**********************************************************************
			cstime()
***********************************************************************
Function outputs the "time" to all connected output buffers.
The time between samples and the time before stopping are both
input parameters:
	The time between samples defaults to 1.0 ("second")
	The time before stopping defaults to infinity
Using the stopping criterion is a convenient way of controlling
the length of the simulation to a certain time interval specified
in seconds.

cstime


Function outputs the "time" to all connected output buffers.
The time between samples and the time before stopping are both
input parameters:
	The time between samples defaults to 1.0 ("second")
	The time before stopping defaults to infinity
Using the stopping criterion is a convenient way of controlling
the length of the simulation to a certain time interval specified
in seconds.


Programmer: D.G.Messerschmitt
Date: June 26, 1982
Modification for V2.0: Jan. 10, 1985
Mod: ljfaber 12/87 add 'auto fanout'

*/