Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables

Package Content

NameDescription
Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.StartTable StartTable Generates cars that are sent on to the production line
Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.EndTable EndTable Ends the line
Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableVertical TableVertical Vertical table operating in southbound direction
Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableRight TurnTableRight Table which turns the track direction southbound
Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableHorizontal TableHorizontal Horizontal table operating in eastbound direction
Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableLeft TurnTableLeft Table which turns the track direction eastbound


Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.StartTable Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.StartTable

Generates cars that are sent on to the production line

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.StartTable

Connectors

TypeNameDescription
TableComNexttableComNext 
input BooleanInputnext_ready 
output BooleanOutputnext_idle 
output BooleanOutputnext_transport 

Modelica definition

model StartTable 
  "Generates cars that are sent on to the production line"

  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComNext
  tableComNext;
  Modelica.Blocks.Interfaces.BooleanInput next_ready;
  Modelica.Blocks.Interfaces.BooleanOutput next_idle;
  Modelica.Blocks.Interfaces.BooleanOutput next_transport;
equation 
  connect(next_ready, tableComNext.Ready);
  connect(next_idle, tableComNext.Idle);
  connect(next_transport, tableComNext.Transport);
end StartTable;

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.EndTable Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.EndTable

Ends the line

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.EndTable

Connectors

TypeNameDescription
TableComPrevtableComPrev 
output BooleanOutputprev_ready 
input BooleanInputprev_idle 
input BooleanInputprev_transport 

Modelica definition

model EndTable "Ends the line"

  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComPrev
  tableComPrev;
  Modelica.Blocks.Interfaces.BooleanOutput prev_ready;
  Modelica.Blocks.Interfaces.BooleanInput prev_idle;
  Modelica.Blocks.Interfaces.BooleanInput prev_transport;
  Modelica.Blocks.Logical.Not Not;
equation 
  connect(prev_ready, tableComPrev.Ready);
  connect(prev_idle, tableComPrev.Idle);
  connect(Not.y, tableComPrev.Transport);
  connect(Not.u, prev_transport);
end EndTable;

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableVertical Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableVertical

Vertical table operating in southbound direction

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableVertical

Information

Extends from Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.Table (Table Logic).

Parameters

TypeNameDefaultDescription
Stringprocessor""The processor that will execute the task
Stringcontainer""The task in which the controller will run
Integerpriority1Priority of the task
RealsampleTime0.01Sample time of the task
Realphase0Phase of the task
RealtransportLength2*100Length of the table in pixels
RealtransportTime4Desired time to travel through table length
RealcarLength100Length of the car

Connectors

TypeNameDescription
RobotComTablerobotComTable 
TableComNexttableComNext 
TableComPrevtableComPrev 

Modelica definition

model TableVertical 
  "Vertical table operating in southbound direction"
  extends Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.Table
    (
    Prev_Ready(y=tableComPrev.Ready),
    CarInPosition(y=carInPosition),
    Robot_WorkDone(y=robotComTable.WorkDone),
    Next_Idle(y=tableComNext.Idle),
    Next_Transport(y=tableComNext.Transport));
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.RobotComTable
  robotComTable;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComNext
  tableComNext;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComPrev
  tableComPrev;
  Modelica.Blocks.Sources.BooleanExpression Prev_Transport(y=InTransport.active);
  Modelica.Blocks.Sources.BooleanExpression OutTransport_active(y=OutTransport.active);
  Modelica.Blocks.Logical.Or or1;
  Modelica_StateGraph2.Blocks.MathBoolean.ShowValue indicatorLamp;
  Modelica.Blocks.Sources.BooleanExpression Prev_Idle(y=Empty.active);
  Modelica.Blocks.Sources.BooleanExpression Robot_StartWork(y=Occupied.active);
  Modelica.Blocks.Sources.BooleanExpression Next_Ready(y=Waiting.active);
equation 
  carInPosition = pos >= -0.5 and pos < 0.5;
  if InTransport.active  or OutTransport.active then
    der(pos) = transportLength/transportTime;
  else
    der(pos) = 0;
  end if;

  if Empty.active then
    newPoints=[zeros(4),zeros(4)];
  else
    newPoints = {{25,-50},{-25,-50},{-25,50},{25,50}} - pos*[zeros(4),ones(4)];
  end if;

  when Empty.active then
    reinit(pos,-transportLength);
  end when;
  connect(Prev_Idle.y, tableComPrev.Idle);
  connect(Prev_Transport.y, tableComPrev.Transport);
  connect(or1.u1, OutTransport_active.y);
  connect(or1.u2, Prev_Transport.y);
  connect(Robot_StartWork.y, robotComTable.StartWork);
  connect(Next_Ready.y, tableComNext.Ready);
connect(indicatorLamp.activePort, or1.y);
end TableVertical;

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableRight Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableRight

Table which turns the track direction southbound

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableRight

Information

Extends from Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.TurnTable (Table which turns the track).

Parameters

TypeNameDefaultDescription
Stringprocessor""The processor that will execute the task
Stringcontainer""The task in which the controller will run
Integerpriority1Priority of the task
RealsampleTime0.01Sample time of the task
Realphase0Phase of the task
RealtransportLength2*100Length of the track in pixels
RealtransportTime4Desired time to travel through table length
RealcarLength286Length of the car

Connectors

TypeNameDescription
TableComNexttableComNext 
TableComPrevtableComPrev 

Modelica definition

model TurnTableRight 
  "Table which turns the track direction southbound"
  extends Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.TurnTable;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComPrev
  tableComPrev;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComNext
  tableComNext;
  Modelica.Blocks.Sources.BooleanExpression Prev_Idle(y=Empty.active);
  Modelica.Blocks.Sources.BooleanExpression Next_Ready(y=Waiting.active);
  Modelica.Blocks.Sources.BooleanExpression Prev_Transport(y=InTransport.active);
  Modelica_StateGraph2.Blocks.MathBoolean.ShowValue indicatorLamp "Motor";
  Modelica.Blocks.Sources.BooleanExpression OutTransport_Active(y=OutTransport.active);
  Modelica.Blocks.Logical.Or or1;
equation 
  carInPosition = pos >= -0.5 and pos < 0.5;

  if InTransport.active or OutTransport.active then
    der(pos) = transportLength/transportTime;
  else
    der(pos) = 0;
  end if;

  if Empty.active then
    rectangle1 = {{-46,100},{46,-100}};
    rectangle2 = {{-100,46},{100,-46}};
    newPoints = [zeros(4),zeros(4)];
  elseif Occupied.active or OutTransport.active then
    rectangle1 = {{-100,46},{100,-46}};
    rectangle2 = {{-46,100},{46,-100}};
    newPoints = {{25,-50},{-25,-50},{-25,50},{25,50}} - pos*[zeros(4), ones(4)];
  else
    newPoints = {{-50,25},{-50,-25},{50,-25},{50,25}} + pos*[ones(4), zeros(4)];
    rectangle1 = {{-46,100},{46,-100}};
    rectangle2 = {{-100,46},{100,-46}};
  end if;

  when Empty.active then
    reinit(pos, -transportLength);
  end when;
  connect(Next_Ready.y, tableComNext.Ready);
  connect(Prev_Idle.y, tableComPrev.Idle);
  connect(Prev_Transport.y, tableComPrev.Transport);
  connect(or1.u1, Prev_Transport.y);
  connect(OutTransport_Active.y, or1.u2);
connect(indicatorLamp.activePort, or1.y);
end TurnTableRight;

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableHorizontal Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableHorizontal

Horizontal table operating in eastbound direction

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TableHorizontal

Information

Extends from Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.Table (Table Logic).

Parameters

TypeNameDefaultDescription
Stringprocessor""The processor that will execute the task
Stringcontainer""The task in which the controller will run
Integerpriority1Priority of the task
RealsampleTime0.01Sample time of the task
Realphase0Phase of the task
RealtransportLength2*100Length of the table in pixels
RealtransportTime4Desired time to travel through table length
RealcarLength100Length of the car

Connectors

TypeNameDescription
TableComPrevtableComPrev 
RobotComTablerobotComTable 
TableComNexttableComNext 

Modelica definition

model TableHorizontal 
  "Horizontal table operating in eastbound direction"
  extends Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.Table
    (
    Occupied(use_activePort=false),
    Prev_Ready(y=tableComPrev.Ready),
    CarInPosition(y=carInPosition),
    Next_Transport(y=tableComNext.Transport),
    Robot_WorkDone(y=robotComTable.WorkDone),
    Next_Idle(y=tableComNext.Idle));

  Modelica.Blocks.Sources.BooleanExpression OutTransport_active(y=OutTransport.active);
  Modelica.Blocks.Sources.BooleanExpression Prev_Transport(y=InTransport.active);
  Modelica.Blocks.Sources.BooleanExpression Prev_Idle(y=Empty.active);
  Modelica.Blocks.Sources.BooleanExpression Robot_StartWork(y=Occupied.active);
  Modelica.Blocks.Sources.BooleanExpression Next_Ready(y=Waiting.active);
  Modelica.Blocks.Logical.Or or1;
  Modelica_StateGraph2.Blocks.MathBoolean.ShowValue indicatorLamp;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComPrev
  tableComPrev;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.RobotComTable
  robotComTable;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComNext
  tableComNext;
equation 
  carInPosition = pos >= -0.5 and pos < 0.5;

  if InTransport.active or OutTransport.active then
    der(pos) = transportLength/transportTime;
  else
    der(pos) = 0;
  end if;

  if Empty.active then
    newPoints = [zeros(4),zeros(4)];
  else
    newPoints = {{-50,25},{-50,-25},{50,-25},{50,25}} + pos*[ones(4), zeros(4)];
  end if;

  when Empty.active then
    reinit(pos, -transportLength);
  end when;

  connect(Next_Ready.y, tableComNext.Ready);
  connect(Robot_StartWork.y, robotComTable.StartWork);
  connect(Prev_Idle.y, tableComPrev.Idle);
  connect(Prev_Transport.y, tableComPrev.Transport);
  connect(or1.u1, OutTransport_active.y);
  connect(Prev_Transport.y, or1.u2);
connect(indicatorLamp.activePort, or1.y);
end TableHorizontal;

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableLeft Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableLeft

Table which turns the track direction eastbound

Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Tables.TurnTableLeft

Information

Extends from Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.TurnTable (Table which turns the track).

Parameters

TypeNameDefaultDescription
Stringprocessor""The processor that will execute the task
Stringcontainer""The task in which the controller will run
Integerpriority1Priority of the task
RealsampleTime0.01Sample time of the task
Realphase0Phase of the task
RealtransportLength2*100Length of the track in pixels
RealtransportTime4Desired time to travel through table length
RealcarLength286Length of the car

Connectors

TypeNameDescription
TableComNexttableComNext 
TableComPrevtableComPrev 

Modelica definition

model TurnTableLeft "Table which turns the track direction eastbound"
  extends Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Interfaces.TurnTable;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComPrev
  tableComPrev;
  Modelica_StateGraph2.Examples.Applications.ProductionLine.Internal.Connectors.TableComNext
  tableComNext;
  Modelica.Blocks.Sources.BooleanExpression Prev_Idle(y=Empty.active);
  Modelica.Blocks.Sources.BooleanExpression Next_Ready(y=Waiting.active);
  Modelica.Blocks.Sources.BooleanExpression Prev_Transport(y=InTransport.active);
  Modelica.Blocks.Logical.Or or1;
  Modelica.Blocks.Sources.BooleanExpression OutTransport_Active(y=OutTransport.active);
Modelica_StateGraph2.Blocks.MathBoolean.ShowValue showValue;
equation 
  carInPosition = pos >= -0.5 and pos < 0.5;

  if InTransport.active or OutTransport.active then
    der(pos) = transportLength/transportTime;
  else
    der(pos) = 0;
  end if;

  if Empty.active then
    rectangle1 = {{-100,46},{100,-46}};
    rectangle2 = {{-46,100},{46,-100}};
    newPoints = [zeros(4),zeros(4)];
  elseif Occupied.active or OutTransport.active then
    rectangle1 = {{-46,100},{46,-100}};
    rectangle2 = {{-100,46},{100,-46}};
    newPoints = {{-50,25},{-50,-25},{50,-25},{50,25}} + pos*[ones(4), zeros(4)];
  else
    rectangle1 = {{-100,46},{100,-46}};
    rectangle2 = {{-46,100},{46,-100}};
    newPoints = {{25,-50},{-25,-50},{-25,50},{25,50}} - pos*[zeros(4), ones(4)];
  end if;

  when Empty.active then
    reinit(pos, -transportLength);
  end when;
connect(OutTransport_Active.y, or1.u1);
connect(Prev_Transport.y, or1.u2);
connect(Next_Ready.y, tableComNext.Ready);

connect(showValue.activePort, or1.y);
connect(Prev_Idle.y, tableComPrev.Idle);
connect(Prev_Transport.y, tableComPrev.Transport);
end TurnTableLeft;

Automatically generated Fri Nov 12 17:26:54 2010.