TSM_E_INVALIDITEMTYPE

Invalid Tree Item Type for Operation

Beckhoff · TwinCAT 2 Automation Interface

What does TSM_E_INVALIDITEMTYPE mean?

One or both of the specified tree items are not valid for the attempted operation (0x98510002). For LinkVariables() or UnlinkVariables(), this means one or both tree items are not of a variable type, preventing linkage operations.

Common Causes

  • Attempted to perform an operation on an item with an incompatible data type.
  • Trying to write a value to a read-only TwinCAT variable.
  • Interfacing with a sensor or actuator that expects a different communication protocol.

Repair Steps & Checklist

Click steps to track your progress.

  1. 1

    Verify that bstrV1 and bstrV2 arguments refer specifically to variables, not other TwinCAT configuration items.

  2. 2

    Check the ItemType property of the identified tree items to ensure they are recognized as a variable type.

  3. 3

    Adjust the automation script to target correct variable paths for linking or unlinking.

Browse all codes in this manual (12)
Verified technical data. Last updated: March 2026

Related Faults

Source: Beckhoff TwinCAT 2 Automation Interface