Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


TCPlcLibSystemC69xx_Overview

TwinCAT PLC Library: SystemC69xx

Overview

This library contains functions and function blocks which are using special features of the PC C69xx.

Functions

Name | Description
F_GetVersionTcSystemC69xx | The function returns library version info.

Functionblocks

Name | Description
FB_C69xxSetLedColor | change the USER-LED color of the C69xx
FB_C69xxSetWatchdog | activates/deactivates hardware watchdog (auto-reboot of C69xx-PC in case of PLC problems)

Requirements

Component | Version
TwinCAT on the development PC | 2.9 Build 959 or higher
CX1030-Windows CE-Image | 2.04 or higher
CX1030-Windows XP-Image | 1.30 or higher


FUNCTION F_GetVersionTcSystemC69xx

The function returns library version info.

FUNCTION F_GetVersionTcSystemC69xx : UINT

VAR_INPUT
    nVersionElement : INT;
END_VAR

nVersionElement : Version element:

  • 1 : major number;
  • 2 : minor number;
  • 3 : revision number;
Development environment | Target plattform | PLC Libraries to include
TwinCAT v2.9.0 | PC (i386) | TcSystemC69xx.Lib


FUNCTION_BLOCK FB_C69xxSetLedColor

The function block FB_C69xxSetLedColor can be used to change the color of the User-LED off the C69xx. The LED color is changed with a rising edge on bExecute and new color in eNewColor. The LED can be switched off (eNewColor = eULED_Off) or to red (eNewColor = eULED_Red), blue (eNewColor = eULED_Blue) or green (eNewColor = eULED_Green).

TYPE E_UserLED_Color : (
eULED_Off := 0,
eULED_Red := 1,
eULED_Blue := 2,
eULED_Green := 3
);
END_TYPE

FUNCTION_BLOCK FB_C69xxSetLedColor

VAR_INPUT

VAR_INPUT
    bExecute		: BOOL;
    eNewColor		: E_UserLED_Color;
END_VAR

bExecute : With a rising edge on bExecute the new color is set.

eNewColor : New LED color

VAR_OUTPUT

VAR_OUTPUT
    eLastSetColor	: E_UserLED_Color;
    bError 		: BOOL;
END_VAR

eLastSetColor : Last LED color that was set using this FB.

bError : Error when activate or deactivate the watchdog.


FUNCTION_BLOCK FB_C69xxSetWatchdog

The function block FB_C69xxSetWatchdog activates a hardware watchdog on the C69xx-PC. The watchdog is enabled with bEnable = TRUE and a timeout time. The minimum timeout time is 2 seconds, the maximum timeout time is 255 seconds.

Once the watchdog is activated, the function block instance has to be called cyclically, because if the tTimeOut-time expires then the C69xx-PC automatically reboots. The watchdog can be used to reboot the system if the PLC gets stuck (i.e. in an endless loop).

The watchdog can be disabled by bEnable = FALSE.

Attention:
The Watchdog has to be disabled before using breakpoints, before a PLC reset or PLC reset all, before a TwinCAT Stop, a change to Config Mode or before activating the configuration, otherwise the C69xx-PC reboots immediately after the timeout time has expired!

FUNCTION_BLOCK FB_C69xxSetWatchdog

VAR_INPUT

VAR_INPUT
    tTimeout		: TIME;
    bEnable 		: BOOL;
END_VAR

tTimeOut : Watchdog time, if expired a reboot is automatically executed.

bEnable : Activate or deactivate the watchdog.

VAR_OUTPUT

VAR_OUTPUT
    bEnabled 		: BOOL;
    bError 		: BOOL;
END_VAR

bEnabled : TRUE = Watchdog is activated, FALSE = Watchdog is not activated.

bError : Error when activate or deactivate the watchdog.