Академический Документы
Профессиональный Документы
Культура Документы
lib library
Table of Contents
1 The Festo_CPX.lib library .................................................................................................................. 1
1.1 Overview ...................................................................................................................................... 1
1.1.1 Architecture .................................................................................................................... 1
1.1.2 Diagnosis ....................................................................................................................... 1
1.1.3 CPX error handling ........................................................................................................ 1
1.1.4 CPX system functions .................................................................................................... 1
1.1.5 CPX auxiliary functions .................................................................................................. 1
1.1.6 Designated use .............................................................................................................. 2
1.1.7 Target group ................................................................................................................... 2
1.1.8 Service ........................................................................................................................... 2
1.2 Safety instructions ........................................................................................................................ 3
1.3 Function blocks for diagnosis ....................................................................................................... 4
1.3.1 Inputs and outputs of the function blocks ....................................................................... 4
1.3.2 Handling function blocks ................................................................................................ 5
1.4 Function blocks for system functions ......................................................................................... 10
1.4.1 Inputs and outputs of the system function blocks ......................................................... 10
1.4.2 Example for parameterising a CPX module ................................................................. 12
1.5 Function blocks for error handling .............................................................................................. 13
ii
1 The Festo_CPX.lib library
1.1 Overview
Festo_CPX.lib is an internal library for CoDeSys 2.3. This library supports the specific functionality of the
CPX valve terminal such as parameterisation and diagnosis.
1.1.1 Architecture
The Festo_CPX.lib library is implemented entirely in IEC code. Functions that require implementation in
the real-time system are implemented in the Festo_CPX_extern.lib library.
This library is loaded automatically when the Festo_CPX.lib is appended. The library is hidden and
therefore does not appear in the library manager.
The library also uses the system library SysLibPLCConfig.lib.
For new projects, integrate Festo_CPX.lib using the CoDeSys function [Library manager]
[Additional libraries].
1.1.2 Diagnosis
Modules for modelling general CPX functions are stored in the 'Diagnostics' folder. The diagnosis includes
real-time diagnosis and reading out the error memory. All diagnostic information corresponds to the CPX
diagnostic information described in chapter B.2.1 of the CPX system manual.
Function block Description Comment
1
The Festo_CPX.lib library
1.1.8 Service
Please consult your local Festo repair service or write to the following e-mail address if you have any
technical problems:
o service_international@festo.com
2
The Festo_CPX.lib library
Warning
Axes can move with high force and at high speed. Collisions can lead to serious injury to people
and damage to components.
• Make sure that nobody can place their hand in the positioning range of the axes or other
connected actuators and that there are no objects in the positioning path while the
system is still connected to a power supply.
3
The Festo_CPX.lib library
CPX_DIAGNOSTICSUPDATE
CPX_GETFAULTSTRING
4
The Festo_CPX.lib library
5
The Festo_CPX.lib library
System diagnosis
The system diagnosis is modelled in an instance of the structure CPX_SystemDiagnosticsStruct, which
contains the following structure variables:
6
The Festo_CPX.lib library
7
The Festo_CPX.lib library
Error memory
The error memory is modelled with three elements.
The first element 'CPX_TraceMemoryParameter' is a type CPX_TraceMemoryParameterStruct element.
The structure contains the parameters of the diagnostic memory set in the system configuration. The
individual parameters are documented in the CPX system description in chapter B.2.4. The parameters
cannot be modified.
8
The Festo_CPX.lib library
DaysSincePowerOn BYTE Number of days that have passed from the time the
controller was switched on to the time the error occurred.
TimeSincePowerOn TIME The exact time from the moment the controller was
switched on to the time the error occurred (resolution 10
ms, must be added to DaysSincePowerOn).
FirstFaultAfterPowerOn BOOL Is True if this is the first error that occurred after the
controller was switched on.
ModuleCode BYTE Code of the module where the error occurred.
ModulePosition BYTE Number of the module where the error occurred. 1 is the
first module apart from the CPX-CEC.
KindOfFault STRING Possible values: ”Output error”, ”Module error”, ”Input
error”, ”Unknown error”.
FirstFaultyChannel BYTE Number of the first faulty channel. Numbers are
consecutive and start with 0. Input and output channels
are counted separately.
FaultNumber BYTE See the CPX system description/chapter 5 for information
on error numbers. Can be translated into text using the
CPX_GetFaultString function.
SeriesErrors BYTE Number of subsequent channels with the same error.
9
The Festo_CPX.lib library
CPX_GETPARAMETER
10
The Festo_CPX.lib library
CPX_SETPARAMETER
The number of bits written cannot exceed the parameter width. A validity check is not performed.
CPX_SetParameter BOOL The return value indicates whether the operation was
fundamentally successful:
TRUE: Parameter value transferred.
FALSE: Parameter value not transferred.
11
The Festo_CPX.lib library
The 'Behaviour after SCA (Actuator)' parameter of module 2AO can be read with CPX_GetParameter(2,
3).
The 3rd parameter of module '#2' in the control configuration is requested in the function call.
The return value is 1. The description of the CPX analogue module reveals that the value 1 is assigned to
the behaviour 'Switch on again'.
The 'Value A0:Upper limit' can be modified with CPX_SetParameter(1, 12, 4012).
The 12th parameter of module '#1' in the control configuration is written in the function call.
The parameter adopts the value 4012 following the call. Refer to the description of the CPX analogue
module for details of permitted value ranges.
12
The Festo_CPX.lib library
CPX_CLEARERRORLED
CPX_CLEARERRORLED BOOL The return value indicates whether the operation was
fundamentally successful:
TRUE: ERROR LED cleared
FALSE: The LED could not be cleared.
13
2 Index
C CPX_DiagnosticsUpdate ...................... 1, 4, 5
CPX diagnostic information .......................... 5 CPX_GetFaultString ................................. 1, 4
CPX error handling ................................ 1, 13 CPX_GetParameter.......................... 1, 10, 12
CPX functions .............................................. 1 CPX_SetParameter ................................ 1, 10
CPX parameters .......................................... 1 F
CPX system functions ............................ 1, 10 Festo_CPX.lib .............................................. 1
CPX_CICommand ................................. 1, 10
CPX_ClearErrorLED .............................. 1, 13
15