Developer Portal Community

    We are still working on migrating to the new Bosch Connected Industry Online Portal. Stay tuned! Click here for the latest updates.

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    TwinCAT PLC Change Guide [English]

    English 🠦 Deutsch

     

    Bosch Connected Industry has encountered several problems when changing a TwinCAT PLC software application with Nexeed Control plus 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 (see also fix Page Fault Exception after occurrence)
    • Page Fault Exception 2: Occurs in the OpconBase library when operating the HMI, e.g. acknowledge error or click button (see also fix Page Fault Exception after occurrence)
    • 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 (SFC): After closing and opening a project, previously changed code or graphical SFC changes are restored to the old state, the changes are lost
    • Lost code changes (after closing without saving): After closing and opening a project, previously changed code is back to the old state, the changes are lost
    • Invalid breakpoints: In some lines, no breakpoint can be set despite valid code or the breakpoint positions are shifted compared to the code
    • 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]
      Under TwinCAT 4024 it does not seem to be a general problem, but a project-specific one. 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]
      The behavior is identical for both problems: Editor content and compilation do not correspond to the file content.
      Spoiler
      The ST code or the SFC step chain that is displayed and compiled in the editor no longer corresponds to the status at file level. Compilation and file are inconsistent. The project archive on the target system is based on file level, so that the project comparison with the target system also displays incorrect information. After closing the project, the changes made in the editor are irrevocably lost. When the project is opened, the file content is loaded in which the last changes made are missing, e.g. newly inserted steps are missing, deleted steps are present again, changes in transitions are lost, ST code in actions or methods are lost, etc.
      1. With TwinCAT 4024 and 4020.28, in rare cases changes in individual SFC step chains are no longer saved at file level from an unknown point in time. A cause or solution is not yet known.
      2. With all TwinCAT versions it should be noted: If several methods or actions in a POU (FB) have unsaved changes, a save dialog appears when any element is closed. You should not click Yes and No differently for elements within a POU. From the first "Yes", all other elements are also saved in the background, but are still displayed as unsaved in the editor.
      3. With TwinCAT 4024.22 to 4024.58, you must never click "No" in this dialog if there are other unsaved changes in the same POU:
        SteffenR_0-1713468027409.pngSteffenR_1-1713468033839.png
        If you click on No, other changes from this point onwards will only be displayed as saved in the editor and will end up in the compilation, but will not be saved at file level and will therefore be lost after the project is closed.

    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. Remove the "Symbolic Mapping" checkbox and check the "Autostart Boot Project" checkbox when connected to the target system:
        SteffenR_1-1703158418683.png
        Important until 4024.59: 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.
      3. If the "Symbolic Mapping" checkbox has been removed, additional security measure:
        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
      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

    8. [Invalid breakpoints]
      Despite valid code, no breakpoint can be set in some lines of code. Conversely, a breakpoint may be set in empty code lines. In our experience so far, this is only a display/editor problem and the code is still processed correctly.
      SteffenR_0-1726066695499.png
      1. If the problem occurs, a code change must be made somewhere in the affected implementation part, which must be transferred to the target system. An online change according to this guideline may be sufficient for this, e.g. with a simple assignment _retVal:=_retVal or _idx:=_idx.

     

    The problems were observed by Bosch Connected Industry with the following TwinCAT versions or the following versions are affected:

    • 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.32 (maybe project-specific constellation)
    • Lost code changes (SFC): 4020.28, 4024.47 (probably more versions)
    • Lost code changes (after closing without saving): 4024.22 to 4024.58
    • Invalid breakpoints: 4020.28, 4022.30, 4024.47, 4024.55 (but probably all)
    • 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

    • Missing or shifted breakpoint positions:
      SteffenR_1-1726067084967.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:
    ‎09-12-2024 12:36 PM
    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