Developer Portal Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Generating TMC failed

    Generating TMC failed



      One issue I have, after I build PLC program, one error is occurred, 'Generating TMC failed! Object reference not set to an instance of an object'.

    PS: The program is running in the production line, and build it without error in the owner computer, but others' computer has this error.


    2 REPLIES 2

    Community Moderator
    Community Moderator

    Make sure that the "pin version" checkbox is set. Otherwise the project will open with different TwinCAT versions depending on what is installed on your computer.


    Also compare (binary compare, not date compare!) if this folder on both laptops is identical (one can have more libraries than the other, but if they have both the same library versions, the files must be identical):
    C:\TwinCAT\3.1\Components\Plc\Managed Libraries


    If both is fine there were several solutions in the past:

    1. The error is known for some TwinCAT versions with OpconBase/NxBase object <=V1.0.13.0 (library <=V1.0.9.0) and OpconFbpPdpBase/NxFbpPdpBase object <=V2.0.60.0 (library <=V1.0.60.0) . Therefore an update could solve the problem.
    2. Sometimes this also helped: Close TwinCAT > Start an export > Compile PLC project again.

    3. One step further sometimes also helped:
      Close TwinCAT > Delete all Bosch libraries in C:\TwinCAT\3.1\Components\Plc\Managed Libraries > Start an export > Compile PLC project again.
    4. Delete the TMC file in TwinCAT and compile the PLC project (which should re-create the TMC file):
      Hint: If creation of the TMC file still fails, your IO links will be lost after closing TwinCAT.

    5. If you still could not solve it:
      Other libraries could be the causer (usually not the Bosch Connected Industry libraries).
      1. Check for libraries that inlcude a TMC file (which should not be included in libraries):
      2. The library creator must set and afterwards remove the checkbox "Minimize Id changes in TwinCAT files" (1). Then the creator must create a new library version:


    Thank you ^^, it is related pin version with different TwinCAT version