Question: Error in Modelica Custom Component generation

Hi all,

I have a modelica custom componet which has inputs from angle/speed sensors and the output is a vector. I have an error "Attempted to retrieve property of unknown component". Can anyone see mistakes from the code below;

model basisFunction
    extends Maplesoft.Icons.CustomComponent;
    parameter Real bPen[sn*sn] "The normalized output for the basis function";
    parameter Integer sn=5 "The number of samples in each axist";
    parameter Real c[2,1] "Centre of each basis";
    parameter Real bFunc[sn*sn] "The basis function";
    parameter Real theta_r=linspace(-0.02,0.02,sn) "Generates sn values for position";
    parameter Real theta_p=linspace(-0.1,0.1,sn) "Generates sn values for velocity";
    parameter Real s[1,2]=[(theta_r[2]-theta_r[1])/1.7, (theta_p[2]-theta_p[1])/1.7];
    Modelica.Mechanics.Rotational.Sensors.AngleSensor.phi x1 annotation (Placement(transformation(
        extent = {
            {-110, 32},
            {-90, 52}},
        rotation = 0)));
    Modelica.Mechanics.Rotational.Sensors.SpeedSensor.w x2 annotation (Placement(transformation(
        extent = {
            {-110, -51},
            {-90, -31}},
        rotation = 0)));
    Modelica.Blocks.Interfaces.RealOutput bPen[sn*sn] annotation (Placement(transformation(
        extent = {
            {90, -13},
            {110, 7}},
        rotation = 0)));
equation
    for i in 1:size(theta_r,1) loop
       for j in 1:size(theta_p,1) loop
          c=[theta_r[i]; theta_p[j]];
          bFunc[(i-1)*size(theta_r,1)+j]=scalar(exp(-((1.0./s).^2)*([x1; x2]-c).^2));
       end for;
    end for;
    bPen=bFunc/sum(bFunc);
    annotation (uses(Modelica(version = "3.1")));
end basisFunction;

Thanks for your help...

Please Wait...