title: import an existing Modelica block contained in MSL in a model
body: <p>I am new in using OpenModelica.</p>
  
  <p>I have a model that simulates the behavior of a battery. It is composed of different DAEs. Now it works using a constant current but I am trying to get some results using a time-varying current. I noticed that in Modelica -> Electrical -> Analog -> Sources there is a huge quantity of different current inputs that I could use to define the variable (Real) current in my model. </p>
  
  <p>Is there a way to introduce in a model an already-existing block? </p>
  
  <p>For instance, I am trying to give as input in my model the stepCurrent (contained in Source library) but I am getting back an error. </p>
  
  <p>This is the way I coded: </p>
  
  <p>model battery </p>
  
  <p>//definition of variables and parameters </p>
  
  <p>// II1C is the current </p>
  
  <p>import Modelica.Electrical.Analog.Sources.PulseCurrent; 
  Real II1C = PulseCurrent(I = 10, period = 500, width = 50,offset=0); </p>
  
  <p>equation </p>
  
  <p>// DAE system which is also a function of II1C. </p>
  
  <p>end battery; </p>
  
  <p>This is the error message I got: </p>
  
  <p>[1] 19:22:01 Translation Error 
  [BatteryModelDischarging: 15:1-15:68]: Looking for a function .Modelica.Electrical.Analog.Sources.PulseCurrent but found a model. </p>
  
  <p>[2] 19:22:01 Translation Error 
  Error occurred while flattening model BatteryModelDischarging </p>
  
  <p>Is there a way to make this work? </p>
  
  <p>Thank you so much in advance, </p>
  
  <p>Kindest regards, Gabri </p>