[Scilab-users] Using Modelica generic block MBLOCK in Xcos

Romain Desbats romain.desbats at ifsttar.fr
Mon Mar 10 10:28:12 CET 2014


Dear Scilab Users, 

I am using Scilab / Xcos 5.4.1. 

I am implementing custom implicit blocks using the MBLOCK in the attached model. 

I specify in the block creation menu the file where I write the block function: NL_Capacitor.mo (I only modified the original capacitor function.) 

The content of the file is as follows: 

model NL_Capacitor 
Pin p, n; 
Real i, v; 
parameter Real C(fixed=true)=1e-5 "Capacitance"; 
equation 
i = p.i; 
n.i = -i; 
v = p.v - n.v; 
C * der(v) = 3*i^2; 
end NL_Capacitor; 

When I compile the model, I get the following error: 


-------Modelica translator error message:----- 
--------------------------------------------------- 
Translator v1.2 for Scicos from Modelica 2.x to flat Modelica 
Copyright (C) 
2005-2007 Imagine, 
2007-2008 LMS-Imagine 
Build date is not known (2008-04-01). 
--------------------------------------------------- 

ERROR 0024: 
--- "class" element expected 

--- Execution step: Name resolution 

--- Source: D:\user\AppData\Local\Temp\SCI_TMP_4616_\model_NL_im.mo 
--- Line number: 15 
--- Column number: 18 
--- TypeFound: Component element 

The file model_NL_im.mo (attached) seems to b e generated by the compilation and starts with the header model. 

I wonder why the error says that a class element is expected since model is a particular class if I understand well. 

Any help would be really useful. 

Best regards, 


Romain 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140310/4b3af39e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: model_NL_im.mo
Type: application/x-gettext-translation
Size: 1081 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140310/4b3af39e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NL_Capacitor.mo
Type: application/x-gettext-translation
Size: 205 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140310/4b3af39e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NL_Capacitor1.mo
Type: application/x-gettext-translation
Size: 207 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140310/4b3af39e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: model_NL.xcos
Type: application/xml
Size: 97812 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140310/4b3af39e/attachment.wsdl>


More information about the users mailing list