Why do I have a ClassID conflict when I start TwinCAT?

The class ID establishes a unique relationship between the tmc file and the associated real-time driver.

If you have created a TcCOM module from Simulink® with the TE1400 and have instantiated it in a TwinCAT project, the class ID is anchored in the TcCOM instance and the instance expects a corresponding driver with this class ID. Now go back to Simulink® and create a new TcCOM with the same name as the already instantiated module. A new tmc file and new drivers will be stored in the Publish directory with a new class ID. If you now activate the TwinCAT configuration without informing TwinCAT that the class ID has changed, you will see the following behavior:

Behavior for TwinCAT version < 4018:

You will get an error message informing you that the class IDs do not match.

Behavior for TwinCAT version ≥ 4018

The driver from the _ModulInstall project folder, which matches the existing instance in the TwinCAT project, is used. The behavior of the module instance remains unchanged for the TwinCAT project.

Important: The lowest compatible TwinCAT build ≥ 4018 must also be entered under Tc Build in order for the latter behavior to occur. See also Module generation (Tc Build).

Solution:

To be able to use the behavior of the newly generated TcCOM module in your TwinCAT project, you can right-click on the corresponding instance of TcCOM and select TMI/TMC-File -> Reload TMI/TMC File. Now select the tmc file in your Publish directory and confirm with OK. If you call the module from the PLC and have imported the PLCopen.xml file for this purpose, you must reimport it and select Replace the existing object in the dialog box.