Librerias COdesys Festo Provisional

22
Nombre Libreria FEDCEC CPXCEC CECXC1 CECXM1 Proveedor Notas PD =Por defecto SysLibCallback.lib si si, PD si si 3S, Adaptadas This library provides the functions SysCallbackRegister and SysCallbackUnregister, which serve to activate defined callback functions for runtime events. SysLibCom.lib si si si 3S, Adaptadas This library supports the serial communication with a target system. If the target system provides the functionality, then the following library functions can be used to open or close a serial port and to read or write data via this port (The execution is synchronous.): SysLibDir.lib si si si 3S, Adaptadas handle a file directory system on the target system. Entries of the directory can be read and modified. The execution is synchronous. SysLibDirect.lib si si The functions of this library serve to access variables by indices with which they are referenced in the runtime system. For detailed information see the description of the particular runtime system. SysLibEvent.lib si si si 3S, Adaptadas This library serves to synchronize and control the processing of two (IEC) tasks. SysLibFile.lib si si si si 3S, Adaptadas Manjo de Archivos SysLibFileAsync.lib si si si 3S, Adaptadas This library supports asynchronous file access from the IECapplication SysLibFileStream.lib si si si 3S, Adaptadas This library provides functions which correspond to ANSI C functions for file stream operations. The execution is synchronous. SysLibGetAddress.lib si si si si 3S, Adaptadas the start address and the size of a data segment (Memory, Input, Output, Retain or Global) in a DWORD SysIECTasks.lib si si si 3S, Adaptadas this library can be used to call information on the configuration of IEC tasks. (To create, delete, prioritize, stop and restart a task you can use the library SysLibTasks.lib.) The execution is synchronous. SysLibInitLibrary.lib si si This library contains a function which can be used to initialize an external library, which is available as an objfile. The execution is synchronous. SysLibInt.lib use this library to set and remove an interrupt handler for a function. The execution is synchronous. SysLibMem.lib si si si si 3S, Adaptadas This library can be used for memory management. If the target system supports the functionality, the following library functions are available to allocate, to free, to define, to compare memory locations and to copy, move or swap between different memory locations. The execution is synchronous. SysLibPciCards.lib This library is designed for access to a Pci card plugged to the Plc SysLibPLCConfig.lib si si si 3S, Adaptadas This library supports the reading of the configuration data of the PLC Configuration SysLibPlcCtrl.lib si si This library contains the following functions for controlling a PLC. The execution is synchronous. SysLibPorts.lib can be used to communicate with external hardware devices via their port addresses; e.g. realtime clock, graphic controller etc. The port addresses can accessed reading and writing. The execution is synchronous. SysLibProjectInfo.lib si si si 3S, Adaptadas then the functions contained in this library can be used to read the Project Info (CoDeSys Menu 'Project' 'Project Info') respectively the Project ID. SysLibRtc.lib si si si si 3S, Adaptadas This library contains functions for accessing the realtime clock of the local system SysLibSem.lib si si si 3S, Adaptadas This library can be used to create and use semaphores for the synchronization of tasks. The semaphores serve to avoid any concurrent access on critical data, which are used by several tasks. SysLibShm.lib si si This library provides functions for accessing a memory area which is used in common by several processes resp. referencing a physical address (SharedMemory, shortcut ShM). SysLibSockets.lib si si si si 3S, Adaptadas This library supports the access on sockets for the communication via TCP_IP and UDP. SysLibSocketsAsync.lib si si si 3S, Adaptadas This library offers the same functionality as SysLibSockets.lib, however function blocks instead of functions are used and the processing is asynchronous. SysLibStr.lib si si si si 3S, Adaptadas This library provides functions for string operations. If the target system is supporting the functionality, the following functions can be used to compare or copy strings or to retrieve the length of a string. The execution is synchronous. SysLibSymbols.lib si 3S, Adaptadas SysLibTasks.lib si si si 3S, Adaptadas can be used to manage tasks. That means to generate, to delete, to modify priority level, to stop and restart tasks. The execution is synchronous. SysLibTime.lib si si, PD si si 3S, Adaptadas This library provides function blocks for reading the realtime clock of the local system. The execution is synchronous. por desglosar SysLibVisu.lib si 3S, Adaptadas por desglosar SysTaskInfo.lib si, PD si si 3S, Adaptadas por desglosar NetVarUdp_LIB_V23.lib si en dir en dir 3S, Adaptadas por desglosar ModbusTCPSrv.lib si si si 3S Modules for communicating via Modbus TCP. Festo_EasyIP.lib si en dir en dir Festo Modules for easy data exchange between EasyIPcompatible controllers and devices. Festo_Motion.lib si no esta Festo Modules for parameterising and controlling motor units and motor controllers from Festo. Festo_CPX.lib si Festo Function blocks for the CPX valve terminal. Festo_CPX_extern.lib si Festo Hidden library that is loaded automatically in a CPXCEC project. FestoMotion_V0.2.lib en dir no esta The library provides functions that are required by other Festo libraries. Standard.lib si, PD si 3S, Standard libraries for CoDeSys Modules that the IEC611313 requires as standard modules for an IEC programming system.

Transcript of Librerias COdesys Festo Provisional

Nombre Libreria FED‐CEC CPX‐CEC CECX‐C1 CECX‐M1 Proveedor Notas

PD  =Por defecto

SysLibCallback.lib si si, PD si si 3S, Adaptadas

This library provides the functions SysCallbackRegister and 

SysCallbackUnregister, which serve to activate defined callback functions for 

runtime events.

SysLibCom.lib si si si 3S, Adaptadas

This library supports the serial communication with a target system. If the 

target system provides the functionality, then the following library functions 

can be used to open or close a serial port and to read or write data via this port 

(The execution is synchronous.):

SysLibDir.lib si si si 3S, Adaptadashandle a file directory system on the target system. Entries of the directory can 

be read and modified. The execution is synchronous.

SysLibDirect.lib si siThe functions of this library serve to access variables by indices with which they 

are referenced in the runtime system. For detailed information see the 

description of the particular runtime system.

SysLibEvent.lib si si si 3S, AdaptadasThis library serves to synchronize and control the processing of two (IEC‐) tasks.

SysLibFile.lib si si si si 3S, Adaptadas Manjo de Archivos

SysLibFileAsync.lib si si si 3S, Adaptadas This library supports asynchronous file access from the IEC‐application

SysLibFileStream.lib si si si 3S, AdaptadasThis library provides functions which correspond to ANSI C functions for file 

stream operations. The execution is synchronous.

SysLibGetAddress.lib si si si si 3S, Adaptadasthe start address and the size of a data segment (Memory, Input, Output,

Retain or Global) in a DWORD

SysIECTasks.lib si si si 3S, Adaptadas

this library can be used to call information on the configuration of IEC tasks. (To 

create, delete, prioritize, stop and restart a task you can use the library 

SysLibTasks.lib.) The execution is synchronous.

SysLibInitLibrary.lib si si This library contains a function which can be used to initialize an external 

library, which is available as an obj‐file. The execution is synchronous.

SysLibInt.libuse this library to set and remove an interrupt handler for a function. The 

execution is synchronous.

SysLibMem.lib si si si si 3S, Adaptadas

This library can be used for memory management. If the target system 

supports the functionality, the following library functions are available to 

allocate, to free, to define, to compare memory locations and to copy, move or 

swap between different memory locations. The execution is synchronous.

SysLibPciCards.lib This library is designed for access to a Pci card plugged to the Plc

SysLibPLCConfig.lib si si si 3S, AdaptadasThis library supports the reading of the configuration data of the PLC 

Configuration

SysLibPlcCtrl.lib si siThis library contains the following functions for controlling a PLC. The execution 

is synchronous.

SysLibPorts.libcan be used to communicate with external hardware devices via their port 

addresses; e.g. realtime clock, graphic controller etc. The port addresses can 

accessed reading and writing. The execution is synchronous.

SysLibProjectInfo.lib si si si 3S, Adaptadas then the functions contained in this library can be used to read the Project Info 

(CoDeSys Menu 'Project' 'Project Info') respectively the Project ID.

SysLibRtc.lib si si si si 3S, AdaptadasThis library contains functions for accessing the realtime clock of the local 

system

SysLibSem.lib si si si 3S, Adaptadas

This library can be used to create and use semaphores for the synchronization 

of tasks. The semaphores serve to avoid any concurrent access on critical data, 

which are used by several tasks.

SysLibShm.lib si siThis library provides functions for accessing a memory area which is used in 

common by several processes resp. referencing a physical address (Shared‐

Memory, shortcut ShM).

SysLibSockets.lib si si si si 3S, AdaptadasThis library supports the access on sockets for the communication via TCP_IP 

and UDP.

SysLibSocketsAsync.lib si si si 3S, Adaptadas This library offers the same functionality as SysLibSockets.lib, however function 

blocks instead of functions are used and the processing is asynchronous.

SysLibStr.lib si si si si 3S, AdaptadasThis library provides functions for string operations. If the target system is 

supporting the functionality, the following functions can be used to compare or 

copy strings or to retrieve the length of a string. The execution is synchronous.

SysLibSymbols.lib si 3S, Adaptadas

SysLibTasks.lib si si si 3S, Adaptadas can be used to manage tasks. That means to generate, to delete, to modify 

priority level, to stop and restart tasks. The execution is synchronous.

SysLibTime.lib si si, PD si si 3S, AdaptadasThis library provides function blocks for reading the realtime clock of the local 

system. The execution is synchronous.

por desglosar SysLibVisu.lib si 3S, Adaptadas

por desglosar SysTaskInfo.lib si, PD si si 3S, Adaptadas

por desglosar NetVarUdp_LIB_V23.lib si en dir en dir 3S, Adaptadas

por desglosar ModbusTCPSrv.lib si si si 3S Modules for communicating via Modbus TCP.

Festo_EasyIP.lib si en dir en dir FestoModules for easy data exchange between EasyIP‐compatible controllers and 

devices.

Festo_Motion.lib si no esta FestoModules for parameterising and controlling motor units and motor controllers 

from Festo.

Festo_CPX.lib si Festo Function blocks for the CPX valve terminal.

Festo_CPX_extern.lib si Festo Hidden library that is loaded automatically in a CPX‐CEC project.

FestoMotion_V0.2.lib en dir no esta

The library provides functions that are required by other Festo libraries.

Standard.lib si, PD si 3S, Standard libraries for CoDeSysModules that the IEC61131‐3 requires as standard modules for an IEC 

programming system.

mx0gni
Typewritten Text
mx0gni
Typewritten Text
mx0gni
Typewritten Text
Enero 2010 Version Preliminar Festo Gerardo Niembro
mx0gni
Typewritten Text
mx0gni
Typewritten Text
mx0gni
Typewritten Text

Util.lib si, PD si 3S, Standard libraries for CoDeSys

Modules for BCD conversion, bit/byte functions, mathematical help functions, 

controllers, signal generators, function manipulators and analogue value 

processing.

AnalyzationNew.lib si si 3S, Standard libraries for CoDeSys Modules for analysing expressions.

IecSfc.lib si, PD 3S, Standard libraries for CoDeSys ActionControl

por desglosar AnaLyZATION.lib en Dir 3s 3S, Standard libraries for CoDeSys

por desglosar 3S_CanDrv.lib si si si 3S, CANopen libraries Only for internal use in combination with the CANopen master.

por desglosar 3S_CANopenManager.lib si si si 3S, CANopen libraries Only for internal use in combination with the CANopen master.

por desglosar 3S_CANopenMaster.lib si si si 3S, CANopen libraries Only for internal use in combination with the CANopen master.

por desglosar 3S_CanOpenDevice.lib en dir en dir

por desglosar BusDiag.lib si si si 3S, Adaptada Diagnosis for CANopen bus systems.

Ethernet.lib si si Librerias especificas para tajet Modules for network configuration

EventData.lib si si Librerias especificas para tajet Modules for evaluating interruptible inputs 

IncEnc.lib si si Librerias especificas para tajet Modules for latch functions of incremental encoders 

PLCService.lib si si Librerias especificas para tajetModules for control services (e.g. operating hours counter, version 

information,….)

SysLibComEx.lib si si Librerias especificas para tajet Modules for switching the mode between RS485/422.

pend KSys.lib si si Librerias especificas para tajet Internal modules.

pend TestFunctions.lib si si Librerias especificas para tajet Internal modules.

por desglosar HilscherPBInfo.lib si si En subDir Profibus

por desglosar Hilscher.lib si si En subDir Profibus

por desglosar

SysLibDPV1Hilscher.lib si si En subDir Profibus

This library supports the acyclic Profibus DPV1, Class 1, Read‐ and Write‐

Services for the data transfer between Master and Slaves. The data are 

addressed within the slaves by slot and index. (Concerning this see the PB‐DP 

standard.)

ModbusTCPSrv.lib en dir si si 3S, Adaptada ModBus TCPServer

por desglosar Dummydrive.lib en dir Motion

por desglosar SM_CNC.lib en dir Motion

por desglosar SM_CNCDiagnostic.lib en dir Motion

por desglosar SM_DriveBasic.lib en dir Motion

por desglosar SM_Error.lib en dir Motion

por desglosar SM_FileFBs.lib en dir Motion

por desglosar SM_PLCopen.lib en dir Motion

por desglosar SM_Startup_Diagnostic.lib en dir Motion

por desglosar SM_Trafo.lib en dir Motion

por desglosar 3S_CanDrv.lib en dir Motion

por desglosar FestoCANdrive.lib en dir Motion

por desglosar SM_CAN.lib en dir Motion

por desglosar SM_CANWatch.lib en dir Motion

Dudas

Porque CECX‐C1 y CECX‐m1 no tienen la librería de FestoMotion

La librería de Analyzation y AnalyzationNew son diferentes, porque se usan así, y se diferencia a losPLC que la usan

Pendientes:

Verificar contra listado real del directorio de cada equipo

OPERADORES IECListado Parcial, es posible que falten algunas funciones

Operadores IEC

ADDAddition of variables of the types: BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, 

REAL and LREAL.

MULMultiplication of variables of the types: BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, 

UDINT, REAL and LREAL.

SUBSubtraction of one variable from another of the types: BYTE, WORD, DWORD, SINT, USINT, INT, 

UINT, DINT, UDINT, REAL and LREAL.

DIVDivision of one variable by another of the types: BYTE, WORD, DWORD, SINT, USINT, INT, UINT, 

DINT, UDINT, REAL and LREAL.

MODModulo Division of one variable by another of the types: BYTE, WORD, DWORD, SINT, USINT, INT, 

UINT, DINT, UDINT. The result of this function will be the remainder of the division. This result will 

be a whole number.

MOVEAssignment of a variable to another variable of an appropriate type. As MOVE is available as a box 

in the graphic editors LD, CFC, there the (unlocking) EN/EN0 functionality can also be applied on a 

variable assignment. In the FBD editor this is not possible however.

INDEXOF This function is not prescribed by the standard IEC61131‐3.

SIZEOF This function is not prescribed by the standard IEC61131‐3.

ANDBitwise AND of bit operands. The operands should be of the type BOOL, BYTE, WORD or DWORD.

ORBitwise OR of bit operands. The operands should be of the type BOOL, BYTE, WORD or DWORD.

XORBitwise XOR of bit operands. The operands should be of the type BOOL, BYTE, WORD or DWORD.

NOTBitwise NOT of a bit operand. The operand should be of the type BOOL, BYTE, WORD or DWORD.

SHL Bitwise left‐shift of an operand : erg:= SHL (in, n)

SHR Bitwise right‐shift of an operand: erg:= SHR (in, n)

ROL Bitwise rotation of an operand to the left: erg:= ROL (in, n)

ROR Bitwise rotation of an operand to the right: erg = ROR (in, n)

Selection OperatorsAll selection operations can also be performed with variables. For purposes of clarity we will limit 

our examples to the following which use constants as operators.

SEL Binary Selection

MAX Maximum function. Returns the greater of the two values.

MIN Minimum function. Returns the lesser of the two values.

LIMIT Limiting

MUX Multiplexer

GT Greater than

LTA Boolean operator that returns the value TRUE when the value of the first operand is less than 

that of the second. The operands can be BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, 

DINT, UDINT, REAL, LREAL, TIME, DATE, TIME_OF_DAY, DATE_AND_TIME and STRING.

LEA Boolean operator that returns the value TRUE when the value of the first operand is less than or 

equal to that of the second. The operands can be BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, 

UINT, DINT, UDINT, REAL, LREAL, TIME, DATE, TIME_OF_DAY, DATE_AND_TIME and STRING.

GE Greater than or equal to

EQ Equal to

NE Not equal to

ADR Address Function not prescribed by the standard IEC61131‐3.

ADRINST Address Function not prescribed by the standard IEC61131‐3.

BITADR Adress function, not prescribed by the standard IEC61131‐3.

Content OperatA pointer can be dereferenced by adding the content operator "^" after the pointer identifier

CAL Calling a function block or a program

Type Conversion Functions

Its is forbidden to implicitly convert from a "larger" type to a "smaller" type (for example from INT 

to BYTE or from DINT to WORD). Special type conversions are required if one wants to do this. 

One can basically convert from any elementary type to any other elementary type.

BOOL_TO ConversionsConversion from type BOOL to any other type:

BOOL_TO_INT

BOOL_TO_STRING

BOOL_TO_TIME

BOOL_TO_TOD

BOOL_TO_DATE

BOOL_TO_DT

TO_BOOL ConversionsBYTE_TO_BOOL

INT_TO_BOOL

TIME_TO_BOOL

STRING_TO_BOOL 

Conversion between Integral Number TypesINT_TO_REAL

REAL_TO_INT

TIME_TO/TIME_OF_DAY ConversionsTIME_TO_STRING

TIME_TO_DWORD 

TOD_TO_SINT

DATE_TO/DT_TO ConversionsDATE_TO_BOOL

DATE_TO_INT

DT_TO_BYTE

DT_TO STRING

STRING_TO ConversionsSTRING_TO_BOOL

STRING_TO_WORD

STRING_TO_TIME

TRUNC Converting from REAL to INT

ABS Returns the absolute value of a number. ABS(‐2) equals 2.

SQRT Returns the square root of a number

LN Returns the natural logarithm of a number.

LOG Returns the logarithm of a number in base 10.

EXP Returns the exponential function

SIN Returns the sine of a number.

COS Returns the cosine of number. The result is calculated in arch minutes.

TAN Returns the tangent of a number. The value is calculated in arch minutes. IN can be type BYTE, 

WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.

ASIN Returns the arc sine (inverse function of sine) of a number. .

ACOSReturns the arc cosine (inverse function of cosine) of a number. The value is calculated in arch 

minutes.

ATAN Returns the arc tangent (inverse function of tangent) of a number.

EXPT Exponentiation of a variable with another variable:

INIThe INI operator can be used to initialize retain variables which are provided by a function block 

instance used in the POU.

Librerias de 3S

Parte de la información de estas librerias se encuentra en los directorios del Tarjet

Standard.lib

String functionsLEN Returns the length of a string. Input STR is of type STRING

LEFT Left returns the left, initial string for a given string

RIGHT Right returns the right, initial string for a given string.

MID returns a partial string from within a string

CONCAT Concatenation (combination) of two strings

INSERT INSERT inserts a string into another string at a defined point.

DELETE DELETE removes a partial string from a larger string at a defined position.

REPLACE REPLACE replaces a partial string from a larger string with a third string.

FIND FIND searches for a partial string within a string.

Bistable FunctionSR Making Bistable Function Blocks Dominant

RS Resetting Bistable Function Blocks

SEMA A Software Semaphore (Interruptible)

TriggerR_TRIG The function block R_TRIG detects a rising edge.

F_TRIG The function block F_TRIG a falling edge.

CounterCTU Function block Incrementer

CTD Function Block Decrementer:

CTUD Function Block Incrementer/Decrementer

TimerTP The function block Timer is a trigger

TON The function block Timer On Delay implements a turn‐on delay..

TOF The function block TOF implements a turn‐off delay..

RTC The function block Runtime Clock returns, starting at a given time, the 

current date and time.

Util.lib This library contains an additional collection of various blocks which can 

be used for BCD conversion, bit/byte functions, mathematical auxiliary  

functions, as controller, signal generators, function manipulators and for 

analogue value processing. 

As some of the functions and function blocks contain REAL variables, an 

accessory library named UTIL_NO_REAL exists in which these POUs are 

excluded.

BCD conversionBCD_TO_INT This function converts a byte in BCD format into an INT value

INT_TO_BCD_ This function converts an INTEGER value into a byte in BCD format

Bit/Byte FunctionsExtract Inputs to this function are a DWORD X, as well as a BYTE N. The output is 

a BOOL value, which contains the content of the Nth bit of the input X, 

whereby the function begins to count from the zero bit.

Pack This function is capable of delivering back eight input bits B0, B1, ..., B7 

from type BOOL as a BYTE

PutBit PUTBIT sets the Nth bit from X on the value B, whereby it starts counting 

from the zero bit.

unpack UNPACK converts the input B from type BYTE into 8 output variables 

B0,...,B7 of the type BOOL, and this is the opposite to PACK.

Mathematic Auxiliary FunctionsDerivative This function block approximately determines the local derivation.

Integral This function block approximately determines the integral of the 

function.

Lin_Trafo This function block  transforms a REAL‐value, which lies in a value range 

defined by a lower and upper limit value, to a REAL‐value which lies 

correspondingly in another range also defined by a lower and upper limit

Statics_Int This function block calculates some standard statistical values

Statics_real This function block corresponds to STATISTICS_INT, except that the input 

IN is of the type REAL like the outputs MN, MX, AVG.

Variance VARIANCE calculates the variance of the entered values.

ControllerPD The library util.lib provides the following PD controller function block

PID The library util.lib provides the following PID controller function block

PID_FIXCYCLE The PID_FIXCYCLE controller function block:

Signal GeneratorsBlink The function block BLINK generates a pulsating signal

Freq_Measure This function block measures the (average) frequency (Hz) of a boolean 

input signal.

Gen The function generator generates typical periodic functions

Function ManipulatorCharCurve This function block serves to represent values, piece by piece, on a linear 

function:

Ramp_Int RAMP_INT serves to limit the ascendance or descendance of the 

function being fed

Ramp_Real RAMP_REAL functions in the same way as RAMP_INT, with the simple 

difference that the inputs IN, ASCEND, DESCEND and the output OUT are 

of the type REAL.

Analog Value ProcessingHysteresis The input to this function block consists of three INT values IN, HIGH and 

LOW. The output OUT is of the type BOOL.

LimitAlarm This function block specifies, whether the input value is within a set 

range and which limits it has violated if it has done so.

AnalyzationNew.libAnalyzeExpression returns in a string the components of the expression, which are adding 

to the total value FALSE

AppendErrorString is used for this purpose, separating the particular components in the 

output string by "|" characters

IecSfc.libSFCActionControl Action control block for IEC 61131‐3 SFC actions

ModBusTCPSrv.lib Implementación de ModBus

MODBUSSERVER_TCPIP Implementación de Modbus

Librerias del SistemaNum a librería funcion Descripción

1 1SysLibCallback.lib This library provides the functions SysCallbackRegister and SysCallbackUnregister, which 

serve to activate defined callback functions for runtime events.

SysCallbackRegister

SysCallbackUnregister

2 2

SysLibCom.libThis library supports the serial communication with a target system. If the target system 

provides the functionality, then the following library functions can be used to open or 

close a serial port and to read or write data via this port (The execution is synchronous.):

3 SysComOpen This function of the library SysLibCom.lib serves to open a serial port.

4

SysComSetSettings

serves to set values like baudrate, stopbits, parity, function‐timout, buffer‐size and scan‐

time for a serial port. The parameter value is of type POINTER TO COMSETTINGS; the 

structure COMSETTINGS is used.

5

SysComSetSettingsEx

This function of the library SysLibCom.lib of type BOOL with the parameters of type  

POINTER TO COMSETTINGSEX is used to set all relevant parameters of a serial 

communication port. Not only the parameters of the above function are set, but also the 

parameters for flowcontrol and character size can be set with this function. This is 

performed by filling them into the structure COMSETTINGSEX.

6

SysComClose This function of the library SysLibCom.lib of type BOOL closes the COM port. For that 

purpose the port handle, which has been got by SysComOpen, must be given as input 

parameter. The return value will be TRUE after a successful operation, otherwise FALSE.

7

SysComRead 

This function of the library SysLibCom.lib of type DWORD reads the data of COM‐PORT. 

The input parameters are the port handle got by SysComOpen, the number of expected 

bytes and the timeout of the function. Besides that the address to which the read data 

should be copied, will be passed on. 

8

SysComWrite 

This function of the library SysLibCom.lib of type DWORD writes the data to that port 

which is defined by the handle got by SysComOpen. Besides the handle also the address 

from which the data should be taken, the number of data which should be written and 

the timeout of the function must be passed on. 

9

SysComGetVersion2300

This function of the library SysLibCom.lib (type DWORD, always returns 0) is only used 

for an automatic internal version check and is not to be called explicitly in the application 

program

10 3SysLibDir.lib

handle a file directory system on the target system. Entries of the directory can be read 

and modified. The execution is synchronous.

11 SysDirCreate can be used to create a new directory.

12SysDirOpen

can be used, to open a directory in order to read the directory entries (files, 

subdirectories) via function SysDirRead

13 SysDirRead can be used to read directory entries.

14 SysDirRemove can be used to delete a directory.

15 SysDirRename can be used to rename a directory

16 4SysLibDirect.lib

The functions of this library serve to access variables by indices with which they are 

referenced in the runtime system. For detailed information see the description of the 

particular runtime system.

17 5

SysLibDPV1Hilscher.libThis library supports the acyclic Profibus DPV1, Class 1, Read‐ and Write‐Services for the 

data transfer between Master and Slaves. The data are addressed within the slaves by 

slot and index. (Concerning this see the PB‐DP standard.)

18 6SysLibEvent.lib

This library serves to synchronize and control the processing of two (IEC‐) tasks.

19SysEventCreate

serves to create a new event and to name it. A handle will be returned, which is used by 

the other functions of the library to access the event.

20SysEventDelete

deletes an event. The event is defined by the handle which was returned by the function 

SysEventCreate when creating the event.

21

SysEventSet

is used to set an event. The event is defined by the handle which was returned by the 

function SysEventCreate when creating the event. TRUE will be returned if as the event 

has been set successfully, otherwise FALSE.

22

SysEventWaitis used to set the timeout for an event. The event is defined by the handle which was 

returned by the function SysEventCreate when creating the event. TRUE will be returned 

if as the timeout has been set successfully, otherwise FALSE

23 7 SysLibFile.lib

24 SysFileOpen serves to open a file, which already exists or which should be created.

25SysFileWrite

serves to write data to a file, which has been opened before by the function 

SysFileOpen. The return value is the number of successfully written bytes.

26SysFileRead

serves to read a file, which has been opened before by SysFileOpen. The return value is 

the number of successfully read bytes.

27 SysFileClose serves to close a file, which has been opened before by SysFileOpen.

28 SysFileDelete serves to delete a file

29 SysFileCopy serves to copy the file content to another file (different file name).

30SysFileEOF

if the current offset is at the end of the file; it will return 0, if the end of file has not yet 

been reached.

31SysFileGetPos

returns the currently set offset position in the file, which is identifed by the file number 

that you have got from the SysFileOpen function before

32 SysFileGetSize returns the size of the file (in Bytes), which is identified by the file name.

33SysFileGetTime

returns the creation date, the date of last access and the date of the last modification of 

the file (which is identified by the file name).

34 SysFileRename serves to rename a file.

35SysFileSetPos

serves to change the current offset (which can be read by the function SysFileGetPos) for 

a file access

36 8 SysLibFileAsync.lib This library supports asynchronous file access from the IEC‐application

37SysFileOpenAsync

This function block (see library SysLibFileAsync.lib) retrieves the current read‐/write 

position of the file.

38SysFileCloseAsync

This function block (see library SysLibFileAsync.lib) is used to close a file. From now on 

the file handle is invalid and the file is free for other processes

39SysFileWriteAsync

This function block (see library SysLibFileAsync.lib) is used for writing to a file. The file 

has to be opened with the FB SysFileOpenAsync.

40SysFileReadAsync

This function block (see library SysLibFileAsync.lib) is used to read from an open file.

41 SysFileDeleteAsync This function block (see library SysLibFileAsync.lib) is used to delete a file.

42SysFileGetPosAsync

This function block (see library SysLibFileAsync.lib) retrieves the current read‐/write 

position of the file.

43SysFileEOFAsync

This function block (see library SysLibFileAsync.lib) is used to determine, whether the 

read‐/write pointer has reached the end of the file.

44SysFileGetSizeAsync

This function block (see library SysLibFileAsync.lib) is used to retrieve the size in bytes of 

a file.

45SysFileGetTimeAsync

This function block (see library SysLibFileAsync.lib) retrieves the modification times of a 

file.

46SysFileCopyAsnc

This function block (see library SysLibFileAsync.lib) is used to copy a file to another 

name/location

47 SysFileRenameAsync This function block (see library SysLibFileAsync.lib) is used to rename a file.

48

SysFileCloseAllOpenAsync With this function block(see library SysLibFileAsync.lib) one can close all currently open 

files, without knowing any handles or names. The system always knows these handles.

49 9SysLibFileStream.lib

This library provides functions which correspond to ANSI C functions for file stream 

operations. The execution is synchronous.

50

51SysFileStreamFOpen

File with name filename will be opened as stream; possible values for inputvariable 

Mode : 'w' (write), 'r' (read), 'a' (append), '+', 'b', 't'

52 SysFileStreamClearerr  internal error state of pFile will be deleted; always returns 1

53SysFileStreamFClose 

all open streams will be closed (except for stdin , stdout , stderr ). Returns 

SysFileStreamFClose_EOF in case of error, otherwise 0.

54 SysFileStreamFEOF  returns !=0, as soon as end of file in pFile  is reached

55 SysFileStreamFError  returns !=0, as soon as an error has been detected for pFile

56 SysFileStreamFFlush  Characters which are still buffered internally, will be output

57 SysFileStreamRemove  File will be deleted; returns 1 for OK, 0 in case of an error

58 SysFileStreamRename  Renaming a file; returns 1 for OK, 0 in case of an error

59 SysFileStreamRewind  sets file position to start and deletes internal error state; always returns 1

60SysFileStreamFGetC 

returns the next character in the stream (0‐‐255, SYSFILESTREAM_EOF in case of an error

61SysFileStreamFGetPos 

writes current file position of pFile to ptr; fpos_ t here defined as an unsigned long (32 

bits)

62SysFileStreamFSetPos 

sets file position of pFile according to ptr ; fpos_t  here is defined as unsigned long (32 

bits);

63

SysFileStreamFGetS  Reads at most the next n‐1 characters into the array s ,  (termination automatically with 

0); Truncation at '\n', the '\n' will be taken over to s ;pFPos:DWORD; (* pointer !!*)

64 SysFileStreamFPrintf_Int  formatted output in stream pFile ;

65 SysFileStreamFPrintf_Real  formatted output in stream pFile ;

66 SysFileStreamFPrintf_String  formatted output in stream pFile ;

67 SysFileStreamFPutC Writing character (unsignedchar) c  to stream pFile

68 SysFileStreamFPutS  Writing string s in stream pFile

69SysFileStreamFRead 

nobj objects of size size  will be read from pFile to ptr; Returns number of read objects

70SysFileStreamFWrite 

nobj objects of size size wil lbe written from ptr to pFile ; Returns number of written 

objects

71SysFileStreamFScanf_Int 

formatted input from stream pFile; Restrictions compared to C: only 1 DINT argument 

can be read; szFormat  should be e.g. '%d'

72SysFileStreamFScanf_String 

formatted input from stream pFile; Restrictions compared to C: only 1 STRING argument 

can be read; szFormat  should be e.g. '%s'

73SysFileStreamFScanf_Real 

formatted input from stream pFile; Restrictions compared to C: only 1 REAL argument 

can be read; szFormat  should be e.g. '%f'

74

SysFileStreamFSeek  sets file position on offset  Bytes based on origin ; values for  origin : SEEK_SET=Start of 

file, SEEK_CUR=current position; SEEK_END=End of file; 0=OK

75 SysFileStreamFTell returns current file position (based on file start) in Bytes (‐1 in case of error)

76 10SysLibGetAddress.lib

the start address and the size of a data segment (Memory, Input, Output, Retain or 

Global) in a DWORD

77SysLibGetAddress

returns the start address and the size of a data segment (Memory, Input, Output, Retain 

or Global) in a DWORD.

78SysLibGetSize

returns the start address and the size of a data segment (Memory, Input, Output, Retain 

or Global) in a DWORD.

79 11SysIECTasks.lib

this library can be used to call information on the configuration of IEC tasks. (To create, 

delete, prioritize, stop and restart a task you can use the library SysLibTasks.lib.) The 

execution is synchronous.

80 SysIECTaskGetConfig serves to retrieve the configuration parameters of an IEC task

81 SysIECTaskGetInfo returns the current time values of an IEC task.

82SysIECGetFctPointer

returns a function pointer, which is required as input parameter for the function 

SysTaskCreate which is used to create a new task

83 SysIECTaskResetEvent resets the event variable of an event triggered IEC task

84 12SysLibInitLibrary.lib

This library contains a function which can be used to initialize an external library, which 

is available as an obj‐file. The execution is synchronous.

85 SysInitLibrary can be used to initialize an external library

86 133SysLibInt.lib

use this library to set and remove an interrupt handler for a function. The execution is 

synchronous.

87SysInstallIntHandler

sets the interrupt with a given number on the function which is identified by its address

88SysRemoveIntHandler

removes the interrupt, which is identifed by the given number, for the function which is 

identified by its address

89 14

SysLibMem.lib

This library can be used for memory management. If the target system supports the 

functionality, the following library functions are available to allocate, to free, to define, 

to compare memory locations and to copy, move or swap between different memory 

locations. The execution is synchronous.

90 SysMemAlloc is used to dynamically allocate memory space

91 SysMemFree is used to deallocate memory space.

92SysMemMove

moves one memory buffer to another. The function will return the address of the 

destination buffer.

93SysMemSet

can be used to initialize a memory location with a defined value. It will return the 

address of the destination buffer.

94SysMemCmp

compares the content of two memory buffers of size dwCount. dwBuf1 and dwBuf2 

each show the start address of the buffer.

95SysMemCpy

is used to copy a defined number of memory locations from one buffer to another.

96SysMemSwap

can be used to swap data; mainly used to swap data between Motorola Byteorder and 

Intel Byteorder.

97 15 SysLibPciCards.lib This library is designed for access to a Pci card plugged to the Plc

98 SysPciGetCardInfo used to retrieve information about a Pci card.

99 16SysLibPLCConfig.lib

This library supports the reading of the configuration data of the PLC Configuration

100CfgCCGetError

provides information on the errors which occur during the download of the PLC 

configuration.

101 CfgCCGetHeader returns a pointer on the header structure of the PLC configuration

102 CfgCCGetRootModule provides information on the root module of the PLC configuration

103CfgCCGetRootModuleByModuleId

provides information on the root module of the currently used PLC configuration, which 

is given by the module Id

104CfgCCGetRootModuleByNodeId

provides information on the root module of the currently used PLC configuration, which 

is given by the node Id

105 17SysLibPlcCtrl.lib

This library contains the following functions for controlling a PLC. The execution is 

synchronous.

106 SysStartPlcProgram  can be used to start a PLC

107 SysResetPlcProgram  can be used to reset the PLC

108 SysStopPlcProgram  can be used to stop the PLC

109 SysShutdownPlc can be used to shut down the PLC

110 SysEnableScheduling can be used to enable resp. disable the scheduler for the IEC tasks in the PLC.

111 SysGetPlcLoad returns the current processor load of the IEC tasks.

112SysRestoreRetains

can be used to restore the values of retain variables, which have been saved in a file

113 SysSaveRetains can be used to save the values of retain variables in a file

114  SysWdgEnable can be used to activate resp. deactivate the watchdog for a specified task

115 18SysLibPorts.lib

can be used to communicate with external hardware devices via their port addresses; 

e.g. realtime clock, graphic controller etc. The port addresses can accessed reading and 

writing. The execution is synchronous.

116SysPortIn

returns the byte value at that port address, which has been passed on by wPort.

117SysPortInW

returns the byte value at that port address, which has been passed on by wPort.

118 SysPortInD type DWORD returns the byte value at that port address

119SysPortOut

type BOOL writes the BYTE value which is passed on by byData to that port address 

which is passed on by wPort

120SysPortOutW

writes the WORD value which is passed on by byData to that port address which is 

passed on by wPort.

121SysPortOutD

type BOOL writes the DWORD value which is passed on by byData to that port address 

which is passed on by wPort

122 19SysLibProjectInfo.lib

then the functions contained in this library can be used to read the Project Info (CoDeSys 

Menu 'Project' 'Project Info') respectively the Project ID.

123Project Info

provides the components of the project info which was entered in the programming 

system

124

Project ID

returns the project ID. The ID is generated by CoDeSys. It is used by CoDeSys to 

determine whether the project in the editor and the project on the controller are 

identical, whether an online change can be performed, or whether they are different 

projects.

125 20SysLibRtc.lib

This library contains functions for accessing the realtime clock of the local system

126SysRtcCheckBattery

checks the status of the battery of the computer, which is important for the exactness of 

the shown clock time.

127 SysRtcGetHourMode can be used to read the display mode of the realtime clock of the local system.

128 SysRtcGetTime returns the current time which is read from the PC clock.

129 SysRtcSetTime can be used to set the realtime clock of the local system.

130 21SysLibSem.lib

This library can be used to create and use semaphores for the synchronization of tasks. 

The semaphores serve to avoid any concurrent access on critical data, which are used by 

several tasks.

131 SysSemCreate for creating a semaphore

132 SysSemDelete for deleting a semaphore

133 SysSemEnter for occupying a semaphore

134 SysSemLeave for leaving a semaphore

135 SysSemTry for checking whether a semaphore is occupied already by another task

136 22SysLibShm.lib This library provides functions for accessing a memory area which is used in common by 

several processes resp. referencing a physical address (Shared‐Memory, shortcut ShM).

137 SysShmOpen opens a Shared Memory.

138 SysShmClose closes the Shared Memory,

139 SysShmRead read a defined number of bytes from a Shared Memory

140 SysShmWrite can be used to write a defined number of bytes to a Shared Memory

141 23SysLibSockets.lib

This library supports the access on sockets for the communication via TCP_IP and UDP.

142SysSockAccept

calls the function accept of the operating system, which can accept a connection request 

to the socket

143

SysSockBind

calls the function bind of the operating system. This function will allocate a local address 

to the socket which was assigned before just to an address range by SysSockCreate. 

Usually the "binding" will be done before functions like SysSockListen or SysSockAccept 

are called for a socket.

144SysSockClose

calls the function closesocket of the operating system, in order to close a socket.

145

SysSockConnect

calls the function connect of the operating system. In case the socket has not yet been 

"bound" by the SysSockBind function, now automatically a local address will be assigned 

to it. Afterwards the socket will be ready to send and /or receive data.

146SysSockCreate

calls the function socket of the operating system. A new socket will be created and 

assigned to a Service Provider

147SysSockGetHostByName

ruft die Funktion hostGetByName (VxWorks) resp. gethostbyname (win32) of the 

operating system.

148SysSockGetHostName

calls the function gethostname of the operating system and returns the host name.

149SysSockGetOption 

calls the function getsockopt of the operating system, in order to get the value of a 

particular socket option.

150SysSockGetLastErrorSync

calls the function getlasterror of the operating system, which returns the error code of 

the last error occurred at the given socket.

151SysSockGetLastError

calls the function getlasterror of the operating system, which returns the error code of 

the last error occurred at the given socket.

152SysSockHtonI

calls the function htonl of the operating system, which will convert a u_long value from 

host byte order to TCP/IP network order..

153SysSockHtons

calls the function htons of the operating system, which converts a short value from host 

byte order to TCP/IP network order.

154

SysSockInetAddr calls the function inet_addr of the operating system, which converts a string, containing 

an internet address, in an address which can be used in the IN_ADDR structure.

155SysSockInetNtoa

calls the function inet_ntoa (Win32) resp. inet_ntoa_b (VxWorks), which converts an 

Internet network address in a string in Internet standard format..

156SysSockloctl

calls the function ioctl of the operating system in order to control the I/O mode of the 

socket.

157

SysSockListen

calls the function listen of the operating system. This function will cause the socket to 

listen to connection requests and to queue them until they can be accepted by the 

SysSocketAccept function.

158SysSockNtohI

calls the function ntohl of the operating system, which converts a u_long value of the 

TCP/IP network order to the host byte order.

159SysSockNtohs

calls the function ntohs of the operating system, which converts a u_short value from 

the TCP/IP network order to the host byte order.

160

SysSockSelectcalls the function select of the operating system to check whether one or several sockets 

are ready for certain communication actions. The group of sockets, to which this request 

should be applied, can be defined via the structure SOCKET_FD_SET.

161SysSockSetIPAddress

is only implemented for VxWorks targets. It sets the IP address of the given card.

162SysSockSetOption

calls the function getsockopt of the operating system in order to set particular socket 

options..

163

SysSockShutdown

calls the function shutdown of the operating system in order to inhibit further send or 

receive actions. The function does not close the socket ! This must be done via 

SysSockClose.

164 TCP specific:

165SysSockRecv

calls the function read (VxWorks) resp. recv (Win32) of the operating system in order to 

receive data which have been sent to the socket.

166

SysSockSend This TCP/IP specific function (library SysLibSockets.lib) of type DINT calls the function 

send of the operating system in order to send the data which are buffered at the socket.

167 UDP specific:

168SysSockRecvFrom,

calls the function recvfrom of the operating system, in order to read the data which 

have been sent to the socket.

169SysSockSendTo

calls the function send of the operating system in order to send the data which are 

stored at the socket.

170 24SysLibSocketsAsync.lib This library offers the same functionality as SysLibSockets.lib, however function blocks 

instead of functions are used and the processing is asynchronous.

171 SysSockAcceptAsync

172 SysSockBindAsync

173 SysSockCloseAsync

174 SysSockConnectAsync

175 SysSockCreateAsync

176 SysSockGetHostByNameAsync

177 SysSockGetHostNameAsync

178 SysSockGetLastErrrorAsync

179 SysSockGetOptionAsync

180 SysSockHtonIAsync

181 SysSockHtonsAsync

182 SysSockInetAddrAsync

183 SysSockInetNtoaAsync

184 SysSockloctlAsync

185 SysSockListenAsync

186 SysSockNtohIAsync

187 SysSockNtohsAsync

188 SysSockSelectAsync

189 SysSockSetIPAddressAsync

190 SysSockSetOptionAsync

191 SysSockShutdown

192 TCP specific:

193 SysSockRecvAsync

194 SysSockSendAsync

195 UDP specific:

196 SysSockRecvFromAsync,

197 SysSockSendToAsync

198 25

SysLibStr.libThis library provides functions for string operations. If the target system is supporting 

the functionality, the following functions can be used to compare or copy strings or to 

retrieve the length of a string. The execution is synchronous.

199 SysStrCmp compares lexicographically two strings

200 SysStrCmpI checks whether two strings are identical

201SysStrCmpN

compares the size of two strings, whereby a defined number of characters counted from 

the beginning of the string will be considered.

202SysStrCmpNI

checks whether a defined number of characters of two strings (starting at the beginning 

of the string) are identical

203 SysStrCpy copies one string (Str1) to another (Str2).

204 SysStrLen acquires the length of a string

205 26 SysLibSymbols.lib

206SysLibGetSymbolAddress

can be used to read the physical address of a symbol of an IEC project. The processing is 

done synchronously.

207 27SysLibTasks.lib

can be used to manage tasks. That means to generate, to delete, to modify priority level, 

to stop and restart tasks. The execution is synchronous.

208SysTaskCreate

creates a new task. It will return an unique Id number for the task, which is required as 

an input parameter for the other functions of SysLibTask.lib.

209SysTaskDestroy

can be used to delete a task. It will return TRUE, if the operation has succeeded, 

otherwise FALSE.

210 SysTaskGetInfo returns information on a task, which is identified by the task Id.

211 SysTaskGetPriority returns the priority of the task identified by the task Id.

212SysTaskSetPriority

can be used to define the priority level for a task which is identified by the task Id.

213 SysTaskSuspend can be used to stop a task during operation.

214SysTaskResume

can be used to continue the processing of a task, which was stopped before by the 

function SysTaskSuspend

215 Functions to be used within a task:

216SysTaskSleep

can be used to interrupt the processing in a running task and to make it continue after a 

defined period of time.

217SysTaskEnd

should be called by a task as soon its processing has been terminated. Typically this 

should be done immediately before the task is left.

218SysTaskGetCurrent

can be called by the currently processing task in order to get returned the own task Id.

219 28SysLibTime.lib

This library provides function blocks for reading the realtime clock of the local system. 

The execution is synchronous.

CurTimeprovides the realtime of the local system in microseconds; using the structure 

SysTime64.

CurTimeEx provides extended information on the realtime clock data on the local system.

Festo_CPX.lib 

(CAA‐Merger‐7.chm)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.

DiagnosisCPX_DiagnosticsUpdate Initiates the process for reading out all diagnostic information.

CPX_GetFaultString Translates error numbers into text.

CPX error handlingCPX_ClearErrorLED Resets the CPX error LED

CPX system functionsCPX_CICommand Initiates the process for reading out all diagnostic information.

CPX_GetParameter For reading out CPX parameters

CPX_SetParameter For writing CPX parameters

Festo_CPX_extern.lib

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.

Festo_Motion.lib 

(CAA‐Merger‐5.chm)Festo_Motion.lib is an internal library for CoDeSys 2.3. This library 

can be used to control the following types of Festo motor controller (drive controller):

CMMP‐AS‐...

CMMS‐AS‐...

CMMS‐ST‐...

SFC‐DC‐...

MTR‐DCI‐...

SFC‐LAC‐...

SFC‐LACI‐...

CMMP‐AS‐... Control de servomotores Linea Premium

CMMP_AS_CTRL for controlling the relevant Festo motor controller

CMMP_AS_PRM_INIT for parameterising the relevant Festo motor controller types

CMMP_AS_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

CMMS‐AS‐... Control de servomotores

CMMS_AS_CTRL for controlling the relevant Festo motor controller

CMMS_AS_PRM_INIT for parameterising the relevant Festo motor controller types

CMMS_AS_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

CMMS‐ST‐... Control de Motores a Pasos

CMMS_ST_CTRL for controlling the relevant Festo motor controller

CMMS_ST_PRM_INIT for parameterising the relevant Festo motor controller types

CMMS_ST_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

MTR‐DCI‐... Control Servomotor DC

MTR_DCI_CTRL for controlling the relevant Festo motor controller

MTR_DCI_PRM_INIT for parameterising the relevant Festo motor controller types

MTR_DCI_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

SFC‐DC‐... Control de SLTE, Mordazas eléctricas

SFC_DC_CTRL for controlling the relevant Festo motor controller

SFC_DC_PRM_INIT for parameterising the relevant Festo motor controller types

SFC_DC_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

Librerias Festo

SFC‐LAC‐... Contro de HMPE

SFC_LAC_CTRL for controlling the relevant Festo motor controller

SFC_LAC_PRM_INIT for parameterising the relevant Festo motor controller types

SFC_LAC_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

SFC‐LACI‐... Control Servomotores Lineales

SFC_LACI_CTRL for controlling the relevant Festo motor controller

SFC_LACI_PRM_INIT for parameterising the relevant Festo motor controller types

SFC_LACI_PRM_SINGLE for transferring individual parameters to the relevant Festo motor controller

Festo_EasyIP.lib library(CAA‐Merger‐6.chm)EasyIP allows the simple connection of different Festo controllers to 

form a network.

Easy_SetIPAddr This function adds the IP addresses of the other stations to the IP table.

Easy_SetTimeOut This function sets the timeout time to a multiple of the set task cycle time.

Easy_S The function sends an EasyIP package to an EasyIP station.

Easy_R The function sends a request to a station.

Easy_SR The function sends data and a request to an EasyIP station.

Easy_Server Attach Easy_Server to a cyclic task

CallbackEasyDeInit

IncEnc.lib 

(CAA‐Merger‐5.chm)  The function blocks of the IncEnc.lib support the latch functionality 

of the incremental encoder interface module CECX‐C‐2G2. The latch function uses a 

digital input on the encoder (latch input) in order to save data of the encoder during 

change of edge of the input. 

IncEnc_SetCount This block is used for setting of a counter status (Count) at the occurrence of a special 

event (Mode). 

IncEnc_Latch_ZeroThe block reads the counter status (Count) of an incremental encoder during processing 

of the zero impulse.

IncEnc_Latch_DIThe block is used for reading out of the counter status (Count) when setting and the time 

period after the setting of a latch input (TimeStamp).

Ethernet.lib

(CAA‐Merger‐3.chm) The functions of the Ethernet library support the handling of IP 

configurations. Similar to the settings in 'Network Configuration', the network settings 

can be made per function call. 

EthGetIPConfig For reading of the IP configuration

EthSetIPConfig For setting of the IP configuration

EventData.lib (CAA‐Merger‐4.chm) The functions of the EventData library support the handling of data 

from system events, that are triggered by interrupts from inputs of digital input 

modules. 

GetLastIntrEdge  Returns interrupt data.

PLCService.lib (CAA‐Merger‐7.chm ) The functions of the library PLCService.lib return data from the 

control with the exception of PLCReboot.

PLCGetCPUClock Returns counter value of the CPU clock

PLCGetCPUClockRate Returns CPU clock frequency

PLCGetDeviceName Returns device description

PLCGetFirmwareVersion Returns firmware version.

PLCGetHoursCounter Returns operating hours counter

PLCGetLicenceOption Returns license options

PLCGetSerialNo Returns serial number of the control

PLCGetSystemVersion Returns system version

PLCGetVendorName Returns vendor name

PLCReboot Triggers reboot of the control.

SysLibComEx.lib 

(CAA‐Merger‐8.chm) The SysLibComEx library is an extension for the handling of serial 

interfaces.

All serial interfaces can in principle be operated via the SysLibCom.lib. A special port 

must be specified when opening the interface of a serial interface module.

SysComSetMode For the switching over to RS‐485 and vice versa. ???

KSys.lib Librería Interna utilizada en conjunto con IncEnc.lib

TestFunctions.lib Librería solo para uso Interno de otras librerias

to CoDeSys_SoftMotion_V23_E.pdf

Librerí Función Comentario

SM_PLCopen.libSe recoienda leer la especificación  "Function blocks for motion control, version 1.0"

Al parecer la librería cuenta con más funciones de las aquí mostradas1 Modulos para control de ejes Individuales

2 MC_ReadStatus provides some particular states of an axis3 MC_ReadAxisError provides information on general errors which have occurred at the drive4 SMC_Reset reset the axis‐state (SMC_AXIS_STATE) from "error_stop" to "standstill".5 MC_ReadParameter can be used to read some standard parameters of the drive structure6 MC_ReadBoolParameter can be used to read some standard parameters of the drive structure7 MC_WriteParameter can be used to set some standard parameters of the drive structure8 MC_WriteBoolParameter can be used to set some standard parameters of the drive structure9 MC_ReadActualPosition provides the current position of the drive10 MC_ReadActualVelocity provides the current velocity of the drive.

11 MC_ReadActualTorque provides the current torque resp. the current power of the drive.

12 MC_Power controls the ON‐/OFF‐switch and the status of the brakes of the drive. If a drive has not 

been switched ON in this way, if the controller has not been unblocked or if the brake has 

not been released, no motion control is possible13 MC_Home starts a manufacturer‐specific (!) reference move in the drive. This motion is solely initiated 

by the Drive Interface14 MC_Stop

decelerates the axis to velocity 0. No interrupt is possible and the axis will be blocked as 

long as the input "Execute" is TRUE and the axis not yet has been stopped completely15 mc_halt decelerates the axis to velocity 0. The module can be interrupted and in contrast to 

MC_Stop does not block the axis. 16 MC_MoveAdditive

has two different modes of action, depending on the current state of the axis:

discrete_motion:

The Distance value will be added to the target position of the module which is currently 

processing on the axis. The motion will aim at the new target position then.

continuous_motion or standstill: 

The Distance will be covered referring to the current position, regarding the given 

parameters.17 MC_MoveAbsolute moves the axis to an absolute position according to the defined velocity, deceleration and 

acceleration values18 SMC_MoveContinuousAbsolute moves the axis to a fix position according to the defined velocity, deceleration and 

acceleration values. In contrast to MC_MoveAbsolute the user additionally can define an 

end velocity, which the axis should have at this fix position and which is shown by output 

InEndVelocity19 MC_MoveRelative

moves the axis by a relative distance according to the defined velocity, deceleration and 

acceleration values. The distance can have positive or negative values.

20 smc_movecontinuousrelative moves the axis by a relative distance according to the defined velocity, deceleration and 

acceleration values21 MC_MoveSuperImposed causes, where appropriate, additionally to the currently active motion another one, which 

makes the axis passing a defined distance. 22 MC_MoveVelocity causes a non‐stop motion of the axis with a predefined velocity (AXIS_REF). 23 MC_PositionProfile follows a defined position profile.24 MC_VelocityProfile is analog to the module MC_PositionProfile. But here in the input variable of type structure 

MC_TV_REF the position points are defined by their velocities. 

25 MC_AccelerationProfileis analog to the MC_PositionProfile module. But here in the input variable of type structure 

MC_TA_REF the position points are defined by their acceleration values.26 MC_SetPosition shifts the zero point of the axis

Librerias de Motion

27 MC_TouchProbe can be used to detect very precisely the position of the drive via a fast input28 MC_AbortTrigger aborts a latching which is currently done on the trigger input..29 Modulos para control sincronizado de motores30 MC_CamTableSelect you can select a CAM, determine the master and the slave axes for this CAM and do some 

presettings.31 MC_CamIn you can realize a CAM which has been selected by MC_CAMTABLESELECT. 

In addition to the offsets and scaling also the start mode can be defined. 

32 MC_CamOut you can disengage the slave drive from the master. The slave will be driven on with the 

current velocity.33 MC_GearIn you can couple the slave axis to the master axis34 MC_GearOut you can disengage the slave drive from the master. The slave will be driven on with the 

current velocity. 

35 MC_GearInPosyou can couple the slave axis to the master axis synchronously to position and velocity

36 MC_Phasing you can effect a constant distance between master axis and slave axis. In this case master 

and slave of course have identical velocity and acceleration.37 Elementos adicionales de la librería38 SMC_GetCamSlaveSetPosition This module calculates the current target position of an axis (slave) for the case that the axis 

would be coupled via a CAM to the motion of another axis (Master). Therby both axes are 

not moved or affected.39 SMC_CAMBounds

This function block calculates the maximum set points for position, velocity and 

acceleration/deceleration of the slave, if that is absolutely bound to a master, which is 

moved according to a prescribed maximum velocity and acceleration/deceleration. 

40 SMC_CAMEditor, SMC_CAMVisu With these modules an Online‐CAM‐Editor can be created41 SMC_CAMRegister

represents a tappet control unit. It works ‐ like MC_CamIn – on a MC_CAM_REF‐structure, 

negating the original path information and only reading the tappet information.42 SMC_GetTappetValue This function block, which is part of the SM_PLCopen.lib, evaluates the output Tappets of 

function block MC_CamIn and contains the current tappet status.

43 mc_digitalcamswitch This function block like SMC_CamRegister represents a tappet control unit. Up to 32 

outputs can be switched. Moves in all directions are allowed44 SMC_ReadSetPosition reads the currently set position of the drive.45 SMC_SetTorque can be used to create a torque, if the drive is in controller mode "torque".46 SM_CAN.lib Motion\Drives\CAN47 SMC_ReadCANParameter  The functionality is similar to that of the modules MC_ReadParameter and 

MC_WriteParameter:48 SMC_WriteCANParameter The functionality is similar to that of the modules MC_ReadParameter and 

MC_WriteParameter:49 SM_CNC.lib

This library provides modules for realizing the SoftMotion functionality in an IEC‐program50 SMC_NCDecoder Decoding of the path which has been programmed in the CNC‐Editor in order to get 

structure objects51 SMC_GCodeViewer It gathers and stores the textual representation (G‐Code) of the particular GeoInfo objects 

and dumps those as an ARRAY OF STRING, which e.g. via a table can be displayed in a 

visualization52 SMC_ToolCorr Path‐preprocessing: tool radius correction53 SMC_AvoidLoop Path‐preprocessing: avoids loops in the path54 SMC_SmoothPath Path‐preprocessing: slurs the path by splines55 SMC_RoundPath Path‐preprocessing: rounds the path by circular arcs56 SMC_CheckVelocities Check of the end velocities of the segments57 SMC_Interpolator Check of the end velocities of the segments

58 SMC_LimitCircularVelocities This module (SM_CNC.lib) checks the particular elements of the OutQueue and limits the 

path velocities of circular elements  against their radii.

59 SMC_Interpolator Moduleis used to convert a continuous path which is described by SMC_GEOINFO‐objects, into 

discrete path position points, thereby regarding a defined velocity profile and time pattern. 60 SMC_GetMParameters

This function block can be used – if the Interpolator currently works on a M‐Function ‐ to 

poll the parameters which have been set for this M‐Function (K, L, O, see HERE).

61 SMC_Interpolator2Dir This module corresponds concerning function and allocation of its inputs and outputs to 

function block SMC_Interpolator, with the difference that it can also reversely interpolate a 

path.

62 Auxiliary Modules for Path Rotations, Translations and Scalings63 SMC_ROTATEQUEUE2D

The path stored in poqDataIn  will be rotated around the Z‐axis by the angle given by dPhi 

[°]. A positive angle effects a positive rotation in mathematical sense (counterclockwise).64 SMC_TRANSLATEQUEUE3D The path stored in poqDataIn will be translated according to the vector given by vec, which 

is of structure type SMC_VECTOR3D (see SMC_VECTOR3D).

65 SMC_SCALEQUEUE3D� The path contained in poqDataIn will be stretched by factor fScaleFaktor.

66 Settings via global variab67 g_fSMC_CNC_EPS Epsilon value for accurate examination for zero68 g_fSMC_CNC_EPS_RELUCTANT Epsilon value for tolerant examination for zero69 SM_Trafo.lib This library is an extension for the SM_CNC.lib and provides modules, which can be used for 

transformation of GEO‐ to drive coordinates and the axis control (position, 

position/velocity, velocity).70 Portal Systems71 SMC_TRAFO_Gantry2 For portal systems no transformation must be done, thus the modules  of the SM_Trafo.lib 

(SMC_TRAFO_Gantry2, SMC_TRAFOF_Gantry2, SMC_TRAFO_Gantry3, 

SMC_TRAFOF_Gantry3, GantryCutter) just add offset on the  x‐, y‐ and z‐axes.

72 SMC_TRAFOF_Gantry2 ""73 SMC_TRAFO_Gantry3 ""74 SMC_TRAFOF_Gantry3, ""75 GantryCutter These  function blocks do transformations for portal systems with one rotation axis, which is 

controlled in a way, that it points along the current path tangent.76 H‐Portal System with stationary drives77 SMC_TRAFO_GantryH2

This function block for H‐Portal systems with stationary drivesis part of the SM_Trafo.lib.78 SMC_TRAFOF_GantryH2

This function block for H‐Portal systems with stationary drivesis part of the SM_Trafo.lib. 

79 2‐Jointed Scara‐Systems80 SMC_TRAFO_Scara281 SMC_TRAFOF_Scara282 Portal Systems with Tool Offset83 SMC_TRAFO_Gantry2Tool184 SMC_TRAFOF_Gantry2Tool185 SMC_TRAFO_Gantry2Tool286 SMC_TRAFOF_Gantry2Tool287 3‐Jointed Scara‐Systems88 SMC_Trafo_Scara3

89 SMC_TRAFOF_Scara390 Parallel‐Kinematics91 SMC_TRAFO_Tripod92 SMC_TRAFOF_Tripod93 Spacial Transformations94 SMC_CoordinateTransformation3D95 SMC_UnitVectorToRPY96 SMC_DetermineCuboidBearing97 SM_CNCDiagnostic.lib This library provides auxiliary modules which can be very useful during the implementation 

phase of a CNC program, because they help to display the data which are exchanged 

between the modules.98 SMC_ShowCNCREF can display the first ten lines of a NC program, which is available in form of a data structure 

SMC_CNC_REF, in text strings (Din66025).99 SMC_ShowQueue rovides the first ten SMC_GeoInfo objects of an OutQueue in form of an ARRAY OF POINTER 

TO SMC_GeoInfo.100 SM_DriveBasic.lib CoDeSys will automatically generate structure objects based on the drive image which has 

been configured in the PLC Configuration editor. These structures can be accessed by the 

IEC program101 SMC_ErrorString returns a string representation of the error, depending on the inputs ErrorID (SMC_Error) 

and Language (SMC_LANGUAGE_TYPE (English, German)).102 SMC_sgn returns the value of the sign of the input; thus –1 if the input is negative, +1 if it is positive 

and 0 if it is zero.103 SMC_fmod calculates the modulo value of the input x for period m. The return value always is within 

the interval [0, m].104 SMC_atan2 calculates and returns the angle alpha, which solves the following equations:

sin(alpha) * f = Sinus and cos(alpha) * f = Cosine.105 SMC_ChangeGearingRatio can change the gearing ratio and the type of the drive.

106 SMC_CheckLimits checks whether the actual set points of the drive exceed the maximum values configured in 

the controller and indicates the check result in output bLimitsExceeded.

107 SMC_ControlAxisByPos writes target positions n to a drive structure and checks the structure for jumps

108 SMC_ControlAxisByPosVel This module of SM_DriveBasic.lib works similar to SMC_ControlAxisByPos, but additionally 

the velocity can be defined.109 SMC_ControlAxisByVel works similar to SMC_ControlAxisByPos, but the axis is not controlled by the position but by 

the velocity110 SMC_FollowPosition writes position set points to the axis and does no checks.

111 SMC_FollowPositionVelocity writes position and velocity set points to the axis without doing any checks. The user must 

care for a reasonable matching of the values.112 SMC_FollowVelocity writes set velocities to the axis without doing any checks.

113 SMC_IsAxisGroupReady tells about the status of an axisgroup

114 SMC_IsAxisGroupReady by a boolean variable returns whether the startup, which implicitly is done for each 

axisgroup, has been terminated and thus the group with its axes is operable (TRUE), or 

whether the startup is still going on or an error has occurred (FALSE).

115 SMC_ResetAxisGroup With this function block of SM_DriveBasic.lib a complete axisgroup can be reinitialized.

116 SMC_SetControllerMode If supported by the drive this module of SM_DriveBasic.lib can be used to switch to another 

controller mode.

117 SM_Error.libThis library must be available in each project, because it contains all error definitions. It is 

used to display each error produced by a SoftMotion module as a string.118 SMC_ErrorString Depending on the inputs ErrorID (enumeration SMC_Error) and Language 

(SMC_LANGUAGE_TYPE (English, German)) the function SMC_ErrorString returns a string 

representing the error.

119 SM_FileFBs.lib This library provides modules for the file functionality.

mx0gni
Typewritten Text

120 SMC_ReadNCQueue This module reads an OutQueue file, which has been created by the CNC editor, from the 

PLC file system and provides an OutQueue structure, which typically is processed by the 

Interpolator.

121 SMC_ReadNCFile

reads a NC‐ASCII‐file from the file system of the controller, in order to make it available for 

the SMC_NCDecoder. Thus at runtime a NC program can be read in and realized.

122 SMC_ReadCAM is used to load a CAM, which has been created in the CAM editor and has been saved in a 

*.CAM file, at runtime and to make it available for the modules MC_CamTableSelect and 

MC_CamIn.

123 SMC_AxisDiagnosticLog

This module (SM_FileFB.lib) can be used to write cyclically a selection of values of an axis to 

a file. A file created in this way ideally can be used for diagnosis purposes.

Librerias por Desarrollar

SM_Startup_Diagnostic.lib

3S_CanDrv.lib checar 

FestoCANdrive.lib

SM_CANWatch.lib

Dummydrive.lib

nes por ubicar en la inea de softmotion drive interfazse

SMC_TimeAxisFB

SMC_HomingSMC_GetMaxSetVelocity