Building a C Block for Xcos
ierturk
erturki at gmail.com
Tue Oct 26 00:43:35 CEST 2010
I have received below messages when I try to build under below configuration
Configuration
----------------------
- Scilab-5.3.0-beta-4
- Windows XP SP3
- Microsoft Visual C++ 2008 Express Edition
C File (buffer_vect_xcos.c)
-----------------------
#include "scicos_block4.h"
void buffer_vect_xcos(scicos_block *block, int flag)
{
int nsamples = GetIparPtrs(block)[0];
double padding_value = GetRparPtrs(block)[0];
switch(flag)
{
case Initialization:
GetWorkPtrs(block) = (double *)MALLOC(sizeof(double)*nsamples);
for(int i=0;i<nsamples;i++) ((double *)GetWorkPtrs(block))[i] =
padding_value;
break;
case StateUpdate:
for(int i=1;i<nsamples;i++)
((double *)GetWorkPtrs(block))[i-1] = ((double
*)GetWorkPtrs(block))[i];
((double *)GetWorkPtrs(block))[nsamples-1] = ((double
*)GetInPortRows(block,1))[0];
break;
case Ending:
FREE(GetWorkPtrs(block));
break;
case OutputUpdate:
for(int i=0;i<nsamples;i++)
((double *)GetOutPortPtrs(block,1))[i] = ((double
*)GetWorkPtrs(block))[i];
break;
}
}
Messages
-----------------------
-->ilib_for_link('buffer_vect_xcos','buffer_vect_xcos.o',[],'c','Makelib','l
oader.sce','','','-g');
WARNING: ilib_for_link: Wrong value for input argument #5: '' or '[]'
expected.
Generate a loader file
Generate a Makefile
Running the Makefile
Compilation of buffer_vect_xcos
Building shared library (be patient)
cl : Command line warning D9002 : ignoring unknown option '-g'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
9.0\VC\bin\cl.EXE"' : return code '0x2'
Stop.
!--error 10000
unix_s: error during "nmake /Y /nologo /f Makelib.mak all" execution
at line 34 of function unix_s called by :
at line 65 of function ilib_compile called by :
at line 86 of function ilib_for_link called by :
ilib_for_link('buffer_vect_xcos','buffer_vect_xcos.o',[],'c','Makelib','load
er.sce','','','-g');
Best Regards,
ierturk
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------
Dear Scilab Users,
I have try to build electrical machine block which was previously created
under Simulink. I have succeded under ScicosLab, but not under Scilab/Xcos.
Are there anybody who have an experience with building Xcos C Block? Please
share it with me, then I will try to port electrical machine and control
block under Scicos to Xcos.
Best Regards,
ierturk
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.862 / Virus Database: 271.1.1/3213 - Release Date: 10/23/10
09:34:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.862 / Virus Database: 271.1.1/3218 - Release Date: 10/25/10
09:34:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101026/9f538feb/attachment.htm>
More information about the users
mailing list