You are on page 1of 22

Enero 2010 Version Preliminar

Festo Gerardo Niembro

NombreLibreria PD=Pordefecto
SysLibCallback.lib

FEDCEC

CPXCEC

CECXC1

CECXM1

Proveedor

Notas ThislibraryprovidesthefunctionsSysCallbackRegisterand SysCallbackUnregister,whichservetoactivatedefinedcallbackfunctionsfor runtimeevents. Thislibrarysupportstheserialcommunicationwithatargetsystem.Ifthe targetsystemprovidesthefunctionality,thenthefollowinglibraryfunctions canbeusedtoopenorcloseaserialportandtoreadorwritedataviathisport (Theexecutionissynchronous.): handleafiledirectorysystemonthetargetsystem.Entriesofthedirectorycan bereadandmodified.Theexecutionissynchronous. Thefunctionsofthislibraryservetoaccessvariablesbyindiceswithwhichthey arereferencedintheruntimesystem.Fordetailedinformationseethe descriptionoftheparticularruntimesystem. Thislibraryservestosynchronizeandcontroltheprocessingoftwo(IEC)tasks. ManjodeArchivos ThislibrarysupportsasynchronousfileaccessfromtheIECapplication ThislibraryprovidesfunctionswhichcorrespondtoANSICfunctionsforfile streamoperations.Theexecutionissynchronous. thestartaddressandthesizeofadatasegment(Memory,Input,Output, RetainorGlobal)inaDWORD thislibrarycanbeusedtocallinformationontheconfigurationofIECtasks.(To create,delete,prioritize,stopandrestartataskyoucanusethelibrary SysLibTasks.lib.)Theexecutionissynchronous. Thislibrarycontainsafunctionwhichcanbeusedtoinitializeanexternal library,whichisavailableasanobjfile.Theexecutionissynchronous. usethislibrarytosetandremoveaninterrupthandlerforafunction.The executionissynchronous. Thislibrarycanbeusedformemorymanagement.Ifthetargetsystem supportsthefunctionality,thefollowinglibraryfunctionsareavailableto allocate,tofree,todefine,tocomparememorylocationsandtocopy,moveor swapbetweendifferentmemorylocations.Theexecutionissynchronous. ThislibraryisdesignedforaccesstoaPcicardpluggedtothePlc ThislibrarysupportsthereadingoftheconfigurationdataofthePLC Configuration ThislibrarycontainsthefollowingfunctionsforcontrollingaPLC.Theexecution issynchronous. canbeusedtocommunicatewithexternalhardwaredevicesviatheirport addresses;e.g.realtimeclock,graphiccontrolleretc.Theportaddressescan accessedreadingandwriting.Theexecutionissynchronous.

si

si,PD

si

si

3S,Adaptadas

SysLibCom.lib

si si

si si si

si si si si si si si si si si

3S,Adaptadas

SysLibDir.lib

3S,Adaptadas

SysLibDirect.lib

SysLibEvent.lib SysLibFile.lib SysLibFileAsync.lib SysLibFileStream.lib SysLibGetAddress.lib

si si si si si si si si

si si si si si si si

3S,Adaptadas 3S,Adaptadas 3S,Adaptadas 3S,Adaptadas 3S,Adaptadas 3S,Adaptadas

SysIECTasks.lib

SysLibInitLibrary.lib

SysLibInt.lib

SysLibMem.lib

si

si

si

si

3S,Adaptadas

SysLibPciCards.lib SysLibPLCConfig.lib SysLibPlcCtrl.lib

si

si si

si si

3S,Adaptadas

SysLibPorts.lib

SysLibProjectInfo.lib

si si si si

si si si si

si si si si si si

3S,Adaptadas 3S,Adaptadas 3S,Adaptadas

SysLibRtc.lib

SysLibSem.lib

SysLibShm.lib

SysLibSockets.lib

si

si si

si si

3S,Adaptadas 3S,Adaptadas

thenthefunctionscontainedinthislibrarycanbeusedtoreadtheProjectInfo (CoDeSysMenu'Project''ProjectInfo')respectivelytheProjectID. Thislibrarycontainsfunctionsforaccessingtherealtimeclockofthelocal system Thislibrarycanbeusedtocreateandusesemaphoresforthesynchronization oftasks.Thesemaphoresservetoavoidanyconcurrentaccessoncriticaldata, whichareusedbyseveraltasks. Thislibraryprovidesfunctionsforaccessingamemoryareawhichisusedin commonbyseveralprocessesresp.referencingaphysicaladdress(Shared Memory,shortcutShM). ThislibrarysupportstheaccessonsocketsforthecommunicationviaTCP_IP andUDP. ThislibraryoffersthesamefunctionalityasSysLibSockets.lib,howeverfunction blocksinsteadoffunctionsareusedandtheprocessingisasynchronous. Thislibraryprovidesfunctionsforstringoperations.Ifthetargetsystemis supportingthefunctionality,thefollowingfunctionscanbeusedtocompareor copystringsortoretrievethelengthofastring.Theexecutionissynchronous.

SysLibSocketsAsync.lib

SysLibStr.lib

si

si si si

si

si

3S,Adaptadas 3S,Adaptadas

SysLibSymbols.lib SysLibTasks.lib

si si

si si

3S,Adaptadas 3S,Adaptadas 3S,Adaptadas

SysLibTime.lib

si

si,PD si si,PD si si si si si si

canbeusedtomanagetasks.Thatmeanstogenerate,todelete,tomodify prioritylevel,tostopandrestarttasks.Theexecutionissynchronous. Thislibraryprovidesfunctionblocksforreadingtherealtimeclockofthelocal system.Theexecutionissynchronous.

pordesglosar pordesglosar pordesglosar pordesglosar

SysLibVisu.lib SysTaskInfo.lib NetVarUdp_LIB_V23.lib

si
endir si endir

si
endir si endir noesta

3S,Adaptadas 3S,Adaptadas 3S Festo Festo Festo Festo ModulesforcommunicatingviaModbusTCP. ModulesforeasydataexchangebetweenEasyIPcompatiblecontrollersand devices. Modulesforparameterisingandcontrollingmotorunitsandmotorcontrollers fromFesto. FunctionblocksfortheCPXvalveterminal. HiddenlibrarythatisloadedautomaticallyinaCPXCECproject.

ModbusTCPSrv.lib Festo_EasyIP.lib Festo_Motion.lib Festo_CPX.lib Festo_CPX_extern.lib


FestoMotion_V0.2.lib

endir

noesta ThelibraryprovidesfunctionsthatarerequiredbyotherFestolibraries. ModulesthattheIEC611313requiresasstandardmodulesforanIEC programmingsystem.

Standard.lib

si,PD

si

3S,StandardlibrariesforCoDeSys

Util.lib AnalyzationNew.lib pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar IecSfc.lib AnaLyZATION.lib 3S_CanDrv.lib 3S_CANopenManager.lib 3S_CANopenMaster.lib 3S_CanOpenDevice.lib BusDiag.lib Ethernet.lib EventData.lib IncEnc.lib PLCService.lib SysLibComEx.lib pend pend pordesglosar pordesglosar KSys.lib TestFunctions.lib HilscherPBInfo.lib Hilscher.lib SysLibDPV1Hilscher.lib pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar pordesglosar ModbusTCPSrv.lib Dummydrive.lib SM_CNC.lib SM_CNCDiagnostic.lib SM_DriveBasic.lib SM_Error.lib SM_FileFBs.lib SM_PLCopen.lib SM_Startup_Diagnostic.lib SM_Trafo.lib 3S_CanDrv.lib FestoCANdrive.lib SM_CAN.lib SM_CANWatch.lib

si,PD si si,PD si si si si

si si

3S,StandardlibrariesforCoDeSys 3S,StandardlibrariesforCoDeSys 3S,StandardlibrariesforCoDeSys enDir3s 3S,StandardlibrariesforCoDeSys si 3S,CANopenlibraries

ModulesforBCDconversion,bit/bytefunctions,mathematicalhelpfunctions, controllers,signalgenerators,functionmanipulatorsandanaloguevalue processing. Modulesforanalysingexpressions. ActionControl OnlyforinternaluseincombinationwiththeCANopenmaster. OnlyforinternaluseincombinationwiththeCANopenmaster. OnlyforinternaluseincombinationwiththeCANopenmaster. DiagnosisforCANopenbussystems. Modulesfornetworkconfiguration Modulesforevaluatinginterruptibleinputs Modulesforlatchfunctionsofincrementalencoders Modulesforcontrolservices(e.g.operatinghourscounter,version information,.) ModulesforswitchingthemodebetweenRS485/422. Internalmodules. Internalmodules.

si si si
endir

si si
endir

3S,CANopenlibraries 3S,CANopenlibraries 3S,Adaptada Libreriasespecificasparatajet Libreriasespecificasparatajet Libreriasespecificasparatajet Libreriasespecificasparatajet Libreriasespecificasparatajet Libreriasespecificasparatajet Libreriasespecificasparatajet EnsubDirProfibus EnsubDirProfibus EnsubDirProfibus 3S,Adaptada Motion Motion Motion Motion Motion Motion Motion Motion Motion Motion Motion Motion Motion

si si si si si si si si
si si si

si si si si si si si si
si si si si endir endir endir endir endir endir endir endir endir endir endir endir endir

endir

si

ThislibrarysupportstheacyclicProfibusDPV1,Class1,ReadandWrite ServicesforthedatatransferbetweenMasterandSlaves.Thedataare addressedwithintheslavesbyslotandindex.(ConcerningthisseethePBDP standard.) ModBusTCPServer

Dudas PorqueCECXC1yCECXm1notienenlalibreradeFestoMotion LalibreradeAnalyzationyAnalyzationNewsondiferentes,porqueseusanas,ysediferenciaalosPLCquelausan Pendientes: Verificarcontralistadorealdeldirectoriodecadaequipo

OPERADORESIEC
ListadoParcial,esposiblequefaltenalgunasfunciones

OperadoresIEC
ADD MUL SUB DIV MOD
Additionofvariablesofthetypes:BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT, REALandLREAL. Multiplicationofvariablesofthetypes:BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT, UDINT,REALandLREAL. Subtractionofonevariablefromanotherofthetypes:BYTE,WORD,DWORD,SINT,USINT,INT, UINT,DINT,UDINT,REALandLREAL. Divisionofonevariablebyanotherofthetypes:BYTE,WORD,DWORD,SINT,USINT,INT,UINT, DINT,UDINT,REALandLREAL. ModuloDivisionofonevariablebyanotherofthetypes:BYTE,WORD,DWORD,SINT,USINT,INT, UINT,DINT,UDINT.Theresultofthisfunctionwillbetheremainderofthedivision.Thisresultwill beawholenumber. Assignmentofavariabletoanothervariableofanappropriatetype.AsMOVEisavailableasabox inthegraphiceditorsLD,CFC,therethe(unlocking)EN/EN0functionalitycanalsobeappliedona variableassignment.IntheFBDeditorthisisnotpossiblehowever. ThisfunctionisnotprescribedbythestandardIEC611313. ThisfunctionisnotprescribedbythestandardIEC611313. BitwiseANDofbitoperands.TheoperandsshouldbeofthetypeBOOL,BYTE,WORDorDWORD. BitwiseORofbitoperands.TheoperandsshouldbeofthetypeBOOL,BYTE,WORDorDWORD. BitwiseXORofbitoperands.TheoperandsshouldbeofthetypeBOOL,BYTE,WORDorDWORD. BitwiseNOTofabitoperand.TheoperandshouldbeofthetypeBOOL,BYTE,WORDorDWORD. Bitwiseleftshiftofanoperand:erg:=SHL(in,n) Bitwiserightshiftofanoperand:erg:=SHR(in,n) Bitwiserotationofanoperandtotheleft:erg:=ROL(in,n) Bitwiserotationofanoperandtotheright:erg=ROR(in,n) Allselectionoperationscanalsobeperformedwithvariables.Forpurposesofclaritywewilllimit ourexamplestothefollowingwhichuseconstantsasoperators. BinarySelection Maximumfunction.Returnsthegreaterofthetwovalues. Minimumfunction.Returnsthelesserofthetwovalues. Limiting Multiplexer Greaterthan ABooleanoperatorthatreturnsthevalueTRUEwhenthevalueofthefirstoperandislessthan thatofthesecond.TheoperandscanbeBOOL,BYTE,WORD,DWORD,SINT,USINT,INT,UINT, DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY,DATE_AND_TIMEandSTRING. ABooleanoperatorthatreturnsthevalueTRUEwhenthevalueofthefirstoperandislessthanor equaltothatofthesecond.TheoperandscanbeBOOL,BYTE,WORD,DWORD,SINT,USINT,INT, UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY,DATE_AND_TIMEandSTRING. Greaterthanorequalto Equalto Notequalto

MOVE INDEXOF SIZEOF AND OR XOR NOT SHL SHR ROL ROR

SelectionOperators
SEL MAX MIN LIMIT MUX GT LT

LE GE EQ NE

ADR ADRINST BITADR

AddressFunctionnotprescribedbythestandardIEC611313. AddressFunctionnotprescribedbythestandardIEC611313. Adressfunction,notprescribedbythestandardIEC611313. Apointercanbedereferencedbyaddingthecontentoperator"^"afterthepointeridentifier Callingafunctionblockoraprogram

ContentOperat

CAL TypeConversionFunctions

Itsisforbiddentoimplicitlyconvertfroma"larger"typetoa"smaller"type(forexamplefromINT toBYTEorfromDINTtoWORD).Specialtypeconversionsarerequiredifonewantstodothis. Onecanbasicallyconvertfromanyelementarytypetoanyotherelementarytype.

BOOL_TOConversions
ConversionfromtypeBOOLtoanyothertype: BOOL_TO_INT BOOL_TO_STRING BOOL_TO_TIME BOOL_TO_TOD BOOL_TO_DATE BOOL_TO_DT

TO_BOOLConversions
BYTE_TO_BOOL INT_TO_BOOL TIME_TO_BOOL STRING_TO_BOOL

ConversionbetweenIntegralNumberTypes
INT_TO_REAL REAL_TO_INT

TIME_TO/TIME_OF_DAYConversions
TIME_TO_STRING TIME_TO_DWORD TOD_TO_SINT

DATE_TO/DT_TOConversions
DATE_TO_BOOL DATE_TO_INT DT_TO_BYTE DT_TOSTRING

STRING_TOConversions
STRING_TO_BOOL STRING_TO_WORD STRING_TO_TIME ConvertingfromREALtoINT TRUNC Returnstheabsolutevalueofanumber.ABS(2)equals2. ABS Returnsthesquarerootofanumber SQRT Returnsthenaturallogarithmofanumber. LN Returnsthelogarithmofanumberinbase10. LOG Returnstheexponentialfunction EXP Returnsthesineofanumber. SIN Returnsthecosineofnumber.Theresultiscalculatedinarchminutes. COS

TAN ASIN

Returnsthetangentofanumber.Thevalueiscalculatedinarchminutes.INcanbetypeBYTE, WORD,DWORD,INT,DINT,REAL,SINT,USINT,UINT,UDINT,OUTmustbetypeREAL. Returnsthearcsine(inversefunctionofsine)ofanumber..

ACOS ATAN EXPT INI

Returnsthearccosine(inversefunctionofcosine)ofanumber.Thevalueiscalculatedinarch minutes. Returnsthearctangent(inversefunctionoftangent)ofanumber. Exponentiationofavariablewithanothervariable: TheINIoperatorcanbeusedtoinitializeretainvariableswhichareprovidedbyafunctionblock instanceusedinthePOU.

Libreriasde3S
PartedelainformacindeestaslibreriasseencuentraenlosdirectoriosdelTarjet

Standard.lib Stringfunctions
LEN LEFT RIGHT MID CONCAT INSERT DELETE REPLACE FIND Returnsthelengthofastring.InputSTRisoftypeSTRING Leftreturnstheleft,initialstringforagivenstring Rightreturnstheright,initialstringforagivenstring. returnsapartialstringfromwithinastring Concatenation(combination)oftwostrings INSERTinsertsastringintoanotherstringatadefinedpoint. DELETEremovesapartialstringfromalargerstringatadefinedposition. REPLACEreplacesapartialstringfromalargerstringwithathirdstring. FINDsearchesforapartialstringwithinastring. MakingBistableFunctionBlocksDominant ResettingBistableFunctionBlocks ASoftwareSemaphore(Interruptible) ThefunctionblockR_TRIGdetectsarisingedge. ThefunctionblockF_TRIGafallingedge. FunctionblockIncrementer FunctionBlockDecrementer: FunctionBlockIncrementer/Decrementer ThefunctionblockTimerisatrigger ThefunctionblockTimerOnDelayimplementsaturnondelay.. ThefunctionblockTOFimplementsaturnoffdelay.. ThefunctionblockRuntimeClockreturns,startingatagiventime,the currentdateandtime. Thislibrarycontainsanadditionalcollectionofvariousblockswhichcan beusedforBCDconversion,bit/bytefunctions,mathematicalauxiliary functions,ascontroller,signalgenerators,functionmanipulatorsandfor analoguevalueprocessing. AssomeofthefunctionsandfunctionblockscontainREALvariables,an accessorylibrarynamedUTIL_NO_REALexistsinwhichthesePOUsare excluded.

BistableFunction
SR RS SEMA

Trigger
R_TRIG F_TRIG

Counter
CTU CTD CTUD

Timer
TP TON TOF RTC

Util.lib

BCDconversion
BCD_TO_INT ThisfunctionconvertsabyteinBCDformatintoanINTvalue

INT_TO_BCD_

ThisfunctionconvertsanINTEGERvalueintoabyteinBCDformat

Bit/ByteFunctions
Extract InputstothisfunctionareaDWORDX,aswellasaBYTEN.Theoutputis aBOOLvalue,whichcontainsthecontentoftheNthbitoftheinputX, wherebythefunctionbeginstocountfromthezerobit. ThisfunctioniscapableofdeliveringbackeightinputbitsB0,B1,...,B7 fromtypeBOOLasaBYTE PUTBITsetstheNthbitfromXonthevalueB,wherebyitstartscounting fromthezerobit. UNPACKconvertstheinputBfromtypeBYTEinto8outputvariables B0,...,B7ofthetypeBOOL,andthisistheoppositetoPACK.

Pack PutBit unpack

MathematicAuxiliaryFunctions
Derivative Integral Lin_Trafo Thisfunctionblockapproximatelydeterminesthelocalderivation. Thisfunctionblockapproximatelydeterminestheintegralofthe function. ThisfunctionblocktransformsaREALvalue,whichliesinavaluerange definedbyalowerandupperlimitvalue,toaREALvaluewhichlies correspondinglyinanotherrangealsodefinedbyalowerandupperlimit Thisfunctionblockcalculatessomestandardstatisticalvalues ThisfunctionblockcorrespondstoSTATISTICS_INT,exceptthattheinput INisofthetypeREALliketheoutputsMN,MX,AVG. VARIANCEcalculatesthevarianceoftheenteredvalues. Thelibraryutil.libprovidesthefollowingPDcontrollerfunctionblock Thelibraryutil.libprovidesthefollowingPIDcontrollerfunctionblock ThePID_FIXCYCLEcontrollerfunctionblock: ThefunctionblockBLINKgeneratesapulsatingsignal Thisfunctionblockmeasuresthe(average)frequency(Hz)ofaboolean inputsignal. Thefunctiongeneratorgeneratestypicalperiodicfunctions Thisfunctionblockservestorepresentvalues,piecebypiece,onalinear function: RAMP_INTservestolimittheascendanceordescendanceofthe functionbeingfed RAMP_REALfunctionsinthesamewayasRAMP_INT,withthesimple differencethattheinputsIN,ASCEND,DESCENDandtheoutputOUTare ofthetypeREAL.

Statics_Int Statics_real Variance

Controller
PD PID PID_FIXCYCLE

SignalGenerators
Blink Freq_Measure Gen

FunctionManipulator
CharCurve Ramp_Int Ramp_Real

AnalogValueProcessing
Hysteresis LimitAlarm TheinputtothisfunctionblockconsistsofthreeINTvaluesIN,HIGHand LOW.TheoutputOUTisofthetypeBOOL. Thisfunctionblockspecifies,whethertheinputvalueiswithinaset rangeandwhichlimitsithasviolatedifithasdoneso. returnsinastringthecomponentsoftheexpression,whichareadding tothetotalvalueFALSE isusedforthispurpose,separatingtheparticularcomponentsinthe outputstringby"|"characters ActioncontrolblockforIEC611313SFCactions ImplementacindeModBus ImplementacindeModbus

AnalyzationNew.lib
AnalyzeExpression AppendErrorString

IecSfc.lib
SFCActionControl

ModBusTCPSrv.lib
MODBUSSERVER_TCPIP

LibreriasdelSistema
Num a
1 1 SysCallbackRegister SysCallbackUnregister

librera
SysLibCallback.lib

funcion

Descripcin
ThislibraryprovidesthefunctionsSysCallbackRegisterandSysCallbackUnregister,which servetoactivatedefinedcallbackfunctionsforruntimeevents.

SysLibCom.lib
2 3 2 SysComOpen SysComSetSettings 4

Thislibrarysupportstheserialcommunicationwithatargetsystem.Ifthetargetsystem providesthefunctionality,thenthefollowinglibraryfunctionscanbeusedtoopenor closeaserialportandtoreadorwritedataviathisport(Theexecutionissynchronous.): ThisfunctionofthelibrarySysLibCom.libservestoopenaserialport. servestosetvalueslikebaudrate,stopbits,parity,functiontimout,buffersizeandscan timeforaserialport.TheparametervalueisoftypePOINTERTOCOMSETTINGS;the structureCOMSETTINGSisused. ThisfunctionofthelibrarySysLibCom.liboftypeBOOLwiththeparametersoftype POINTERTOCOMSETTINGSEXisusedtosetallrelevantparametersofaserial communicationport.Notonlytheparametersoftheabovefunctionareset,butalsothe parametersforflowcontrolandcharactersizecanbesetwiththisfunction.Thisis performedbyfillingthemintothestructureCOMSETTINGSEX. ThisfunctionofthelibrarySysLibCom.liboftypeBOOLclosestheCOMport.Forthat purposetheporthandle,whichhasbeengotbySysComOpen,mustbegivenasinput parameter.ThereturnvaluewillbeTRUEafterasuccessfuloperation,otherwiseFALSE. ThisfunctionofthelibrarySysLibCom.liboftypeDWORDreadsthedataofCOMPORT. TheinputparametersaretheporthandlegotbySysComOpen,thenumberofexpected bytesandthetimeoutofthefunction.Besidesthattheaddresstowhichthereaddata shouldbecopied,willbepassedon. ThisfunctionofthelibrarySysLibCom.liboftypeDWORDwritesthedatatothatport whichisdefinedbythehandlegotbySysComOpen.Besidesthehandlealsotheaddress fromwhichthedatashouldbetaken,thenumberofdatawhichshouldbewrittenand thetimeoutofthefunctionmustbepassedon. ThisfunctionofthelibrarySysLibCom.lib(typeDWORD,alwaysreturns0)isonlyused foranautomaticinternalversioncheckandisnottobecalledexplicitlyintheapplication program handleafiledirectorysystemonthetargetsystem.Entriesofthedirectorycanberead andmodified.Theexecutionissynchronous. canbeusedtocreateanewdirectory. canbeused,toopenadirectoryinordertoreadthedirectoryentries(files, subdirectories)viafunctionSysDirRead canbeusedtoreaddirectoryentries. canbeusedtodeleteadirectory. canbeusedtorenameadirectory Thefunctionsofthislibraryservetoaccessvariablesbyindiceswithwhichtheyare referencedintheruntimesystem.Fordetailedinformationseethedescriptionofthe particularruntimesystem. ThislibrarysupportstheacyclicProfibusDPV1,Class1,ReadandWriteServicesforthe datatransferbetweenMasterandSlaves.Thedataareaddressedwithintheslavesby slotandindex.(ConcerningthisseethePBDPstandard.) Thislibraryservestosynchronizeandcontroltheprocessingoftwo(IEC)tasks. servestocreateaneweventandtonameit.Ahandlewillbereturned,whichisusedby theotherfunctionsofthelibrarytoaccesstheevent. deletesanevent.Theeventisdefinedbythehandlewhichwasreturnedbythefunction SysEventCreatewhencreatingtheevent. isusedtosetanevent.Theeventisdefinedbythehandlewhichwasreturnedbythe functionSysEventCreatewhencreatingtheevent.TRUEwillbereturnedifastheevent hasbeensetsuccessfully,otherwiseFALSE. isusedtosetthetimeoutforanevent.Theeventisdefinedbythehandlewhichwas returnedbythefunctionSysEventCreatewhencreatingtheevent.TRUEwillbereturned ifasthetimeouthasbeensetsuccessfully,otherwiseFALSE servestoopenafile,whichalreadyexistsorwhichshouldbecreated.

SysComSetSettingsEx 5 SysComClose 6 SysComRead 7

SysComWrite 8 SysComGetVersion2300 9 10 11 12 13 14 15 3

SysLibDir.lib
SysDirCreate SysDirOpen SysDirRead SysDirRemove SysDirRename

SysLibDirect.lib
16 4

SysLibDPV1Hilscher.lib
17 18 19 20 5 6

SysLibEvent.lib
SysEventCreate SysEventDelete SysEventSet

21 SysEventWait 22 23 24 7

SysLibFile.lib
SysFileOpen

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 8

SysFileWrite SysFileRead SysFileClose SysFileDelete SysFileCopy SysFileEOF SysFileGetPos SysFileGetSize SysFileGetTime SysFileRename SysFileSetPos

servestowritedatatoafile,whichhasbeenopenedbeforebythefunction SysFileOpen.Thereturnvalueisthenumberofsuccessfullywrittenbytes. servestoreadafile,whichhasbeenopenedbeforebySysFileOpen.Thereturnvalueis thenumberofsuccessfullyreadbytes. servestocloseafile,whichhasbeenopenedbeforebySysFileOpen. servestodeleteafile servestocopythefilecontenttoanotherfile(differentfilename). ifthecurrentoffsetisattheendofthefile;itwillreturn0,iftheendoffilehasnotyet beenreached. returnsthecurrentlysetoffsetpositioninthefile,whichisidentifedbythefilenumber thatyouhavegotfromtheSysFileOpenfunctionbefore returnsthesizeofthefile(inBytes),whichisidentifiedbythefilename. returnsthecreationdate,thedateoflastaccessandthedateofthelastmodificationof thefile(whichisidentifiedbythefilename). servestorenameafile. servestochangethecurrentoffset(whichcanbereadbythefunctionSysFileGetPos)for afileaccess ThislibrarysupportsasynchronousfileaccessfromtheIECapplication Thisfunctionblock(seelibrarySysLibFileAsync.lib)retrievesthecurrentread/write positionofthefile. Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtocloseafile.Fromnowon thefilehandleisinvalidandthefileisfreeforotherprocesses Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedforwritingtoafile.Thefile hastobeopenedwiththeFBSysFileOpenAsync. Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtoreadfromanopenfile. Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtodeleteafile. Thisfunctionblock(seelibrarySysLibFileAsync.lib)retrievesthecurrentread/write positionofthefile. Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtodetermine,whetherthe read/writepointerhasreachedtheendofthefile. Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtoretrievethesizeinbytesof afile. Thisfunctionblock(seelibrarySysLibFileAsync.lib)retrievesthemodificationtimesofa file. Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtocopyafiletoanother name/location Thisfunctionblock(seelibrarySysLibFileAsync.lib)isusedtorenameafile. Withthisfunctionblock(seelibrarySysLibFileAsync.lib)onecancloseallcurrentlyopen files,withoutknowinganyhandlesornames.Thesystemalwaysknowsthesehandles. ThislibraryprovidesfunctionswhichcorrespondtoANSICfunctionsforfilestream operations.Theexecutionissynchronous. Filewithnamefilename willbeopenedasstream;possiblevaluesforinputvariable Mode :'w'(write),'r'(read),'a'(append),'+','b','t' internalerrorstateofpFilewillbedeleted;alwaysreturns1 allopenstreamswillbeclosed(exceptforstdin ,stdout ,stderr ).Returns SysFileStreamFClose_EOFincaseoferror,otherwise0. returns!=0,assoonasendoffileinpFile isreached returns!=0,assoonasanerrorhasbeendetectedforpFile Characterswhicharestillbufferedinternally,willbeoutput Filewillbedeleted;returns1forOK,0incaseofanerror Renamingafile;returns1forOK,0incaseofanerror setsfilepositiontostartanddeletesinternalerrorstate;alwaysreturns1 returnsthenextcharacterinthestream(0255,SYSFILESTREAM_EOFincaseofanerror writescurrentfilepositionofpFile toptr;fpos_ theredefinedasanunsignedlong(32 bits) setsfilepositionofpFile accordingtoptr ;fpos_t hereisdefinedasunsignedlong(32 bits); Readsatmostthenextn1charactersintothearrays ,(terminationautomaticallywith 0);Truncationat'\n',the'\n'willbetakenovertos ;pFPos:DWORD;(*pointer!!*) formattedoutputinstreampFile ; formattedoutputinstreampFile ; formattedoutputinstreampFile ; Writingcharacter(unsignedchar)c tostreampFile

SysLibFileAsync.lib
SysFileOpenAsync SysFileCloseAsync SysFileWriteAsync SysFileReadAsync SysFileDeleteAsync SysFileGetPosAsync SysFileEOFAsync SysFileGetSizeAsync SysFileGetTimeAsync SysFileCopyAsnc SysFileRenameAsync SysFileCloseAllOpenAsync

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 SysFileStreamFOpen SysFileStreamClearerr SysFileStreamFClose SysFileStreamFEOF SysFileStreamFError SysFileStreamFFlush SysFileStreamRemove SysFileStreamRename SysFileStreamRewind SysFileStreamFGetC SysFileStreamFGetPos SysFileStreamFSetPos SysFileStreamFGetS 63 64 65 66 67 SysFileStreamFPrintf_Int SysFileStreamFPrintf_Real SysFileStreamFPrintf_String SysFileStreamFPutC 9

SysLibFileStream.lib

68 69 70 71 72 73

SysFileStreamFPutS SysFileStreamFRead SysFileStreamFWrite SysFileStreamFScanf_Int SysFileStreamFScanf_String SysFileStreamFScanf_Real SysFileStreamFSeek

WritingstringsinstreampFile nobjobjectsofsizesize willbereadfrompFiletoptr;Returnsnumberofreadobjects nobjobjectsofsizesize willbewrittenfromptrtopFile ;Returnsnumberofwritten objects formattedinputfromstreampFile;RestrictionscomparedtoC:only1DINTargument canberead;szFormat shouldbee.g.'%d' formattedinputfromstreampFile;RestrictionscomparedtoC:only1STRINGargument canberead;szFormat shouldbee.g.'%s' formattedinputfromstreampFile;RestrictionscomparedtoC:only1REALargument canberead;szFormat shouldbee.g.'%f' setsfilepositiononoffset Bytesbasedonorigin ;valuesfororigin :SEEK_SET=Startof file,SEEK_CUR=currentposition;SEEK_END=Endoffile;0=OK returnscurrentfileposition(basedonfilestart)inBytes(1incaseoferror) thestartaddressandthesizeofadatasegment(Memory,Input,Output,Retainor Global)inaDWORD returnsthestartaddressandthesizeofadatasegment(Memory,Input,Output,Retain orGlobal)inaDWORD. returnsthestartaddressandthesizeofadatasegment(Memory,Input,Output,Retain orGlobal)inaDWORD. thislibrarycanbeusedtocallinformationontheconfigurationofIECtasks.(Tocreate, delete,prioritize,stopandrestartataskyoucanusethelibrarySysLibTasks.lib.)The executionissynchronous. servestoretrievetheconfigurationparametersofanIECtask returnsthecurrenttimevaluesofanIECtask. returnsafunctionpointer,whichisrequiredasinputparameterforthefunction SysTaskCreatewhichisusedtocreateanewtask resetstheeventvariableofaneventtriggeredIECtask Thislibrarycontainsafunctionwhichcanbeusedtoinitializeanexternallibrary,which isavailableasanobjfile.Theexecutionissynchronous. canbeusedtoinitializeanexternallibrary usethislibrarytosetandremoveaninterrupthandlerforafunction.Theexecutionis synchronous. setstheinterruptwithagivennumberonthefunctionwhichisidentifiedbyitsaddress removestheinterrupt,whichisidentifedbythegivennumber,forthefunctionwhichis identifiedbyitsaddress Thislibrarycanbeusedformemorymanagement.Ifthetargetsystemsupportsthe functionality,thefollowinglibraryfunctionsareavailabletoallocate,tofree,todefine, tocomparememorylocationsandtocopy,moveorswapbetweendifferentmemory locations.Theexecutionissynchronous. isusedtodynamicallyallocatememoryspace isusedtodeallocatememoryspace. movesonememorybuffertoanother.Thefunctionwillreturntheaddressofthe destinationbuffer. canbeusedtoinitializeamemorylocationwithadefinedvalue.Itwillreturnthe addressofthedestinationbuffer. comparesthecontentoftwomemorybuffersofsizedwCount.dwBuf1anddwBuf2 eachshowthestartaddressofthebuffer. isusedtocopyadefinednumberofmemorylocationsfromonebuffertoanother. canbeusedtoswapdata;mainlyusedtoswapdatabetweenMotorolaByteorderand IntelByteorder. ThislibraryisdesignedforaccesstoaPcicardpluggedtothePlc usedtoretrieveinformationaboutaPcicard. ThislibrarysupportsthereadingoftheconfigurationdataofthePLCConfiguration providesinformationontheerrorswhichoccurduringthedownloadofthePLC configuration. returnsapointerontheheaderstructureofthePLCconfiguration providesinformationontherootmoduleofthePLCconfiguration providesinformationontherootmoduleofthecurrentlyusedPLCconfiguration,which isgivenbythemoduleId providesinformationontherootmoduleofthecurrentlyusedPLCconfiguration,which isgivenbythenodeId ThislibrarycontainsthefollowingfunctionsforcontrollingaPLC.Theexecutionis synchronous. canbeusedtostartaPLC

74 75 76 77 78 10 SysFileStreamFTell

SysLibGetAddress.lib
SysLibGetAddress SysLibGetSize

SysIECTasks.lib
79 80 81 82 83 84 85 86 133 87 88 12 11 SysIECTaskGetConfig SysIECTaskGetInfo SysIECGetFctPointer SysIECTaskResetEvent

SysLibInitLibrary.lib
SysInitLibrary

SysLibInt.lib
SysInstallIntHandler SysRemoveIntHandler

SysLibMem.lib
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 17 15 14 SysMemAlloc SysMemFree SysMemMove SysMemSet SysMemCmp SysMemCpy SysMemSwap

SysLibPciCards.lib
SysPciGetCardInfo

SysLibPLCConfig.lib 16
CfgCCGetError CfgCCGetHeader CfgCCGetRootModule CfgCCGetRootModuleByModuleId CfgCCGetRootModuleByNodeId

SysLibPlcCtrl.lib
SysStartPlcProgram

107 108 109 110 111 112 113 114

SysResetPlcProgram SysStopPlcProgram SysShutdownPlc SysEnableScheduling SysGetPlcLoad SysRestoreRetains SysSaveRetains SysWdgEnable

canbeusedtoresetthePLC canbeusedtostopthePLC canbeusedtoshutdownthePLC canbeusedtoenableresp.disabletheschedulerfortheIECtasksinthePLC. returnsthecurrentprocessorloadoftheIECtasks. canbeusedtorestorethevaluesofretainvariables,whichhavebeensavedinafile canbeusedtosavethevaluesofretainvariablesinafile canbeusedtoactivateresp.deactivatethewatchdogforaspecifiedtask canbeusedtocommunicatewithexternalhardwaredevicesviatheirportaddresses; e.g.realtimeclock,graphiccontrolleretc.Theportaddressescanaccessedreadingand writing.Theexecutionissynchronous. returnsthebytevalueatthatportaddress,whichhasbeenpassedonbywPort. returnsthebytevalueatthatportaddress,whichhasbeenpassedonbywPort. typeDWORDreturnsthebytevalueatthatportaddress typeBOOLwritestheBYTEvaluewhichispassedonbybyDatatothatportaddress whichispassedonbywPort writestheWORDvaluewhichispassedonbybyDatatothatportaddresswhichis passedonbywPort. typeBOOLwritestheDWORDvaluewhichispassedonbybyDatatothatportaddress whichispassedonbywPort thenthefunctionscontainedinthislibrarycanbeusedtoreadtheProjectInfo(CoDeSys Menu'Project''ProjectInfo')respectivelytheProjectID. providesthecomponentsoftheprojectinfowhichwasenteredintheprogramming system returnstheprojectID.TheIDisgeneratedbyCoDeSys.ItisusedbyCoDeSysto determinewhethertheprojectintheeditorandtheprojectonthecontrollerare identical,whetheranonlinechangecanbeperformed,orwhethertheyaredifferent projects. Thislibrarycontainsfunctionsforaccessingtherealtimeclockofthelocalsystem checksthestatusofthebatteryofthecomputer,whichisimportantfortheexactnessof theshownclocktime. canbeusedtoreadthedisplaymodeoftherealtimeclockofthelocalsystem. returnsthecurrenttimewhichisreadfromthePCclock. canbeusedtosettherealtimeclockofthelocalsystem. Thislibrarycanbeusedtocreateandusesemaphoresforthesynchronizationoftasks. Thesemaphoresservetoavoidanyconcurrentaccessoncriticaldata,whichareusedby severaltasks. forcreatingasemaphore fordeletingasemaphore foroccupyingasemaphore forleavingasemaphore forcheckingwhetherasemaphoreisoccupiedalreadybyanothertask Thislibraryprovidesfunctionsforaccessingamemoryareawhichisusedincommonby severalprocessesresp.referencingaphysicaladdress(SharedMemory,shortcutShM).

SysLibPorts.lib
115 116 117 118 119 120 121 122 123 19 18 SysPortIn SysPortInW SysPortInD SysPortOut SysPortOutW SysPortOutD

SysLibProjectInfo.lib
ProjectInfo

ProjectID 124 125 126 127 128 129 20

SysLibRtc.lib
SysRtcCheckBattery SysRtcGetHourMode SysRtcGetTime SysRtcSetTime

SysLibSem.lib
130 131 132 133 134 135 21 SysSemCreate SysSemDelete SysSemEnter SysSemLeave SysSemTry

SysLibShm.lib
136 137 138 139 140 141 142 23 22 SysShmOpen SysShmClose SysShmRead SysShmWrite

opensaSharedMemory. closestheSharedMemory, readadefinednumberofbytesfromaSharedMemory canbeusedtowriteadefinednumberofbytestoaSharedMemory ThislibrarysupportstheaccessonsocketsforthecommunicationviaTCP_IPandUDP. callsthefunctionacceptoftheoperatingsystem,whichcanacceptaconnectionrequest tothesocket callsthefunctionbindoftheoperatingsystem.Thisfunctionwillallocatealocaladdress tothesocketwhichwasassignedbeforejusttoanaddressrangebySysSockCreate. Usuallythe"binding"willbedonebeforefunctionslikeSysSockListenorSysSockAccept arecalledforasocket. callsthefunctionclosesocketoftheoperatingsystem,inordertocloseasocket. callsthefunctionconnectoftheoperatingsystem.Incasethesockethasnotyetbeen "bound"bytheSysSockBindfunction,nowautomaticallyalocaladdresswillbeassigned toit.Afterwardsthesocketwillbereadytosendand/orreceivedata.

SysLibSockets.lib
SysSockAccept

SysSockBind 143 144 SysSockClose

SysSockConnect 145

146 147 148 149 150 151 152 153

SysSockCreate SysSockGetHostByName SysSockGetHostName SysSockGetOption SysSockGetLastErrorSync SysSockGetLastError SysSockHtonI SysSockHtons SysSockInetAddr

callsthefunctionsocketoftheoperatingsystem.Anewsocketwillbecreatedand assignedtoaServiceProvider ruftdieFunktionhostGetByName(VxWorks) resp.gethostbyname(win32) ofthe operatingsystem. callsthefunctiongethostnameoftheoperatingsystemandreturnsthehostname. callsthefunctiongetsockopt oftheoperatingsystem,inordertogetthevalueofa particularsocketoption. callsthefunctiongetlasterroroftheoperatingsystem,whichreturnstheerrorcodeof thelasterroroccurredatthegivensocket. callsthefunctiongetlasterroroftheoperatingsystem,whichreturnstheerrorcodeof thelasterroroccurredatthegivensocket. callsthefunctionhtonloftheoperatingsystem,whichwillconvertau_longvaluefrom hostbyteordertoTCP/IPnetworkorder.. callsthefunctionhtonsoftheoperatingsystem,whichconvertsashortvaluefromhost byteordertoTCP/IPnetworkorder. callsthefunctioninet_addroftheoperatingsystem,whichconvertsastring,containing aninternetaddress,inanaddresswhichcanbeusedintheIN_ADDRstructure. callsthefunctioninet_ntoa(Win32)resp. inet_ntoa_b(VxWorks),whichconvertsan InternetnetworkaddressinastringinInternetstandardformat.. callsthefunctionioctloftheoperatingsysteminordertocontroltheI/Omodeofthe socket. callsthefunctionlistenoftheoperatingsystem.Thisfunctionwillcausethesocketto listentoconnectionrequestsandtoqueuethemuntiltheycanbeacceptedbythe SysSocketAcceptfunction. callsthefunctionntohloftheoperatingsystem,whichconvertsau_longvalueofthe TCP/IPnetworkordertothehostbyteorder. callsthefunctionntohsoftheoperatingsystem,whichconvertsau_shortvaluefrom theTCP/IPnetworkordertothehostbyteorder. callsthefunctionselectoftheoperatingsystemtocheckwhetheroneorseveralsockets arereadyforcertaincommunicationactions.Thegroupofsockets,towhichthisrequest shouldbeapplied,canbedefinedviathestructureSOCKET_FD_SET. isonlyimplementedforVxWorkstargets.ItsetstheIPaddressofthegivencard. callsthefunctiongetsockopt oftheoperatingsysteminordertosetparticularsocket options.. callsthefunctionshutdownoftheoperatingsysteminordertoinhibitfurthersendor receiveactions.Thefunctiondoesnotclosethesocket!Thismustbedonevia SysSockClose. callsthefunctionread (VxWorks)resp.recv(Win32)oftheoperatingsysteminorderto receivedatawhichhavebeensenttothesocket. ThisTCP/IPspecificfunction(librarySysLibSockets.lib)oftypeDINTcallsthefunction sendoftheoperatingsysteminordertosendthedatawhicharebufferedatthesocket. callsthefunctionrecvfrom oftheoperatingsystem,inordertoreadthedatawhich havebeensenttothesocket. callsthefunctionsend oftheoperatingsysteminordertosendthedatawhichare storedatthesocket. ThislibraryoffersthesamefunctionalityasSysLibSockets.lib,howeverfunctionblocks insteadoffunctionsareusedandtheprocessingisasynchronous.

154 155 156 SysSockInetNtoa SysSockloctl SysSockListen 157 158 159 SysSockNtohI SysSockNtohs

SysSockSelect 160 161 162 SysSockSetIPAddress SysSockSetOption SysSockShutdown 163 164 165 TCPspecific: SysSockRecv SysSockSend 166 167 168 169 UDPspecific: SysSockRecvFrom, SysSockSendTo

SysLibSocketsAsync.lib
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 24 SysSockAcceptAsync SysSockBindAsync SysSockCloseAsync SysSockConnectAsync SysSockCreateAsync SysSockGetHostByNameAsync SysSockGetHostNameAsync SysSockGetLastErrrorAsync SysSockGetOptionAsync SysSockHtonIAsync SysSockHtonsAsync SysSockInetAddrAsync SysSockInetNtoaAsync SysSockloctlAsync

185 186 187 188 189 190 191 192 193 194 195 196 197

SysSockListenAsync SysSockNtohIAsync SysSockNtohsAsync SysSockSelectAsync SysSockSetIPAddressAsync SysSockSetOptionAsync SysSockShutdown TCPspecific: SysSockRecvAsync SysSockSendAsync UDPspecific: SysSockRecvFromAsync, SysSockSendToAsync

SysLibStr.lib
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 28 27 26 25 SysStrCmp SysStrCmpI SysStrCmpN SysStrCmpNI SysStrCpy SysStrLen

Thislibraryprovidesfunctionsforstringoperations.Ifthetargetsystemissupporting thefunctionality,thefollowingfunctionscanbeusedtocompareorcopystringsorto retrievethelengthofastring.Theexecutionissynchronous. compareslexicographicallytwostrings checkswhethertwostringsareidentical comparesthesizeoftwostrings,wherebyadefinednumberofcharacterscountedfrom thebeginningofthestringwillbeconsidered. checkswhetheradefinednumberofcharactersoftwostrings(startingatthebeginning ofthestring)areidentical copiesonestring(Str1)toanother(Str2). acquiresthelengthofastring canbeusedtoreadthephysicaladdressofasymbolofanIECproject.Theprocessingis donesynchronously. canbeusedtomanagetasks.Thatmeanstogenerate,todelete,tomodifyprioritylevel, tostopandrestarttasks.Theexecutionissynchronous. createsanewtask.ItwillreturnanuniqueIdnumberforthetask,whichisrequiredas aninputparameterfortheotherfunctionsofSysLibTask.lib. canbeusedtodeleteatask.ItwillreturnTRUE,iftheoperationhassucceeded, otherwiseFALSE. returnsinformationonatask,whichisidentifiedbythetaskId. returnsthepriorityofthetaskidentifiedbythetaskId. canbeusedtodefinetheprioritylevelforataskwhichisidentifiedbythetaskId. canbeusedtostopataskduringoperation. canbeusedtocontinuetheprocessingofatask,whichwasstoppedbeforebythe functionSysTaskSuspend canbeusedtointerrupttheprocessinginarunningtaskandtomakeitcontinueaftera definedperiodoftime. shouldbecalledbyataskassoonitsprocessinghasbeenterminated.Typicallythis shouldbedoneimmediatelybeforethetaskisleft. canbecalledbythecurrentlyprocessingtaskinordertogetreturnedtheowntaskId. Thislibraryprovidesfunctionblocksforreadingtherealtimeclockofthelocalsystem. Theexecutionissynchronous. providestherealtimeofthelocalsysteminmicroseconds;usingthestructure SysTime64. providesextendedinformationontherealtimeclockdataonthelocalsystem.

SysLibSymbols.lib
SysLibGetSymbolAddress

SysLibTasks.lib
SysTaskCreate SysTaskDestroy SysTaskGetInfo SysTaskGetPriority SysTaskSetPriority SysTaskSuspend SysTaskResume Functionstobeusedwithinatask: SysTaskSleep SysTaskEnd SysTaskGetCurrent

SysLibTime.lib
CurTime CurTimeEx

LibreriasFesto
Festo_CPX.lib
(CAAMerger7.chm)Festo_CPX.libisaninternallibraryforCoDeSys2.3.Thislibrary supportsthespecificfunctionalityoftheCPXvalveterminalsuchasparameterisation anddiagnosis. Initiatestheprocessforreadingoutalldiagnosticinformation. Translateserrornumbersintotext. ResetstheCPXerrorLED Initiatestheprocessforreadingoutalldiagnosticinformation. ForreadingoutCPXparameters ForwritingCPXparameters Functionsthatrequireimplementationintherealtimesystemareimplementedinthe Festo_CPX_extern.liblibrary. ThislibraryisloadedautomaticallywhentheFesto_CPX.libisappended.Thelibraryis hiddenandthereforedoesnotappearinthelibrarymanager.

Diagnosis
CPX_DiagnosticsUpdate CPX_GetFaultString

CPXerrorhandling
CPX_ClearErrorLED

CPXsystemfunctions
CPX_CICommand CPX_GetParameter CPX_SetParameter

Festo_CPX_extern.lib

Festo_Motion.lib

(CAAMerger5.chm)Festo_Motion.libisaninternallibraryforCoDeSys2.3.Thislibrary canbeusedtocontrolthefollowingtypesofFestomotorcontroller(drivecontroller): CMMPAS... CMMSAS... CMMSST... SFCDC... MTRDCI... SFCLAC... SFCLACI... ControldeservomotoresLineaPremium forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller Controldeservomotores forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller ControldeMotoresaPasos forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller ControlServomotorDC forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller ControldeSLTE,Mordazaselctricas forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller

CMMPAS...
CMMP_AS_CTRL CMMP_AS_PRM_INIT CMMP_AS_PRM_SINGLE

CMMSAS...
CMMS_AS_CTRL CMMS_AS_PRM_INIT CMMS_AS_PRM_SINGLE

CMMSST...
CMMS_ST_CTRL CMMS_ST_PRM_INIT CMMS_ST_PRM_SINGLE

MTRDCI...
MTR_DCI_CTRL MTR_DCI_PRM_INIT MTR_DCI_PRM_SINGLE

SFCDC...
SFC_DC_CTRL SFC_DC_PRM_INIT SFC_DC_PRM_SINGLE

SFCLAC...
SFC_LAC_CTRL SFC_LAC_PRM_INIT SFC_LAC_PRM_SINGLE

ControdeHMPE forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller ControlServomotoresLineales forcontrollingtherelevantFestomotorcontroller forparameterisingtherelevantFestomotorcontrollertypes fortransferringindividualparameterstotherelevantFestomotorcontroller (CAAMerger6.chm)EasyIPallowsthesimpleconnectionofdifferentFestocontrollersto formanetwork. ThisfunctionaddstheIPaddressesoftheotherstationstotheIPtable. Thisfunctionsetsthetimeouttimetoamultipleofthesettaskcycletime. ThefunctionsendsanEasyIPpackagetoanEasyIPstation. Thefunctionsendsarequesttoastation. ThefunctionsendsdataandarequesttoanEasyIPstation. AttachEasy_Servertoacyclictask (CAAMerger5.chm)ThefunctionblocksoftheIncEnc.libsupportthelatchfunctionality oftheincrementalencoderinterfacemoduleCECXC2G2.Thelatchfunctionusesa digitalinputontheencoder(latchinput)inordertosavedataoftheencoderduring changeofedgeoftheinput.

SFCLACI...
SFC_LACI_CTRL SFC_LACI_PRM_INIT SFC_LACI_PRM_SINGLE

Festo_EasyIP.liblibrary
Easy_SetIPAddr Easy_SetTimeOut Easy_S Easy_R Easy_SR Easy_Server CallbackEasyDeInit

IncEnc.lib

IncEnc_SetCount IncEnc_Latch_Zero IncEnc_Latch_DI

Ethernet.lib

Thisblockisusedforsettingofacounterstatus(Count)attheoccurrenceofaspecial event(Mode). Theblockreadsthecounterstatus(Count)ofanincrementalencoderduringprocessing ofthezeroimpulse. Theblockisusedforreadingoutofthecounterstatus(Count)whensettingandthetime periodafterthesettingofalatchinput(TimeStamp). (CAAMerger3.chm)ThefunctionsoftheEthernetlibrarysupportthehandlingofIP configurations.Similartothesettingsin'NetworkConfiguration',thenetworksettings canbemadeperfunctioncall.

EthGetIPConfig EthSetIPConfig

EventData.lib
GetLastIntrEdge

PLCService.lib
PLCGetCPUClock PLCGetCPUClockRate PLCGetDeviceName PLCGetFirmwareVersion PLCGetHoursCounter PLCGetLicenceOption PLCGetSerialNo PLCGetSystemVersion PLCGetVendorName PLCReboot

ForreadingoftheIPconfiguration ForsettingoftheIPconfiguration (CAAMerger4.chm)ThefunctionsoftheEventDatalibrarysupportthehandlingofdata fromsystemevents,thataretriggeredbyinterruptsfrominputsofdigitalinput modules. Returnsinterruptdata. (CAAMerger7.chm)ThefunctionsofthelibraryPLCService.libreturndatafromthe controlwiththeexceptionofPLCReboot. ReturnscountervalueoftheCPUclock ReturnsCPUclockfrequency Returnsdevicedescription Returnsfirmwareversion. Returnsoperatinghourscounter Returnslicenseoptions Returnsserialnumberofthecontrol Returnssystemversion Returnsvendorname Triggersrebootofthecontrol.

(CAAMerger8.chm)TheSysLibComExlibraryisanextensionforthehandlingofserial interfaces.

SysLibComEx.lib

AllserialinterfacescaninprinciplebeoperatedviatheSysLibCom.lib.Aspecialport mustbespecifiedwhenopeningtheinterfaceofaserialinterfacemodule.

SysComSetMode

FortheswitchingovertoRS485andviceversa.??? LibreraInternautilizadaenconjuntoconIncEnc.lib LibrerasoloparausoInternodeotraslibrerias

KSys.lib TestFunctions.lib

LibreriasdeMotion
toCoDeSys_SoftMotion_V23_E.pdf

Librer Funcin

Comentario

SM_PLCopen.lib
Serecoiendaleerlaespecificacin"Functionblocksformotioncontrol,version1.0" Alparecerlalibreracuentaconmsfuncionesdelasaqumostradas ModulosparacontroldeejesIndividuales providessomeparticularstatesofanaxis MC_ReadStatus MC_ReadAxisError providesinformationongeneralerrorswhichhaveoccurredatthedrive SMC_Reset resettheaxisstate(SMC_AXIS_STATE)from"error_stop"to"standstill". canbeusedtoreadsomestandardparametersofthedrivestructure MC_ReadParameter MC_ReadBoolParameter canbeusedtoreadsomestandardparametersofthedrivestructure MC_WriteParameter canbeusedtosetsomestandardparametersofthedrivestructure MC_WriteBoolParameter canbeusedtosetsomestandardparametersofthedrivestructure MC_ReadActualPosition providesthecurrentpositionofthedrive MC_ReadActualVelocity providesthecurrentvelocityofthedrive. MC_ReadActualTorque MC_Power providesthecurrenttorqueresp.thecurrentpowerofthedrive. controlstheON/OFFswitchandthestatusofthebrakesofthedrive.Ifadrivehasnot beenswitchedONinthisway,ifthecontrollerhasnotbeenunblockedorifthebrakehas notbeenreleased,nomotioncontrolispossible startsamanufacturerspecific(!)referencemoveinthedrive.Thismotionissolelyinitiated bytheDriveInterface deceleratestheaxistovelocity0.Nointerruptispossibleandtheaxiswillbeblockedas longastheinput"Execute"isTRUEandtheaxisnotyethasbeenstoppedcompletely deceleratestheaxistovelocity0.Themodulecanbeinterruptedandincontrastto MC_Stopdoesnotblocktheaxis. hastwodifferentmodesofaction,dependingonthecurrentstateoftheaxis: discrete_motion: TheDistancevaluewillbeaddedtothetargetpositionofthemodulewhichiscurrently processingontheaxis.Themotionwillaimatthenewtargetpositionthen. continuous_motionorstandstill: TheDistancewillbecoveredreferringtothecurrentposition,regardingthegiven parameters. movestheaxistoanabsolutepositionaccordingtothedefinedvelocity,decelerationand accelerationvalues movestheaxistoafixpositionaccordingtothedefinedvelocity,decelerationand accelerationvalues.IncontrasttoMC_MoveAbsolutetheuseradditionallycandefinean endvelocity,whichtheaxisshouldhaveatthisfixpositionandwhichisshownbyoutput InEndVelocity movestheaxisbyarelativedistanceaccordingtothedefinedvelocity,decelerationand accelerationvalues.Thedistancecanhavepositiveornegativevalues.
20 21 22 23 24

1 2 3 4 5 6 7 8 9 10 11 12

13 14

MC_Home MC_Stop

15 16

mc_halt MC_MoveAdditive

17 18

MC_MoveAbsolute SMC_MoveContinuousAbsolute

19

MC_MoveRelative

smc_movecontinuousrelative MC_MoveSuperImposed MC_MoveVelocity MC_PositionProfile MC_VelocityProfile

movestheaxisbyarelativedistanceaccordingtothedefinedvelocity,decelerationand accelerationvalues causes,whereappropriate,additionallytothecurrentlyactivemotionanotherone,which makestheaxispassingadefineddistance. causesanonstopmotionoftheaxiswithapredefinedvelocity(AXIS_REF). followsadefinedpositionprofile. isanalogtothemoduleMC_PositionProfile.Buthereintheinputvariableoftypestructure MC_TV_REFthepositionpointsaredefinedbytheirvelocities.

25

MC_AccelerationProfile
isanalogtotheMC_PositionProfilemodule.Buthereintheinputvariableoftypestructure MC_TA_REFthepositionpointsaredefinedbytheiraccelerationvalues. shiftsthezeropointoftheaxis

26

MC_SetPosition

27 28 29 30 31

canbeusedtodetectverypreciselythepositionofthedriveviaafastinput MC_TouchProbe abortsalatchingwhichiscurrentlydoneonthetriggerinput.. MC_AbortTrigger Modulosparacontrolsincronizadodemotores youcanselectaCAM,determinethemasterandtheslaveaxesforthisCAManddosome MC_CamTableSelect

MC_CamIn

presettings. youcanrealizeaCAMwhichhasbeenselectedbyMC_CAMTABLESELECT. Inadditiontotheoffsetsandscalingalsothestartmodecanbedefined.

32 33 34

MC_CamOut MC_GearIn MC_GearOut

youcandisengagetheslavedrivefromthemaster.Theslavewillbedrivenonwiththe currentvelocity. youcancoupletheslaveaxistothemasteraxis youcandisengagetheslavedrivefromthemaster.Theslavewillbedrivenonwiththe currentvelocity.

35 36 37 38

MC_GearInPos MC_Phasing
youcancoupletheslaveaxistothemasteraxissynchronouslytopositionandvelocity youcaneffectaconstantdistancebetweenmasteraxisandslaveaxis.Inthiscasemaster andslaveofcoursehaveidenticalvelocityandacceleration.

Elementosadicionalesdelalibrera Thismodulecalculatesthecurrenttargetpositionofanaxis(slave)forthecasethattheaxis SMC_GetCamSlaveSetPosition


wouldbecoupledviaaCAMtothemotionofanotheraxis(Master).Therbybothaxesare notmovedoraffected.

39

SMC_CAMBounds
Thisfunctionblockcalculatesthemaximumsetpointsforposition,velocityand acceleration/decelerationoftheslave,ifthatisabsolutelyboundtoamaster,whichis movedaccordingtoaprescribedmaximumvelocityandacceleration/deceleration.

40 41

SMC_CAMEditor,SMC_CAMVisu SMC_CAMRegister

WiththesemodulesanOnlineCAMEditorcanbecreated representsatappetcontrolunit.ItworkslikeMC_CamInonaMC_CAM_REFstructure, negatingtheoriginalpathinformationandonlyreadingthetappetinformation. Thisfunctionblock,whichispartoftheSM_PLCopen.lib,evaluatestheoutputTappetsof functionblockMC_CamInandcontainsthecurrenttappetstatus.

42

SMC_GetTappetValue

43 44 45 47 48 49 50 51

mc_digitalcamswitch

SMC_ReadSetPosition SMC_SetTorque 46 SM_CAN.lib


SMC_ReadCANParameter

SMC_WriteCANParameter SM_CNC.lib
SMC_NCDecoder

ThisfunctionblocklikeSMC_CamRegisterrepresentsatappetcontrolunit.Upto32 outputscanbeswitched.Movesinalldirectionsareallowed readsthecurrentlysetpositionofthedrive. canbeusedtocreateatorque,ifthedriveisincontrollermode"torque". Motion\Drives\CAN ThefunctionalityissimilartothatofthemodulesMC_ReadParameterand MC_WriteParameter: ThefunctionalityissimilartothatofthemodulesMC_ReadParameterand MC_WriteParameter: ThislibraryprovidesmodulesforrealizingtheSoftMotionfunctionalityinanIECprogram DecodingofthepathwhichhasbeenprogrammedintheCNCEditorinordertoget structureobjects Itgathersandstoresthetextualrepresentation(GCode)oftheparticularGeoInfoobjects anddumpsthoseasanARRAYOFSTRING,whiche.g.viaatablecanbedisplayedina visualization Pathpreprocessing:toolradiuscorrection Pathpreprocessing:avoidsloopsinthepath Pathpreprocessing:slursthepathbysplines Pathpreprocessing:roundsthepathbycirculararcs Checkoftheendvelocitiesofthesegments Checkoftheendvelocitiesofthesegments

SMC_GCodeViewer

52 53 54 55 56 57

SMC_ToolCorr SMC_AvoidLoop SMC_SmoothPath SMC_RoundPath SMC_CheckVelocities SMC_Interpolator

58

SMC_LimitCircularVelocities

Thismodule(SM_CNC.lib)checkstheparticularelementsoftheOutQueueandlimitsthe pathvelocitiesofcircularelementsagainsttheirradii.

59

SMC_InterpolatorModule
isusedtoconvertacontinuouspathwhichisdescribedbySMC_GEOINFOobjects,into discretepathpositionpoints,therebyregardingadefinedvelocityprofileandtimepattern.

60

SMC_GetMParameters
ThisfunctionblockcanbeusediftheInterpolatorcurrentlyworksonaMFunctionto polltheparameterswhichhavebeensetforthisMFunction(K,L,O,seeHERE).

61

SMC_Interpolator2Dir

Thismodulecorrespondsconcerningfunctionandallocationofitsinputsandoutputsto functionblockSMC_Interpolator,withthedifferencethatitcanalsoreverselyinterpolatea path.

62 63

AuxiliaryModulesforPathRotations,TranslationsandScalings SMC_ROTATEQUEUE2D
ThepathstoredinpoqDataIn willberotatedaroundtheZaxisbytheanglegivenbydPhi [].Apositiveangleeffectsapositiverotationinmathematicalsense(counterclockwise). ThepathstoredinpoqDataInwillbetranslatedaccordingtothevectorgivenbyvec,which isofstructuretypeSMC_VECTOR3D(seeSMC_VECTOR3D). ThepathcontainedinpoqDataInwillbestretchedbyfactorfScaleFaktor.

64

SMC_TRANSLATEQUEUE3D

65 66 67

SMC_SCALEQUEUE3D

Settingsviaglobalvariab g_fSMC_CNC_EPS 68 g_fSMC_CNC_EPS_RELUCTANT 69 SM_Trafo.lib

Epsilonvalueforaccurateexaminationforzero Epsilonvaluefortolerantexaminationforzero ThislibraryisanextensionfortheSM_CNC.libandprovidesmodules,whichcanbeusedfor transformationofGEOtodrivecoordinatesandtheaxiscontrol(position, position/velocity,velocity). Forportalsystemsnotransformationmustbedone,thusthemodulesoftheSM_Trafo.lib (SMC_TRAFO_Gantry2,SMC_TRAFOF_Gantry2,SMC_TRAFO_Gantry3, SMC_TRAFOF_Gantry3,GantryCutter)justaddoffsetonthex,yandzaxes.

70 71

PortalSystems
SMC_TRAFO_Gantry2

72 73 74 75 76 77 78

SMC_TRAFOF_Gantry2 SMC_TRAFO_Gantry3 SMC_TRAFOF_Gantry3, GantryCutter

"" "" "" Thesefunctionblocksdotransformationsforportalsystemswithonerotationaxis,whichis controlledinaway,thatitpointsalongthecurrentpathtangent.

HPortalSystemwithstationarydrives SMC_TRAFO_GantryH2
ThisfunctionblockforHPortalsystemswithstationarydrivesispartoftheSM_Trafo.lib.

SMC_TRAFOF_GantryH2
ThisfunctionblockforHPortalsystemswithstationarydrivesispartoftheSM_Trafo.lib.

79 80 81 82 83 84 85 86 87 88

2JointedScaraSystems SMC_TRAFO_Scara2 SMC_TRAFOF_Scara2 PortalSystemswithToolOffset SMC_TRAFO_Gantry2Tool1 SMC_TRAFOF_Gantry2Tool1 SMC_TRAFO_Gantry2Tool2 SMC_TRAFOF_Gantry2Tool2 3JointedScaraSystems SMC_Trafo_Scara3

89 90 91 92 93 94 95 96 97

SMC_TRAFOF_Scara3

ParallelKinematics
SMC_TRAFO_Tripod SMC_TRAFOF_Tripod SpacialTransformations SMC_CoordinateTransformation3D SMC_UnitVectorToRPY SMC_DetermineCuboidBearing SM_CNCDiagnostic.lib

98 99 100

SMC_ShowCNCREF SMC_ShowQueue SM_DriveBasic.lib

101 102 103 104 105 106

SMC_ErrorString SMC_sgn SMC_fmod SMC_atan2 SMC_ChangeGearingRatio SMC_CheckLimits

Thislibraryprovidesauxiliarymoduleswhichcanbeveryusefulduringtheimplementation phaseofaCNCprogram,becausetheyhelptodisplaythedatawhichareexchanged betweenthemodules. candisplaythefirsttenlinesofaNCprogram,whichisavailableinformofadatastructure SMC_CNC_REF,intextstrings(Din66025). rovidesthefirsttenSMC_GeoInfoobjectsofanOutQueueinformofanARRAYOFPOINTER TOSMC_GeoInfo. CoDeSyswillautomaticallygeneratestructureobjectsbasedonthedriveimagewhichhas beenconfiguredinthePLCConfigurationeditor.Thesestructurescanbeaccessedbythe IECprogram returnsastringrepresentationoftheerror,dependingontheinputsErrorID(SMC_Error) andLanguage(SMC_LANGUAGE_TYPE(English,German)). returnsthevalueofthesignoftheinput;thus1iftheinputisnegative,+1ifitispositive and0ifitiszero. calculatesthemodulovalueoftheinputxforperiodm.Thereturnvaluealwaysiswithin theinterval[0,m]. calculatesandreturnstheanglealpha,whichsolvesthefollowingequations: sin(alpha)*f=Sinusandcos(alpha)*f=Cosine. canchangethegearingratioandthetypeofthedrive. checkswhethertheactualsetpointsofthedriveexceedthemaximumvaluesconfiguredin thecontrollerandindicatesthecheckresultinoutputbLimitsExceeded. writestargetpositionsntoadrivestructureandchecksthestructureforjumps ThismoduleofSM_DriveBasic.libworkssimilartoSMC_ControlAxisByPos,butadditionally thevelocitycanbedefined. workssimilartoSMC_ControlAxisByPos,buttheaxisisnotcontrolledbythepositionbutby thevelocity writespositionsetpointstotheaxisanddoesnochecks. writespositionandvelocitysetpointstotheaxiswithoutdoinganychecks.Theusermust careforareasonablematchingofthevalues. writessetvelocitiestotheaxiswithoutdoinganychecks. tellsaboutthestatusofanaxisgroup byabooleanvariablereturnswhetherthestartup,whichimplicitlyisdoneforeach axisgroup,hasbeenterminatedandthusthegroupwithitsaxesisoperable(TRUE),or whetherthestartupisstillgoingonoranerrorhasoccurred(FALSE). WiththisfunctionblockofSM_DriveBasic.libacompleteaxisgroupcanbereinitialized. IfsupportedbythedrivethismoduleofSM_DriveBasic.libcanbeusedtoswitchtoanother controllermode.

107 108 109 110 111 112 113 114

SMC_ControlAxisByPos SMC_ControlAxisByPosVel SMC_ControlAxisByVel SMC_FollowPosition SMC_FollowPositionVelocity SMC_FollowVelocity SMC_IsAxisGroupReady SMC_IsAxisGroupReady

115 116

SMC_ResetAxisGroup SMC_SetControllerMode

117

SM_Error.lib
Thislibrarymustbeavailableineachproject,becauseitcontainsallerrordefinitions.Itis usedtodisplayeacherrorproducedbyaSoftMotionmoduleasastring. DependingontheinputsErrorID(enumerationSMC_Error)andLanguage (SMC_LANGUAGE_TYPE(English,German))thefunctionSMC_ErrorStringreturnsastring representingtheerror.

118

SMC_ErrorString

119

SM_FileFBs.lib

Thislibraryprovidesmodulesforthefilefunctionality.

120

SMC_ReadNCQueue

ThismodulereadsanOutQueuefile,whichhasbeencreatedbytheCNCeditor,fromthe PLCfilesystemandprovidesanOutQueuestructure,whichtypicallyisprocessedbythe Interpolator.

121

SMC_ReadNCFile readsaNCASCIIfilefromthefilesystemofthecontroller,inordertomakeitavailablefor theSMC_NCDecoder.ThusatruntimeaNCprogramcanbereadinandrealized.

122

SMC_ReadCAM

isusedtoloadaCAM,whichhasbeencreatedintheCAMeditorandhasbeensavedina *.CAMfile,atruntimeandtomakeitavailableforthemodulesMC_CamTableSelectand MC_CamIn.

123

SMC_AxisDiagnosticLog Thismodule(SM_FileFB.lib)canbeusedtowritecyclicallyaselectionofvaluesofanaxisto afile.Afilecreatedinthiswayideallycanbeusedfordiagnosispurposes.

LibreriasporDesarrollar SM_Startup_Diagnostic.lib 3S_CanDrv.lib FestoCANdrive.lib SM_CANWatch.lib Dummydrive.lib


nesporubicar enlaineadesoftmotiondriveinterfazse

checar

SMC_TimeAxisFB SMC_Homing
SMC_GetMaxSetVelocity

You might also like