Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    TwinCAT PLC Change Guide [English]

    English 🠦 Deutsch

     

    We have encountered several problems when changing a TwinCAT PLC software application on a machine. This guide is highly recommended for machines where production downtime/delay is critical or where high material damage is possible, for example due to high energies or expensive products.

    Known problems:

    • Page Fault Exception 1: Occurs in the OpconBase library directly after PLC start
    • Page Fault Exception 2: Occurs in the OpconBase library when operating the HMI (e.g. acknowledge error or click button)
    • IO problem: Occurs directly or some time after any change. Individual PLC outputs have a different value on the bus than in the PLC, as a result of which the machine does not do what the PLC specifies, e.g. moving to an incorrect axis target position, incorrect control of a valve, etc.
    • IO problem: Occurs directly or some time after any change. Individual PLC inputs arrive incorrectly in the PLC, resulting in incorrect processing/reaction of the PLC, e.g. incorrect actual axis position, incorrect sensor signal, etc.
    • OPC UA problem: TMC file missing or not up to date, resulting in OPC UA communication not possible after system restart (e.g. data loading with DataSetAccess)
    • DatAccess.exe error: Data from DAT file cannot be loaded into the PLC when DatAccessAddon is triggered (PLC start or operation mode changeover), error message "DatAccess.exe: Error while writing dataset 1111111111.dat into PLC"
    • DatAccess.exe problem: Online data in PLC does not match data from DAT file after PLC start
    • Boot project problem: No boot project or an old boot project is started at the next system start
    • Lost library parameters: After passing on a project and installing the missing library on this development computer, project-specific changed library parameters are lost
    • Lost code changes: After closing and opening a project, previously changed code is gone again
    • TwinCAT 4020 problems: Incorrect processing of IF conditions and sagging of IndraDrive Z-axes

     

    Guide for error-free modification of the PLC application:

    Skipping individual steps can lead to one of the problems mentioned above!

    1. [TwinCAT 4020 problems]
      Use at least Master Image version 2.12 with TwinCAT 3.1.4020.

    2. [Lost library parameters]
      There is no solution for TwinCAT 4024 yet. The problem is not known under TwinCAT 4022.
      Use TwinCAT 3.1.4020.28 to ensure that the Bosch patches have been applied to the development computer.
      Deploy the patches via Nexeed.Helpdesk@bosch.com or via the Bosch internal repository:
      \\bosch.com\dfsrb\DfsDE\DIV\BCI\Nexeed\Automation\ControlPlus\Common\TwinCAT3\4020.28\Bugfix\XAE-Pat...

    3. [Lost code changes]
      There is no solution for TwinCAT 4020 yet.
      From TwinCAT 4024.22 and newer, you must pay attention when closing tabs in TwinCAT:
      If you discard unsaved changes, only the code from the closed tab is discarded. If there were other unsaved changes in the same POU, these are now kept temporarily saved in the editor and end up in the compilation, that means also on the machine or in a library. However, this code is missing at file level, meaning that the compilation and project archive are not consistent. The code is irrevocably lost once the project is closed. It should be noted that the project comparison with the target system also displays incorrect information as a result.
      As of TwinCAT 4024.22, you should therefore never click "No" in this dialog if there are other unsaved changes in the same POU:
      SteffenR_0-1713468027409.pngSteffenR_1-1713468033839.png

    4. [IO problem + OPC UA problem + Boot project problem]
      Check PLC project settings, as these are lost with the "Update PlcProject from Target" function:
      1. TMC file must be ticked:
        SteffenR_0-1703158418682.png
      2. Delete all OCM files in the boot folder on the target system, e.g.
        C:\TwinCAT\3.1\Boot\Plc\Port_851.ocm
        Delete all OCM files in the project folder on your development system, e.g.
        <Stat000>\Plc\_Boot\TwinCAT RT (x64)\Plc\Port_851.ocm
        The files only exist if symbolic mapping was activated in the past.
      3. Tick Autostart Boot Project and remove Symbolic Mapping:
        SteffenR_1-1703158418683.png
        This change must be saved with "Save project" when PlcProject is selected. If "Save all" is used instead or you compile directly, TwinCAT sets the tick again (TwinCAT bug).
      4. Continue with the next section. If a tick has been changed in this section, an Activate Configuration is required in the next sections.

    5. [Page Fault Exception 1]
      Has the standard (Std) been updated, a library version updated or a library parameter changed?
      If no, skip this section.
      1. Confirm the change of a library parameter with the Enter key so that the disc symbol of the PLC project then turns red:
        SteffenR_2-1703158418685.png
      2. Save the entire project so that all disc symbols are black. If disc symbols are missing, adjust the "Independent Project File" setting.
        SteffenR_3-1703158418685.png
      3. Execute Clean Project successfully:
        SteffenR_4-1703158418686.png
      4. Close all HMI instances (on target system, mPad, laptop, etc.).
        In the case of the mPad hotplug, also close the command line so that the HMI is not restarted automatically.
      5. Execute Activate Configuration; no online change and no download.
        SteffenR_5-1703158418686.png
      6. Continue with the next section.

    6. [Page Fault Exception 2 + Boot project problem + DatAccess.exe error + DatAccess.exe problem]
      Perform software change:
      1. Terminate all HMI instances (on target system, mPad, laptop, etc.).
        In case of the Hotplug mPad, also close the command line so that the HMI is not restarted automatically.
      2. Close at DatAccess.exe on the target system (yellow icon in the Windows taskbar:SteffenR_6-1703158418686.png).
      3. Execute the software change as desired with Online Change, Download or Activate Configuration.
        For Download or Online Change, tick the box for Boot project:
        SteffenR_7-1703158418686.png
        If this additional dialogue appears during an online change, it should be cancelled with No and a download should be made instead:
        SteffenR_8-1703158418687.png
        If this dialogue appears instead of the login dialogue, cancel with No and execute Activate Configuration instead:
        SteffenR_9-1703158418694.png
      4. Wait until the PLC is back in RUN mode (green TwinCAT icon).
      5. Restart DatAccess.exe on the target system, for example via
        C:\OpconApp\OpconSystemStartup.bat or
        C:\OpconApp\StartDatAccess.bat or
        C:\OpconApp\DatAccess\DatAccess.exe
      6. Restart HMI on the target system, etc., for example via
        C:\OpconApp\OpconSystemStartup.bat or
        C:\OpconApp\StartHmi.bat

    7. [Boot project problem, formerly also IO Problem]
      Restart TwinCAT to test boot project.
      As long as the "Symbolic Mapping" checkbox was ticked, this step also had to be carried out to prevent the IO problem. This is no longer necessary if symbolic mapping is deactivated.
      1. Click green TwinCAT icon in Visual Studo / TcXaeShell to restart.
        SteffenR_10-1703158418694.png
        Alternatively, execute Start/Restart on the target system via the TwinCAT icon in the Windows taskbar or restart Windows on the target system or switch the main switch of the machine off/on.
        SteffenR_11-1703158418695.png

     

    The problems are confirmed with the following TwinCAT Runtime (XAR) versions:

    • Page Fault Exception 1+2: all TwinCAT versions (currently 4020.28 to 4024.47)
    • IO problem: 4022.30, 4022.32, 4024.12, 4024.29
    • OPC UA problem: 4022.30, 4024.47 (but probably all)
    • DatAccess.exe error: 4022.30 (but probably all)
    • DatAccess.exe problem: 4022.30 (but probably all)
    • Boot project: 4022.30 (probably more versions)
    • Lost library parameters: 4020.28, 4024.22 and newer
    • Lost code changes: 4020.28, 4024.29/32
    • TwinCAT 4020 problems: 4020.28

     

    Screenshots to visualise the problems:

    • OpconBase Page Fault Exception:
      Page Fault Exception in the OpconBase library in any library method, frequently occurring immediately after PLC start:
      Extension._panelSwitch
      SqC_Run.Work
      Addon._stdExecFsm;
      frequently occurring after message acknowledgement in the HMI:
      InfoStorage.xxx
      WarningStorage.xxx
      ErrorStorage.xxx
      SteffenR_12-1703158418696.pngSteffenR_13-1703158418696.png
      SteffenR_14-1703158418698.png

    • IO Problem:
      • PLC sets axis target position to 2105mm:
        SteffenR_15-1703158418714.png
        Only a 0 arrives on the bus and the drive actually moves to position 0mm (if no limit switches are present):
        SteffenR_16-1703158418729.png

      • PLC variable with axis target speed 60mm/s:
        SteffenR_17-1703158418738.png
        Linked bus symbol contains value -1033371648, which arrived on the drive as approx. 300,000mm/s:
        SteffenR_18-1703158418747.png

      • Drive has positioned successfully and sets the status word accordingly:
        SteffenR_19-1703158418749.png
        A different value arrives in the PLC, which is why the axis object remains stuck in ExecState RUNNING:
        SteffenR_20-1703158418751.png

      • The PLC sets an output (valve for gripper) permanently to TRUE (gripper closed), but the value on the bus keeps changing to 0 at runtime, causing the gripper to open and drop the workpiece:
        (open video 1 in new window or open video 2 in new window)
        SteffenR_22-1703158418784.png

    • DatAccess problem:
      Individual values are incorrect in the PLC, although the data was loaded successfully. This variable is not intentionally written to anywhere in the application.
      SteffenR_0-1703163002692.png

    • This faulty TwinCAT function deletes the TMC tick. This function is used to update the PLC project on the development computer with the version stored on the target system, e.g. to undo changes on the development computer.
      SteffenR_23-1703158418786.png
      Alternatively, this error-free function can be used:
      SteffenR_24-1703158418788.png
    Version history
    Last update:
    3 weeks ago
    Updated by:
    Contributors
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist