Virtual Commisioning of a Production Line


In this module, virtual commissioning is applied on the Lucas Nülle Industrial Mechatronic System (IMS) assembly line.

Table of Contents


Learning Outcome

1.1 Introduction

In the context of virtual commissioning, a physics-based model of the Lucas Nülle assembly line should be created and used to verify the PLC control code.

ln-anlage_

1.2 Requirements

1.3 What You Need

1.3.1 Software

1.3.2 Files

CAD files of the IMS stations of the practical assignment as well as for the examples used can be found here.


Task

The goal of the IMS assembly line is to assemble a product that consists of three parts shown in the following figure. Different stations in the assembly line are responsible for mounting different parts of the product or handling the end product.

The end product consists of a top part, a bottom part, and a bolt that connects both parts.

parts_a_r

Description

The following sections will handle each IMS station. The task is to build a kinematic model in NX MCD and write a control code in TIA Portal for each station. The control code should be uploaded to a simulated PLC, and an OPC-UA connection should be established between the PLC and the kinematic model.


Preparation: Station IMS3

3.1 Goal

3.2 Task

The following questions/tasks will help you get familiar with the functionality of the station:

ims3_prep_parts

3.2.1 Siemens NX MCD

3.2.2 PLC Program


Station IMS3: Practical Assignment

4.1 Goal

4.2 IMS3 Station Functionality

The purpose of the IMS3 station is to mount the base part on the workpiece carrier. The station has a few sensors and actuators, shown in the following figure.

IMS3_assignment_parts

ims3_apng

The guiding magazine in the above figures is blinded out; however, the active collision surfaces assigned to it are shown in pink.

4.3 The Virtual Layer - Mechatronics Concept Designer

Physical properties should be assigned to different parts of the IMS3 station. Open the assembly file called ASSEMBLY_IMS3.prt in Siemens NX and navigate to the Mechatronics Concept Designer application.

4.3.1 Base Part and Workpiece Carrier

The base part (the part being mounted) and the workpiece carrier already have rigid body and collision bodies assigned to them. These objects are assigned at the single part's level. To see the objects, double-click on the respective part in the Assembly Navigator window and navigate to the Physics Navigator window.

Definition of collisions: Two objects collide when they get in contact with and exert forces onto each other. Collisions are part of the station's functionality. In the context of the simulation, collisions do not refer to accidents.

Rigid and Collision Bodies Note: When assigning collision bodies to parts, only sides/areas of the part that will undergo collision during the simulation should be chosen. Avoid defining the entire part as a collision body because it increases the complexity of the body and unnecessarily slows down the simulation.

When assigning collision bodies to parts, try to choose simple geometry (box, cylinder, sphere, area, etc.) if complicated geometry (mesh) is not crucial for the physical behavior of the part.

top_part

Todo:

4.3.2 Conveyor Belt

To simulate a conveyor belt, a rectangular surface will be used as a Transport surface. The band itself will be blinded out while the simulation is running.

Todo:

4.3.3 Mounting Mechanism - Latches

Rigid and Collision Bodies:

A latch prevents the current part from falling and separates parts from the magazine when the mechanism is triggered. Assign a rigid and collision body to the latch. Use the option mesh for the collision body.

ims3_latch

Assign physical properties to the latches on the LM9680_Vereinzeln_SE assembly level. Can mesh be avoided? Try using a simplified collision geometry for the parts of the latch that actually collide.

Joint:

The latch should be allowed to rotate around the bolt on which it is mounted.

Todo:

Angular Spring Joint:

The latch 'latches' back to its original position through an angular spring joint (also known as a simple torsion spring). Assign an Angular Spring Joint to the latch. Set the spring constant to 20 N.mm/°, damping to 0.1 N.mm.s/°, and relaxed position to 30° away from the up-straight adjustment. The following figure shows the angular position of the latch. In a relaxed position (if there were no cylinder to collide with the latch), the latch would be at a 30° angle to the vertical axis. With the cylinder touching the latch, the 30° is never reached. The resulting new angle (marked in blue) is not relevant to setting the parameters of the Angular Spring Joints.

latch_position

To check if the given parameters reflect the intended behavior, one can run the simulation and see how the latches will rest. Always run the simulation on the topmost hierarchy level, i.e., in the IMS3 assembly and not in a sub-assembly.

Running the simulation in a sub-assembly might be handy, but it leads to an OPC UA communication bug. Avoid running the simulation unless it's at the topmost assembly level. If OPC UA communication is not working, see the troubleshooting section on how to fix it.

The angular position of the latch will be physically controlled by the latch cylinder. As the cylinder physically pushes onto the latch, it induces the separating motion for the bottom parts magazined in the part tunnel. As the cylinder retracts back, the latch latches back to its original position under the effect of the torsion springs.

4.3.4 Mounting Mechanism - Cylinders (Latch Cylinders and Stopper Cylinder)

A cylinder is used to push the latch and to perform the separation mechanism. When the cylinder is retracted, the latch swings back to its original positions through a torsion spring attached to it.

ims3_cylinder

The torsion spring is not shown in the CAD Model.

Rigid and Collision Bodies:

Todo:

When assigning rigid bodies to parts, a few parts can be selected together and defined as one collective rigid body. This should be done if those parts will always undergo the same motion together. In the case of the stopper cylinder, the cylinder itself but also the attached rubber object around it can be selected together.

Joints:

Each cylinder should be constrained in all directions but one. Since every rod will only be either driven out or in, a sliding joint should be assigned to each cylinder.

Todo:

As an attachment object, the rods should be chosen. Because the housing of the cylinders will not move during the simulation, the base object can be left unselected. Selecting the housing of the cylinders as the base object is in this case optional.

Make sure to name each of the joints appropriately. For example: Cylinder_SlidingJoint and Stopper_SlidingJoint.

Define a lower limit of 0 and an upper limit of 10. This prevents the physical object from wandering beyond those limits.

Position Control:

To control the position of the object on the sliding joint, position controls have to be assigned to the sliding joint objects.

Todo:

Name the position controls appropriately. For example: Cylinder_PositionControl and Stopper_PositionControl.

Signals:

In order to, in turn, control those position controls through boolean variables from the PLC program later (the goal), one should create signals in MCD and name them appropriately. For example: bStopper_down and bSwings_open.

Only one signal can be responsible for triggering both latches. Therefore, do not create two signals for the two latches, but create one signal to control both of them.

Signal Name Signal Function
bStopper_down Sets the stopper's position control position to 5mm
bSwing_open Sets the latch's position control position to 5mm

Todo:

Do not link the signals to any runtime variables. These signals will trigger operations later.

You can create a symbol table for all of those signals and call it PLCSIM_Advanced. Symbol tables are a good way to arrange and organize signals that are related together. Since these signals will communicate with PLCSIM Advanced, such a name for the symbol table provides clarity.

Operations:

Operations are like if-statements in the MCD simulation. They can be used to trigger something in the simulation if an external (or internal) condition is met.

Todo:

Operations can be found in the Sequence Editor menu on the left.

The selected physics object of the operation is the stopper's position control Stopper_PositionControl. The runtime parameter selected is the position, because this is the parameter to be manipulated by the operation. The new value is inserted in the Value column. Under Condition, the condition object selected is the signal bStopper_down. The if-value of the signal should be set to true.

stopper_operation

The equivalent in C++ would be:

if(bStopper_down == true) {stopper_sliding_position = 5;}

Todo

4.3.5 Sensing Mechanism - Entry and Exit Sensors

Collision Sensor

The IMS3 has entry and exit sensors at the start and end of the conveyor belt (see section on IMS3 Station Functionality). These two sensors will be simulated as two small cubes with collision sensor properties.

When moving an object, clicking on Specify Orientation will enable you to drag on the three axes to move the object.

Signal

For the dummy sensor to send its reading to the PLC, a signal should be created.

It is important to give the signal a clear name. For example: bEnd_limit_switch_right. Where b at the beginning stands for boolean.

The entry sensor is done for now. Later, End_limit_switch_right will be mapped to a PLC signal with the exact same name.

4.4 The Physical Layer – PLC Program

A program to control the IMS3 station can be found in the downloads. In this module, a PLC will be simulated to control the station.

4.4.1 TIA Portal

The following figure shows a state machine diagram for the IMS3 station. This state machine is implemented in the program.

ims3_state_machine

Outputs of the MCD Simulation are inputs of the IMS3 function block, and vice versa. Use the same exact names that are used in the variables in the IMS3 function block in the MCD simulation also. This allows for auto-mapping later.

ims3_fb_vars

4.4.2 PLCSIM Advanced

Make sure the PLC simulated has the same name as the PLC in the TIA Portal program.

Make sure PLCSIM Virtual Eth. Adapter is selected.

In TIA Portal, compile your program and upload it to the simulated PLC.

4.5 Controlling the MCD Application using the PLC Program


Preparation: Station IMS4

5.1 Goal

5.2 Task

The following questions/tasks will help you get familiar with the functionality of the station:

IMS4_parts

5.2.1 Siemens NX MCD

5.2.2 PLC Program


Station IMS4: Practical Assignment

6.1 Goal

6.2 IMS4 Station Functionality

The purpose of the IMS4 station is to mount the top part to the already-existing base part. The bottom part arrives on a workpiece carrier being transported on a conveyor belt. To achieve that purpose, the station uses a few sensors and actuators, shown in the following figure.

ims4_r

The IMS4 station has two latch cylinders. One on each side of the top part being separated.

Latch mechanism

IMS4_4

IMS4_5

The guiding magazine in the above figures is blinded out; however, the active collision surfaces assigned to it are shown in pink.

6.3 The Virtual Layer - Mechatronics Concept Designer

Physical properties should be assigned to different parts of the IMS4 station. Open the assembly file called IMS4.prt in Siemens NX and navigate to the Mechatronics Concept Designer application.

6.3.1 Top Part, Base Part, and Workpiece Carrier

The base part, top part (the part being mounted), and the workpiece carrier already have rigid body and collision bodies assigned to them. These objects are assigned at the single part's level. To see the objects, double-click on the respective part in the Assembly Navigator window and navigate to the Physics Navigator window.

Definition of collisions: Two objects collide when they get in contact with and exert forces onto each other. Collisions are part of the station's functionality. In the context of the simulation, collisions do not refer to accidents.

Rigid and Collision Bodies Note: When assigning collision bodies to parts, only sides/areas of the part that will undergo collision during the simulation should be chosen. Avoid defining the entire part as a collision body because it increases the complexity of the body and unnecessarily slows down the simulation.

When assigning collision bodies to parts, try to choose simple geometry (box, cylinder, sphere, etc.) if complicated geometry (mesh) is not crucial for the physical behavior of the part.

top_part

Todo:

6.3.2 Conveyor Belt

To simulate a conveyor belt, a rectangular surface will be used as a Transport surface. The band itself will be blinded out while the simulation is running.

Todo:

6.3.3 Mounting Mechanism - Latches

Rigid and Collision Bodies:

The latches on both sides are what hold the parts from falling. They also separate the parts in two steps. Because they will collide with the top parts, rigid and collision bodies should be assigned to them. Because the latches' shape is crucial to their functionality, the option mesh should be chosen when assigning collision bodies to both latches.

latches

Assign physical properties to the latches on the LM9681_Montage assembly level. Can mesh be avoided? Try using a simplified collision geometry for the parts of the latch that actually collide.

Joints:

Both latches should be allowed to rotate along the bolts on which they are mounted.

Todo:

Angular Spring Joints:

Each latch 'latches' back to its original position through an angular spring joint (also known as a simple torsion spring). Assign an Angular Spring Joint to each of the latches. Set the spring constant to 20 N.mm/°, damping to 0.1 N.mm.s/°, and relaxed position to 30° away from the up-straight adjustment. The following figure shows the angular position of one latch. In a relaxed position (if there were no cylinder to collide with the latch), the latch would be at a 30° angle to the vertical axis. With the cylinder touching the latch, the 30° is never reached. The resulting new angle (marked in blue) is not relevant to setting the parameters of the Angular Spring Joints.

latch_position

To check if the given parameters reflect the intended behavior, one can run the simulation and see how the latches will rest. Always run the simulation on the topmost hierarchy level, i.e., in the IMS4 assembly and not in a sub-assembly.

Running the simulation in a sub-assembly might be handy, but it leads to an OPC UA communication bug. Avoid running the simulation unless it's at the topmost assembly level. If OPC UA communication is not working, see the troubleshooting section on how to fix it.

The angular position of the latches will be physically controlled by the latch cylinders. As the cylinders physically push onto the latches, they induce the separating motion for the top parts magazined in the part tunnel. As the cylinders retract back, the latches latch back to their original position under the effect of their torsion springs.

6.3.4 Mounting Mechanism - Cylinders (Latch Cylinders and Stopper Cylinder)

Two cylinders are used to move the latches and create the part-separating motion. When the cylinders are retracted, the latches swing back to their original positions through a torsion spring attached to them (not shown in the CAD model).

cylinders

Rigid and Collision Bodies:

Todo:

When assigning rigid bodies to parts, a few parts can be selected together and defined as one collective rigid body. This should be done if those parts will always undergo the same motion together. In the case of the stopper cylinder, the cylinder itself but also the attached gummy object around it can be selected together.

Joints:

Each cylinder should be constrained in all directions but one. Since every cylinder will only be either driven out or in, a sliding joint should be assigned to each cylinder.

Todo:

As an attachment object, the cylinder itself should be chosen. Because the housing of the cylinders will not move during the simulation, the base object can be left unselected. Selecting the housing of the cylinders as the base object is in this case optional.

Make sure to name each of the joints appropriately. For example: Latch_1_SlidingJoint, Latch_2_SlidingJoint, and Stopper_SlidingJoint.

Define a lower limit of 0 and an upper limit of 10. This prevents the physical object from wandering beyond those limits.

Position Control:

To control the position of the object on the sliding joint, position controls have to be assigned to the sliding joint objects.

Todo:

Name the position controls appropriately. For example: Latch_1_PositionControl, Latch_2_PositionControl, and Stopper_PositionControl.

Signals:

In order to, in turn, control those position controls through boolean variables from the PLC program later (the goal), one should create signals in MCD and name them appropriately. For example: bStopper_down and bSwings_open.

Only one signal can be responsible for triggering both latches. Therefore, do not create two signals for the two latches, but create one signal to control both of them.

Screenshot%202025-07-09%20at%2010.20.10

Todo:

Do not link the signals to any runtime variables. These signals will trigger operations later.

You can create a symbol table for all of those signals and call it PLCSIM_Advanced. Symbol tables are a good way to arrange and organize signals that are related together. Since these signals will communicate with PLCSIM Advanced, such a name for the symbol table provides clarity.

Operations:

Operations are like if-statements in the MCD simulation. They can be used to trigger something in the simulation if an external (or internal) condition is met.

Todo:

Operations can be found in the Sequence Editor menu on the left.

The selected physics object of the operation is the stopper's position control Stopper_PositionControl. The runtime parameter selected is the position, because this is the parameter to be manipulated by the operation. The new value is inserted in the Value column. Under Condition, the condition object selected is the signal bStopper_down. The if-value of the signal should be set to true.

stopper_operation

The equivalent in C++ would be:

if(bStopper_down == true) {stopper_sliding_position = 5;}

Todo

6.3.5 Sensing Mechanism - Entry and Exit Sensors

Collision Sensor

The IMS4 has entry and exit sensors at the start and end of the conveyor belt (see section on IMS4 Station Functionality). These two sensors will be simulated as two small cubes with collision sensor properties.

When moving an object, clicking on Specify Orientation will enable you to drag on the three axes to move the object.

Signal

For the dummy sensor to send its reading to the PLC, a signal should be created.

It is important to give the signal a clear name. For example: bEnd_limit_switch_right. Where b at the beginning stands for boolean.

The entry sensor is done for now. Later, End_limit_switch_right will be mapped to a PLC signal with the exact same name.

6.4 The Physical Layer – PLC Program

A program to control the IMS4 station can be found in the downloads. In this module, a PLC will be simulated to control the station.

6.4.1 TIA Portal

The following figure shows a state machine diagram for the IMS4 station. This state machine is implemented in the program.

ims4_state_machine

Outputs of the MCD Simulation are inputs of the IMS4 function block, and vice versa. Use the same exact names that are used in the variables in the IMS4 function block in the MCD simulation also. This allows for auto-mapping later.

ios

6.4.2 PLCSIM Advanced

Make sure the PLC simulated has the same name as the PLC in the TIA Portal program.

Make sure PLCSIM Virtual Eth. Adapter is selected.

In TIA Portal, compile your program and upload it to the simulated PLC.

6.5 Controlling the MCD Application using the PLC Program


Preparation: Station IMS5

7.1 Goal

7.2 Task

The following questions/tasks will help you get familiar with the functionality of the station:

IMS5_parts

7.2.1 Siemens NX MCD

7.2.2 PLC Program


Station IMS5: Practical Assignment

8.1 Goal

8.2 IMS5 Station Functionality

The purpose of the IMS5 station is to insert a bolt that connects the top part and the bottom part together. Both parts arrive on the workpiece carrier that is transported on a conveyor belt. The station uses a few sensors and actuators shown in the following figure.

ims5_assignment_parts

A left end limit switch exists on the left end of the conveyor belt.

ims5_apng

The guiding magazine in the above animation is blinded out; however, the active collision surfaces assigned to it are shown in pink.

8.3 The Virtual Layer - Mechatronics Concept Designer

Physical properties should be assigned to different parts of the IMS5 station. Open the assembly file called ASSEMBLY_IMS5.prt in Siemens NX and navigate to the Mechatronics Concept Designer application.

8.3.1 Top Part, Base Part, Bolt, and Workpiece Carrier

The base part, top part, bolt (the part being mounted), and the workpiece carrier already have rigid body and collision bodies assigned to them. These objects are assigned at the single part's level. To see the objects, double-click on the respective part in the Assembly Navigator window and navigate to the Physics Navigator window.

The definition of collisions: Two objects collide when they get in contact with and exert forces onto each other. Collisions are part of the station's functionality. In the context of the simulation, collisions do not refer to accidents.

Rigid and Collision Bodies Note: When assigning collision bodies to parts, only sides/areas of the part that will undergo collision during the simulation should be chosen. Avoid defining the entire part as a collision body because it increases the complexity of the body and unnecessarily slows down the simulation.

When assigning collision bodies to parts, try to choose simple geometry (box, cylinder, sphere, etc.) if complicated geometry (mesh) is not crucial for the physical behavior of the part.

top_part

Todo:

8.3.2 Conveyor Belt

To simulate a conveyor belt, a rectangular surface will be used as a transport surface. The band itself will be blinded out while the simulation is running.

Todo:

8.3.3 Mounting Mechanism - Cylinders (Mounting Cylinder and Stopper Cylinder)

A pneumatic cylinder is used to push the bolt into the other pieces. Another cylinder is used as a stopper for the workpiece carrier.

Rigid and Collision Bodies:

Todo:

When assigning rigid bodies to parts, a few parts can be selected together and defined as one collective rigid body. This should be done if those parts will always undergo the same motion together. In the case of the stopper cylinder, the cylinder itself but also the attached gummy object around it can be selected together.

Joints:

Each cylinder rod should be constrained in all directions but one. Since every cylinder will only be either driven out or in, a sliding joint should be assigned to each cylinder rod.

Todo:

As an attachment object, the cylinder's rod should be chosen. Because the housing of the cylinders will not move during the simulation, the base object can be left unselected. Selecting the housing of the cylinders as the base object is in this case optional.

Make sure to name each of the joints appropriately. For example: Cylinder_SlidingJoint and Stopper_SlidingJoint.

Define a lower limit of 0 and an upper limit of 10. This prevents the physical object from wandering beyond those limits.

Position Control:

To control the position of the object on the sliding joint, position controls have to be assigned to the sliding joint objects.

Todo:

Note: Name the position controls appropriately. For example: Cylinder_PositionControl and Stopper_PositionControl.

Signals:

In order to, in turn, control those position controls through boolean variables from the PLC program later (the goal), one should create signals in MCD and name them appropriately. For example: bStopper_down and bCylinder_out.

Screenshot%202025-07-09%20at%2010.27.19

Todo:

Do not link the signals to any runtime variables. These signals will trigger operations later.

You can create a symbol table for all of those signals and call it PLCSIM_Advanced. Symbol tables are a good way to arrange and organize signals that are related together. Since these signals will communicate with PLCSIM Advanced, such a name for the symbol table provides clarity.

Operations:

Operations are like if-statements in the MCD simulation. They can be used to trigger something in the simulation if an external (or internal) condition is met.

Todo:

Operations can be found in the Sequence Editor menu on the left.

The selected physics object of the operation is the stopper's position control Stopper_PositionControl. The runtime parameter selected is the position; this is the parameter to be manipulated by the operation. The new value is inserted in the Value column. Under Condition, the condition object selected is the signal bStopper_down. The if-value of the signal should be set to true.

stopper_operation

The equivalent in C++ would be:

if(bStopper_down == true) {stopper_sliding_position = 5;}

Todo

8.3.4 Sensing Mechanism - Entry and Exit Sensors

Collision Sensor

The IMS5 has entry and exit sensors at the start and end of the conveyor belt (see section on IMS5 Station Functionality). These two sensors will be simulated as two small cubes with collision sensor properties.

When moving an object, clicking on Specify Orientation will enable you to drag on the three axes to move the object.

Signal

For the dummy sensor to send its reading to the PLC, a signal should be created.

It is important to give the signal a clear name. For example: bEnd_limit_switch_right. Where b at the beginning stands for boolean.

The entry sensor is done for now. Later, End_limit_switch_right will be mapped to a PLC signal with the exact same name.

8.4 The Physical Layer – PLC Program

A program to control the IMS5 station can be found in the downloads. In this module, a PLC will be simulated to control the station.

8.4.1 TIA Portal

The following figure shows a state machine diagram for the IMS5 station. This state machine is implemented in the program.

ims5_state_machine

Outputs of the MCD Simulation are inputs of the IMS5 function block, and vice versa. Use the same exact names that are used in the variables in the IMS5 function block in the MCD simulation also. This allows for auto-mapping later.

ims5-fb-vars

8.4.2 PLCSIM Advanced

Make sure the PLC simulated has the same name as the PLC in the TIA Portal program.

Make sure PLCSIM Virtual Eth. Adapter is selected.

In TIA Portal, compile your program and upload it to the simulated PLC.

8.5 Controlling the MCD Application using the PLC Program


Preparation: Station IMS7

9.1 Goal

9.2 Task

The following questions/tasks will help you get familiar with the functionality of the station:

ims7_parts

9.2.1 Siemens NX MCD

9.2.2 PLC Program


Station IMS7: Practical Assignment

10.1 Goal

10.2 IMS7 Station Functionality

The purpose of the IMS7 station is to pick-and-place the end-product from the assembly line onto an outside platform. It does so by using a vacuum gripper and a rotating arm to lift the end-product and re-place it on the platform. The station has a few sensors and actuators, shown in the following figure.

IMS7_assignment_parts

ims7_apng

10.3 The Virtual Layer - Mechatronics Concept Designer

Physical properties should be assigned to different parts of the IMS7 station. Open the assembly file called ASSEMBLY_IMS7.prt in Siemens NX and navigate to the Mechatronics Concept Designer application.

10.3.1 Top Part, Base Part, Bolt, and Workpiece Carrier

Assign rigid bodies to all parts that are going to move/collide during the simulation of the station. All parts that will not move/collide during the simulation should be ignored.

Rigid and Collision Bodies

Todo:

When assigning rigid bodies to parts, a few parts can be selected together and defined as one collective rigid body. This should be done if those parts will always undergo the same motion together.

When assigning collision bodies to parts, only sides/areas of the part that will undergo collision during the simulation should be chosen. Avoid defining the entire part as a collision body because it increases the complexity of the body and unnecessarily slows down the simulation.

When assigning collision bodies to parts, try to choose simple geometry (box, cylinder, sphere, etc.) if complicated geometry (mesh) is not crucial for the physical behavior of the part.

top_part

Todo:

10.3.2 Conveyor Belt

To simulate a conveyor belt, a rectangular surface will be used as a Transport surface. The band itself will be blinded out while the simulation is running.

Todo:

10.3.3 Pick and Place Mechanism

Rigid and Collision Bodies:

The entire arm rotates to bring the end-product to the specified platform. Because all components of the arm undergo the same motion together at all times during the simulation, they should be defined as a unified rigid body.

ims7_rot_arm

Because the cylinder's rod will undergo a different motion than the rest of the arm, it should not be included in the same rigid body definition. The cylinder's rod should be defined as its own rigid body.

ims7_gripper_rod

Todo:

Joints:

Todo:

Does the base object have to be specified in both cylinder's cases? Why or why not?

Special Joint Case: Vacuum Gripper

A fixed joint should be created between the gripper and the top part being picked up. Because those two parts belong to different sub-assemblies, only the base of the fixed joint (the gripper) should be given when creating the fixed joint. The attachment of the fixed joint (the product) should be assigned to the fixed joint later during the simulation using an operation. The top part is connected to the bottom part through a magnetic contact in addition to the bolt. The magnetic contact will also be simulated using a fixed joint.

Todo:

Todo:

Position Controls:

Todo:

Signals:

Todo:

Operations:

Operations are like if-statements in the MCD simulation. They can be used to trigger something in the simulation if an external (or internal) condition is met.

Operations can be found in the Sequence Editor menu on the left.

Todo:

The selected physics object of the operation is the stopper's position control. The runtime parameter selected is the position, because this is the parameter to be manipulated by the operation. The new value is inserted in the Value column. Under Condition, the condition object selected is the signal that was created to control the stopper.

stopper_operation

The equivalent in C++ would be:

if(bStopper_down == true) {stopper_sliding_position = 5;}

Todo

10.3.4 Sensing Mechanism - Entry and Exit Sensors

Collision Sensor

The IMS7 has entry and exit sensors at the start and end of the conveyor belt (see section on IMS7 Station Functionality). These two sensors will be simulated as two small cubes with collision sensor properties.

When moving an object, clicking on Specify Orientation will enable you to drag on the three axes to move the object.

Signal

For the dummy sensor to send its reading to the PLC, a signal should be created.

It is important to give the signal a clear name. For example: bEnd_limit_switch_right. Where b at the beginning stands for boolean.

The entry sensor is done for now. Later, End_limit_switch_right will be mapped to a PLC signal with the exact same name.

10.4 The Physical Layer – PLC Program

A program to control the IMS7 station can be found in the downloads. In this module, a PLC will be simulated to control the station.

10.4.1 TIA Portal

The following figure shows a state machine diagram for the IMS7 station. This state machine is implemented in the program.

ims7_state_machine

Outputs of the MCD Simulation are inputs of the IMS7 function block, and vice versa. Use the same exact names that are used in the variables in the IMS7 function block in the MCD simulation also. This allows for auto-mapping later.

ims7-fb-vars

10.4.2 PLCSIM Advanced

Make sure the PLC simulated has the same name as the PLC in the TIA Portal program.

Make sure PLCSIM Virtual Eth. Adapter is selected.

In TIA Portal, compile your program and upload it to the simulated PLC.

10.5 Controlling the MCD Application using the PLC Program


11. Summary

The virtual commissioning of an entire production line is a process that takes effort to achieve but reduces the overall project time through early verification of the control code.

After simulating each station and testing the individual code, the next step would be to combine all stations in one whole simulation of the entire production line. Likewise, the individual codes should also be combine and the entire setup should be tested for further bugs. Bringing us a step closer to a more confident real commissioning with the real hardware.


Troubleshooting

12.1 OPC UA Communication Troubleshooting

Runtime Error: Cannot Connect to This OPC Server

If upon starting the simulation the above error shows up, navigate to External Signal Configuration in the Automation tab. The connection status of the OPC Server has to be 'connected'. If the status is 'connected', click OK and try running the simulation again. If the status is 'unknown', click on Refresh Server Status. This may change the status back to 'connected' and the simulation will then run.

Green Tick is Missing; Cannot Choose External Variables in External Signal Configuration

If this is the case, close all open assemblies and restart Siemens NX.

OPC UA Communication Connected but Variables Do Not Get Updated During the Simulation #1

If the OPC UA communication is successful and mapping is done correctly, but the variables do not get updated through OPC UA in either direction (i.e., both inputs and outputs do not respond), then a certain part or sub-assembly is causing this problem. The solution is to start rebuilding the current main assembly in a new file and adding each part one by one, testing the OPC UA connection after adding each part. This way, you will be able to spot the part and/or assembly that is causing the communication issue.

If the cause of the issue is a sub-assembly, create a new sub-assembly with a different name and import all parts of the old sub-assembly into it. Use the new assembly instead of the old one. This should allow the communication to function.

If the cause of the problem is a part, reconstruct the part in a new file and use the new part (copying the old part into a new file does not resolve the problem).

OPC UA Communication Connected but Variables Do Not Get Updated During the Simulation #2

If the OPC UA communication was running perfectly but all of a sudden the variables stop responding, this may be caused by running a simulation only on a sub-assembly or part level. Undoing the past 3 steps and reselecting the main assembly then running the simulation will undo this problem.

Siemens NX MCD offers the possibility to run simulations on the sub-assembly or part level. This is helpful to see how only one part will be simulated without simulating the entire assembly. However, it is recommended to run the simulation only on the main assembly level because of this OPC UA communication bug.

Only Some Variables Are Updated Through OPC UA

This issue occurs when communicating with a PLC program over OPC UA.

In case the OPC UA communication seems to function with only some variables and with other variables it seems to be down, make sure that the variables being transferred over OPC UA are declared in a function block in the PLC program and not mapped directly to a PLC I/O module.

12.2 PLCSIM Advanced V2.0 Troubleshooting

PLC Instance Cannot Be Started: License Could Not Be Found

If the simulation instance of a PLC does not run, open PLCSIM Advanced as an administrator and try again.