CAA FB Factory Library Documentation ¶ Company CAA Technical Workgroup Title CAA FB Factory Version 3.5.13.0 Categories Intern|CAA|Foundation Namespace FBF Author 3S - Smart Software Solutions GmbH Placeholder CAA FB Factory Description 1 ¶ This library provides a base implementation of an function block factory. For further information about how to use the FactoryBase function block please download FBFactoryTest.projectarchive There you will find a test project which uses a test library that demonsrates the usage of the FactoryBase function block. It is recommended to look at how the exemple programm (PLC_PRG) works by setting a breakpoint and stepping into each action of the program. Do not go online in simulation mode! Moreover the documentation of the FB Factory Test Library (which is already added to the Library Manager in the test project) explains what is done in each part of the library. There is a template for libraries in CODESYS which is called CODESYS Library which assists you building your own FB Factory. Therefore please open a new project and choose the category Libraries and afterwads the template CODESYS Library . In this project the folder Templates contains the subfolder FBFactory with all the important FBs, methods and properties. All relevant function blocks should be copied in the folder with the title Function Blocks in order to be able to modify them. Afterwards change the names of every element to suitable expressions. By clicking on each element with the right mouse button and choosing Properties -> Build you can deactivate Exclude from build Moreover it is advisable to adapt the array abyPoolMemory in the function block TestFBFactory to ones own needs. Make sure that everywhere in TestFBFactory (for exemple in the first line of the method TestFBFactory.Create ) the expression Custom is substituted by the name you chose for these elements. By calling up the method Create it is now possible to dynamically create a FB instance. Contents: ¶ ERROR (Enum) Factory FactoryBase (FunctionBlock) Instance InstanceBase (FunctionBlock) InstanceData (FunctionBlock) Interfaces IData (Interface) IFactory (Interface) IInstance (Interface) Indices and tables ¶ 1 Based on CAA_FBFactory.library, last modified 03.07.2018, 09:54:35. LibDoc 4.4.0.0-b.27 The content file CAA_FBFactory.clean.json was generated with CODESYS V3.5 SP13 on 03.07.2018, 09:54:38.
Factory ¶ FactoryBase (FunctionBlock) FB_EXIT (Method) FB_INIT (Method) Private prvInstCount (Property) prvInstInit (Method) prvInstPoolAdr (Property) prvInstPoolExtendsFactor (Property) prvInstPoolSize (Property) prvInstSize (Property)
ERROR (ENUM) ¶ TYPE ERROR : Attributes: qualified_only InOut: Name Initial Comment NO_ERROR 0 FIRST_ERROR 1500 INVALID_PARAMETER 1502 TIME_OUT := 1501, WRONG_INTERFACE 1503 WRONG_INSTANCE_DATA 1504 WRONG_POOL_SIZE 1505 WRONG_INSTANCE_COUNT 1506 NO_MEMORY 1507 FIRST_MF 1525 LAST_ERROR 1549
FactoryBase (FB) ¶ FUNCTION_BLOCK FactoryBase IMPLEMENTS IFactory This function block implements the neccecary basic functionality for a function block factory. Memory allocator AllocInstMem FreeInstMem The allocator use the following properies as parameters. InstSize reports the memory consumtion of the related function block instance. InstPoolAdr, InstPoolSize => The instance pool is initialized with a static memory area. InstCout, InstPoolSize => The instance pool is initilaized with a memory area from the heap. InstPoolExtendsFactor => The instance pool can be extended dynamically with memeory areas from the heap. List management for handling the group of produces function block instances. InsertInst RemoveInst Properties: prvInstCount prvInstPoolAdr prvInstPoolExtendsFactor prvInstPoolSize prvInstSize Methods: FB_EXIT FB_INIT prvInstInit Structure: FB_EXIT (Method) FB_INIT (Method) Private prvInstCount (Property) prvInstInit (Method) prvInstPoolAdr (Property) prvInstPoolExtendsFactor (Property) prvInstPoolSize (Property) prvInstSize (Property)
FactoryBase.FB_EXIT (METH) ¶ METHOD FB_EXIT : BOOL InOut: Scope Name Type Return FB_EXIT BOOL Input bInCopyCode BOOL
FactoryBase.FB_INIT (METH) ¶ METHOD FB_INIT : BOOL InOut: Scope Name Type Comment Return FB_INIT BOOL Input bInitRetains BOOL TRUE: the retain variables are initialized (reset warm / reset cold) bInCopyCode BOOL TRUE: the instance will be copied to the copy code afterward (online change)
Private ¶ prvInstCount (Property) prvInstInit (Method) prvInstPoolAdr (Property) prvInstPoolExtendsFactor (Property) prvInstPoolSize (Property) prvInstSize (Property)
FactoryBase.prvInstCount (PROP) ¶ PROPERTY prvInstCount : CAA.COUNT
FactoryBase.prvInstInit (METH) ¶ METHOD prvInstInit : BOOL InOut: Scope Name Type Return prvInstInit BOOL Input itfInst IInstance hInst CAA.HANDLE itfData IData Output eError ERROR
FactoryBase.prvInstPoolAdr (PROP) ¶ PROPERTY prvInstPoolAdr : CAA.PVOID