hit counter script
Siemens SIMATIC PCS 7 Function Manual
Siemens SIMATIC PCS 7 Function Manual

Siemens SIMATIC PCS 7 Function Manual

Process control system, advanced process functions apf
Hide thumbs Also See for SIMATIC PCS 7:
Table of Contents

Advertisement

SIMATIC
Process Control System PCS 7
Advanced Process Functions (APF)
Function Manual
07/2016
A5E38719883-AA
Preface
Security information
Communication
Material management
Material lot management
Storage location
management
Parameter management
Order management
Archive management
Best before / UTC time supply
Data structures and data
formats
Additional information
1
2
3
4
5
6
7
8
9
10
11

Advertisement

Table of Contents
loading

Summary of Contents for Siemens SIMATIC PCS 7

  • Page 1 Preface Security information Communication SIMATIC Material management Process Control System PCS 7 Advanced Process Functions (APF) Material lot management Storage location management Function Manual Parameter management Order management Archive management Best before / UTC time supply Data structures and data formats Additional information 07/2016...
  • Page 2 Note the following: WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems.
  • Page 3: Preface

    Purpose of the manual This document contains reference information for configuration of the Advanced Process Functions (APF) within the environment of SIMATIC PCS 7. You can find additional information on APF in the following manuals: ● APF Installation and Configuration ●...
  • Page 4 Preface Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 5: Table Of Contents

    Table of contents Preface.................................3 Security information............................11 Communication............................13 FB_UA_RM..........................13 2.1.1 Description..........................13 2.1.2 Functions..........................14 2.1.3 I/Os............................15 2.1.4 Error handling.........................19 2.1.5 Messaging..........................19 FB_UA_WM..........................20 2.2.1 Description..........................20 2.2.2 Functions..........................22 2.2.3 I/Os............................24 2.2.4 Error handling.........................27 2.2.5 Messaging..........................28 User archives.........................29 Operator control and monitoring....................29 Material management..........................31 FB_XXXMA..........................31 3.1.1 Description..........................31 3.1.2...
  • Page 6 Table of contents 4.1.5 Error handling.........................54 4.1.6 Messaging..........................55 User archives.........................57 4.2.1 FB_MATERIAL_LOT......................57 4.2.2 FB_MATATTRIB_LOT......................58 Operator control and monitoring....................60 4.3.1 Block icons..........................60 4.3.2 Picture objects........................60 4.3.3 Messages..........................61 Storage location management........................63 FB_STOR (FB_STORI, FB_STORR)..................63 5.1.1 Description..........................63 5.1.2 Generation..........................64 5.1.3 Functions..........................66 5.1.4 I/Os............................69 5.1.5 Error handling.........................73 5.1.6...
  • Page 7 Table of contents 5.6.3 FB_STORVALUE.........................123 5.6.4 FB_STORAGE........................124 5.6.5 FB_STOR_ST_STATUS......................127 5.6.6 FB_STOR_MAT_STATUS....................128 5.6.7 FB_PROCEDURES......................128 Operator control and monitoring..................129 5.7.1 Block icons...........................129 5.7.2 Picture objects........................130 5.7.3 Messages..........................131 Other............................134 5.8.1 User-defined filter/sorting.....................134 5.8.1.1 Basic procedure........................134 5.8.1.2 Configuration example C function..................136 5.8.1.3 Default values........................137 5.8.1.4 Restrictions..........................138 5.8.2...
  • Page 8 Table of contents 6.5.2 Picture objects........................166 6.5.3 Messages..........................167 Order management..........................171 FB_JOB..........................171 7.1.1 Description...........................171 7.1.2 Generation...........................173 7.1.3 Functions..........................174 7.1.4 I/Os............................188 7.1.5 Error handling........................199 7.1.6 Messaging..........................200 User archives........................207 Operator control and monitoring..................207 7.3.1 Block icons...........................207 7.3.2 Picture objects........................208 7.3.3 Messages..........................209 Archive management..........................211 FB_XXXA (FB_XXXAI, FB_XXXAR)..................211 8.1.1 Description...........................211...
  • Page 9 Table of contents 10.2 UDT_UA_R_REQ_ST......................242 10.3 UDT_UA_W_ST........................243 10.4 UDT_UA_W_REQ_ST......................244 10.5 UDT_ALARM_ST.........................246 10.6 UDT_PA_REQ_ST.......................247 10.7 UDT_PA_CON_ST.......................247 Additional information..........................249 11.1 Configuration file........................249 11.2 Data backup of the user archives..................249 11.2.1 General information......................249 11.2.2 Storage at the backup path....................250 11.2.3 Data backup procedure......................251 11.3 User archives........................251 Advanced Process Functions (APF)
  • Page 10 Table of contents Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 11: Security Information

    In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions only form one element of such a concept. Customer is responsible to prevent unauthorized access to its plants, systems, machines and networks.
  • Page 12 Security information Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 13: Communication

    Communication FB_UA_RM 2.1.1 Description Object properties The following table shows the object properties of the "FB_UA_RM" block: Name Number Family Module FB_UA_RM FB1775 Communication Area of application The block executes the following functions: ● Reading one or more data records from the OS user archive to a data block on request ●...
  • Page 14: Functions

    Communication 2.1 FB_UA_RM OS tags are used to coordinate the data communication between the AS and OS. Appropriate scripts associated with the function block and its functionalities are triggered for operator control at the OS level. The "ALARM_8P" structure is used to implement data communication with the OS message system.
  • Page 15: I/Os

    Communication 2.1 FB_UA_RM Communication between the requesting block and the "FB_UA_RM" function block occurs at the AS level using the "UDT_UA_R_REQ_ST" (request) and "UDT_UA_R_ST" (feedback) structures. The "FB_UA_RM" block can manage a maximum of 128 requests. Each request occupies a separate structure input (UDT_UA_R_REQ_ST).
  • Page 16 Communication 2.1 FB_UA_RM Parameter Description Type Default REQ001_ST Request 1 UDT_UA_R_REQ_ST …. …. REQ128_ST Request 128 MSG_EVID ALARM_8P: EV_ID DWORD Output parameters The following table shows the output parameters of the "FB_UA_RM" block: Parameter Description Type Default PRI_R1 Priority index for request 1 - 128 …...
  • Page 17 Communication 2.1 FB_UA_RM Parameter Description Type Default QCAL_LEN Data length calculated in the OS DINT script, application-specific value QMSG_SUP ALARM_8P: 1=Message suppres‐ BOOL FALSE sion active QMSG_ERR ALARM_8P: ERROR BOOL FALSE MSG_STAT ALARM_8P: STATUS WORD MSG_ACK ALARM_8P: ACK_STATE WORD QBR1_ERR BRCV 1 ERROR BOOL FALSE...
  • Page 18 Communication 2.1 FB_UA_RM Parameter Description Type Default QPRI_MIN Lowest priority index allocated QPRI_MAX Higher priority index allocated QPRI_ACT Number of highest-priority request QPRI_IND Next priority index to be allocated QGEN_OS Target generation version DWORD DW#16#0 GEN_AS Generation version DWORD DW#16#0 In/out parameters The following table shows the in/out parameters of the "FB_UA_RM"...
  • Page 19: Error Handling

    Communication 2.1 FB_UA_RM 2.1.4 Error handling Errors occurring in the block are signaled via the integrated "ALARM_8P" block, and are entered in the output structure or displayed at digital outputs of the block. They can be analyzed by the requesting block on the basis of the output structure. The error bits are available at the block as output signals.
  • Page 20: Fb_Ua_Wm

    Communication 2.2 FB_UA_WM Message Message class Event Message text SIG_5 AS process control Parameter assignment error, duplicate $$BlockComment$$ QPARAMF RCV REQ_ID Message - error Multiple UA @8%d@ IDs SIG_6 AS process control QBR1_ERR $$BlockComment$$ QBR1_ERR com‐ munication error Message - fault SIG_7 AS process control QBR2_ERR...
  • Page 21 Communication 2.2 FB_UA_WM Area of application The block executes the following functions: ● Writing one or more data records from an AS data block to an OS user archive on request ● Monitoring communication (generation of alarms) Startup characteristics The "FB_UA_WM" block is called from the startup OB upon CPU startup. This call is configured during CFC configuration by the CFC editor.
  • Page 22: Functions

    Communication 2.2 FB_UA_WM 2.2.2 Functions Overview The figure below provides an overview of how the "FB_UA_WM" block works: FB_UA_WM How it works Upon request, the "FB_UA_WM" function block writes data to an OS user archive via the "BSEND" communication block (SFB12). The data to be written are copied from a requesting block.
  • Page 23 Communication 2.2 FB_UA_WM The block monitors the 128 input structures for valid write requests. A write request is valid if it fulfills the following conditions: ● "REC_REQ" = 1 ● "MODE" <> 0 ● "REQ_ID" <> 0 ● "ARCH_NA" <>' ' ●...
  • Page 24: I/Os

    Communication 2.2 FB_UA_WM Field Format Bytes Address LENGTH WORD DATA ARRAY 16230 BYTES 74 to 16303 2.2.3 I/Os Input parameters The following table shows the input parameters of the "FB_UA_WM" block: Parameter Description Type Default RUNUPCYC Number of startup cycles ID_1 Parameter ID for BSEND_1 WORD...
  • Page 25 Communication 2.2 FB_UA_WM Parameter Description Type Default QCOM_ERR 1 = Communication error BOOL FALSE Error message from "BSEND" coupling blocks QREQ_ERR Error ID from OS BOOL FALSE 0 = No errors QUA_ST Output structure with job feedback UDT_UA_W_ST QREQ_ID ID of the requesting block QMODE Operating mode WORD...
  • Page 26 Communication 2.2 FB_UA_WM Parameter Description Type Default NO_REC Number of rows to be written DINT COLUMN Column number at which writing commen‐ DINT ces; 0 = Entire row NO_COL Number of columns to be written DINT PARA_1 Associated value 1 for write job, DINT application-specific value PARA_2...
  • Page 27: Error Handling

    Communication 2.2 FB_UA_WM This produces the archive designation "FB_MATERIAL_001" (the archive number is always 3- digit). If the archive designation comprises only the archive name, a "0" is entered for the "ARCH_NO" parameter. Column specification (COLUMN and NO_COL) (transferred from requesting block) If the value of the "COLUMN"...
  • Page 28: Messaging

    Communication 2.2 FB_UA_WM Output structure Output Message text Meaning QCOM_ERR QCOM_ERR QCOM_ERR SEND UA com‐ Communication error, error mes‐ munication error sage from "BSEND" coupling blocks QBS1_ERR QBS1_ERR communication Error message from 1st error "BSEND" coupling block QBS2_ERR QBS2_ERR communication Error message from 2nd error "BSEND"...
  • Page 29: User Archives

    Communication 2.4 Operator control and monitoring The following keywords are used: ● $$BlockComment$$: This keyword inserts the instance-specific block comment before the message text. ● $$HID$$ source ● $$AREA$$: OS_AREA The following associated values are used: Associated value Format Value SD_1 SD_2 SD_3...
  • Page 30 Communication 2.4 Operator control and monitoring Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 31: Material Management

    Material management FB_XXXMA 3.1.1 Description Object properties The following table shows the object properties of FB_XXXMA: Name Number Family Module FB_XXXMA FB822 Material management Area of application The block is used to request and provide material master data. Startup characteristics The "FB_XXXMA"...
  • Page 32: Generation

    Material management 3.1 FB_XXXMA 3.1.2 Generation For each class of material created using the engineering tool in the "FB_MATCLASS" user archive, a block of the type "FB_XXXMA" is generated and saved in the master data library. The generated blocks are numbered consecutively. The block outputs depend on the structure of the "FB_MATATTRIB_XXX"...
  • Page 33: Functions

    Material management 3.1 FB_XXXMA 3.1.3 Functions Overview The figure below provides an overview of how the "FB_XXXMA" block works: FB_XXXMA How it works Following a request by a positive edge at input "REC_REQ", the request data (REC_ID (Material ID), ARCH_NA /ARCH_NO etc.) are written to the output structure "UDT_UA_R_REQ_ST".
  • Page 34: I/Os

    Material management 3.1 FB_XXXMA Once the input structure data have been assigned to the read job, the data are checked for validity and plausibility. The system evaluates the following: ● Whether the request data in the input and output structure match ●...
  • Page 35 Material management 3.1 FB_XXXMA Parameter Description Type Default TIME_MON Monitoring time for read job REAL 30.0 REC_ST Feedback structure from FB_UA_RM UDT_UA_R_ST MSG_EVID ALARM_8P option: EV_ID DWORD Output parameters The following table shows the output parameters of the "FB_XXXMA" block: Parameter Description Type...
  • Page 36 Material management 3.1 FB_XXXMA Parameter Description Type Default QNO_COL Read data: DINT Number of columns to be read QOFFSET Read data: DINT Offset, application-specific value QCAL_LEN Read data: DINT Data length calculated in the OS script, application-specific value QRESERVE Read data: DINT Reserve QNAME...
  • Page 37: Error Handling

    Material management 3.1 FB_XXXMA Parameter Description Type Default DATE1 Read data: DWORD Example, material process value 8 DATE1B Read data: DWORD Example, material process value 9 TIME1 Read data: DWORD Example, material process value 10 TIME1B Read data: DWORD Example, material process value 11 Read data: DWORD Example, material process value 12...
  • Page 38: Messaging

    Material management 3.1 FB_XXXMA The following error messages can be generated: Output Message text Meaning QERR QERR data error read job ID "id" Requested data and read data do not REC_ID "rec_id" match QMON_ERR QMON_ERR runtime error read job ID Read job monitoring timeout "id"...
  • Page 39: User Archives

    Material management 3.2 User archives The following keywords are used: ● $$BlockComment$$: instance-specific block comment. ● $$HID$$ source ● $$AREA$$: OS_AREA ● @1%s@: Batch ID The following associated values are used: Associated value Format Value SD_1 @1%s@ BA_NA SD_2 @2%d@ STEP_NO SD_3 @3%d@...
  • Page 40: Fb_Mattype_Xxx, Fb_Mattype

    Material management 3.2 User archives 3.2.2 FB_MATTYPE_XXX, FB_MATTYPE The material types of a material class are defined in the "FB_MATTYPE_XXX" user archives. An archive is assigned to each material class and numbered accordingly. There is also a "collective archive" without _XXX that contains one instance of each material type. The archives are structured as follows: Element Description...
  • Page 41: Fb_Material_Xxx

    Material management 3.2 User archives Integer value Format REAL with 4 decimal places STRING 8 characters STRING 16 characters STRING 32 characters STRING 64 characters STRING 128 characters STRING 14 characters (for PLM Dairy Library) 20xx DATE 21xx TIME 22xx DATE AND TIME BOOL ENUMERATION...
  • Page 42: Operator Control And Monitoring

    Material management 3.3 Operator control and monitoring Element Description Format VERSION Current version REAL CHANGEUSER Name of the operator who made the last STRING 32 change CHANGEDATE Date of the last change DATE TYPE Assignment to a material type ATTRIB_QSHLIFE Value of property Represents the formats of the at‐...
  • Page 43: Picture Objects

    Material management 3.3 Operator control and monitoring 3.3.2 Picture objects The interface for material management operator control and monitoring consists of the following picture objects: ● FB_MAT_ED.PDL You can use the picture "FB_MAT_ED.pdl" to create, change, delete and copy material master data.
  • Page 44 Material management 3.3 Operator control and monitoring Message class Event Message text OS process control error Cyclic backup action: Copy failed @7%s@: Backup file 1 (@2%s@) could not be cop‐ OS process control error Cyclic backup action: Copy failed @7%s@: Backup file 2 (@2%s@) could not be cop‐ OS process control error Cyclic backup action: Directory in ini file @7%s@: Configured backup directory 1 is corrupt...
  • Page 45: Material Lot Management

    Material lot management FB_MLOT 4.1.1 Description Object properties The following table shows the object properties of FB_MLOT: Name Number Family Module FB_MLOT FB1778 Material lot management Area of application The "FB_MLOT" block requests and provides material lot data in the AS. Startup characteristics The "FB_MLOT"...
  • Page 46: Generation

    Material lot management 4.1 FB_MLOT 4.1.2 Generation An "FB_MLOT" block is generated and saved in the master data library for the attributes of the material lots (100 max.) created using the engineering tool in the "FB_MATATTRIB_LOT" user archive. An output is created for each attribute in the "FB_MLOT" block. The figure below provides an overview of the "FB_MLOT"...
  • Page 47: Functions

    Material lot management 4.1 FB_MLOT 4.1.3 Functions Overview The figure below provides an overview of how the "FB_MLOT" block works: FB_MLOT Reading data Following a request by a positive edge at request input "RREC_REQ", the request data (RREC_ID (material lot ID), ARCH_NA /ARCH_NO, etc.) are written to the output structure "UDT_UA_R_REQ_ST".
  • Page 48 Material lot management 4.1 FB_MLOT Once the read job has been executed, the communication block "FB_UA_RM" writes the request data (including RREQ_ID) and the pointer to the material data record to the "UDT_UA_R_ST" input structure of the block, where it also sets the "NEW_DATA" input bit. Note For detailed information on the "UDT_UA_R_REQ_ST"...
  • Page 49 Material lot management 4.1 FB_MLOT The following inputs are required when you insert ("WREQ_INS") or update ("WREQ_UPD") a data record: ● INAME ● DESCR ● UOM ● IVERSION ● MATID ● LOSSTAT / LOTSTAT ● MHD / BBD ● MHDB / BBDB ●...
  • Page 50: I/Os

    Material lot management 4.1 FB_MLOT Repetition of jobs The "COUNT" input value defines how often a job is to be repeated if an error occurs (COUNT = 0 -> no repetition). Until the specified number of job repetitions has been reached, the job is reactivated by FB_MLOT after a wait cycle.
  • Page 51 Material lot management 4.1 FB_MLOT Parameter Description Type Default OS_REC_ID 1= REC_ID is assigned upon insertion by OS BOOL FALSE COUNT Number of repetitions if an error occurs RRESET 1 = Reset read interface BOOL WRESET 1 = Reset write interface BOOL FALSE TIME_MON...
  • Page 52 Material lot management 4.1 FB_MLOT Parameter Description Type Default QRLENERR 1 = Read error, BOOL Header: requested data and read data do not match QRM_ERR FB_UA_RM: 1 = Read error, requested BOOL data and read data do not match QRM_AERR FB_UA_RM: 1 = Archive error, invalid BOOL data in receive buffer...
  • Page 53 Material lot management 4.1 FB_MLOT Parameter Description Type Default QNO_REC Read data: DINT Number of rows to be read QCOLUMN Read data: DINT Column number at which reading com‐ mences QNO_COL Read data: DINT Number of columns to be read QOFFSET Read data: DINT...
  • Page 54: Error Handling

    Material lot management 4.1 FB_MLOT Parameter Description Type Default MSG_ACK ALARM_8P: ACK_STATE WORD QMSG_SUP ALARM_8P: 1=Message suppression BOOL active QMSG_ERR ALARM_8P: ERROR BOOL In/out parameters The following table shows the in/out parameters of the "FB_MLOT" block: Parameter Description Type Default APF_AS APF function block version in AS WORD...
  • Page 55: Messaging

    Material lot management 4.1 FB_MLOT Output structure Output Message text Meaning QREQ_ERR $$BlockComment$$ QREQ_ERR, More than one action (insert/update/ more than one trigger of function ac‐ delete) triggered in same cycle tive ID "id" $$BlockComment$$ QIN_PROC, a Action not possible because an ac‐ write job is already active ID "id"...
  • Page 56 Material lot management 4.1 FB_MLOT Message Message class Event Message text SIG_7 AS process control More than one action (insert/update/de‐ $$BlockComment$$ QREQ_ERR, lete) triggered in same cycle more than one trigger of function ac‐ Message - fault tive ID @4%d@ SIG_8 AS process control Action not possible because an action is...
  • Page 57: User Archives

    Material lot management 4.2 User archives The following keywords are used: ● $$BlockComment$$: instance-specific block comment. ● $$HID$$ source ● $$AREA$$: OS_AREA ● @1%s@: Batch ID The following associated values are used: Associated value Format Value SD_1 @1%s@ BA_NA SD_2 @2%d@ STEP_NO SD_3...
  • Page 58: Fb_Matattrib_Lot

    Material lot management 4.2 User archives Note *The manual input in the editor dialog is limited to 2,000,000,000. The engineering tool creates the first attribute as the material state. The engineering tool creates the second attribute as the best before date. The remaining attributes are assigned the column name "ATTRIB_"...
  • Page 59 Material lot management 4.2 User archives Format coding The following table shows the coding of the attribute in "FORMAT": Integer value Format INTEGER 32 REAL without decimal places REAL with 1 decimal place REAL with 2 decimal places REAL with 3 decimal places REAL with 4 decimal places STRING 8 characters STRING 16 characters...
  • Page 60: Operator Control And Monitoring

    Material lot management 4.3 Operator control and monitoring Operator control and monitoring 4.3.1 Block icons No block icon is assigned to the "FB_MLOT" block. This block is always controlled indirectly from other blocks. @Template_APF.pdl The "@Template_APF.pdl" template picture contains a template for configuring the deletion of material lots which are not in use: 4.3.2 Picture objects...
  • Page 61: Messages

    Material lot management 4.3 Operator control and monitoring 4.3.3 Messages The following messages can be output: Message class Event Message text Operator message Save button @7%s@: @2%s@: new = @5%.4f@ @8%s@ old = @4%.4f@ @8%s@ material lot: @6%s@ Operator message Save button @7%s@: @2%s@: new = @5%s@ @8%s@ old = @4%s@ @8%s@ material lot: @6%s@...
  • Page 62 Material lot management 4.3 Operator control and monitoring Message class Event Message text OS process control error Cyclic backup action: Directory in ini @7%s@: Configured backup directory 1 is cor‐ file is empty rupt OS process control error Cyclic backup action: Directory in ini @7%s@: Configured backup directory 2 is cor‐...
  • Page 63: Storage Location Management

    Storage location management FB_STOR (FB_STORI, FB_STORR) 5.1.1 Description Object properties The following table shows the object properties of FB_STOR: Name Number Family Module FB_STOR FB1781 Storage location man‐ agement Area of application The "FB_STOR" block provides the storage location parameters (attributes) available in the user archive in the AS and transfers the actual values in the AS to the user archive.
  • Page 64: Generation

    Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) and "OP_REC_W" when a storage location is updated. The actual value content (CONT_A input) is also available as a WinCC tag. The "ALARM_8P" structure is used to implement data communication with the OS message system.
  • Page 65 Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 66: Functions

    Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) 5.1.3 Functions Overview The figure below provides an overview of how the "FB_STOR" block works: FB_STOR Reading data Following a request by a positive edge at request input "L_REC_R", the request data (REC_ID (storage location ID), ARCH_NA /ARCH_NO, etc.) are written to the output structure "UDT_UA_R_REQ_ST".
  • Page 67 Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Once the read job has been executed, the communication block "FB_UA_RM" writes the request data (including REQ_ID) and the pointer to the storage location data record to the "UDT_UA_R_ST" input structure of the block, where it also sets the "NEW_DATA" input bit. Note For detailed information on the "UDT_UA_R_REQ_ST"...
  • Page 68 Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) The "WR_OK" output of the "FB_STOR" block is only set if the data are plausible and valid. The "WR_OK" output is reset by resetting the "L_REC_W" request input. The "FB_UA_WM" communication block reports any errors it detects during execution of the write job to the "FB_STOR"...
  • Page 69: I/Os

    Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Monitored input Meaning REL4DYN Dynamic procedure enable 4 Not used Not used Not used None (restart) Read data upon CPU restart Automatic repetition of jobs The "COUNT" input value defines how often a job is to be repeated if an error occurs (COUNT = 0 ->...
  • Page 70 Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Parameter Description Type WinCC tag fault L_REC_W Interconnectable input: 1 = Write data request BOOL RRESET Reset data from read job BOOL WRESET Reset data from write job BOOL DBNO Number of the instance data block DINT CONT_A Current process value 1...
  • Page 71 Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Parameter Description Type Default WinCC tag QRM_AERR FB_UA_RM: 1 = Archive error, invalid data in receive BOOL buffer QRM_CERR FB_UA_RM: 1 = Communication error, error message BOOL from "BRCV" coupling blocks QRM_PERR FB_UA_RM: 1 = Parameter assignment error, dupli‐ BOOL cate REQ_ID or incorrect ID_1, R_ID_1 or ID_2, R_ID_2...
  • Page 72 Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Parameter Description Type Default WinCC tag QCH_DAT Read data: Time of change part 1 DWORD 16#08123123 QCH_DATB Read data: Time of change part 2 DWORD 16#59590000 QFORMAT Read data: Data format content DINT QACCMODE Read data: Booking mode DINT...
  • Page 73: Error Handling

    Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Parameter Description Type Default WinCC tag APF_AS APF function block version in AS WORD APF_OS APF function block version in OS WORD GEN_AS Generation information in AS DWORD GEN_OS Generation information in OS DWORD "x": WinCC tag available;...
  • Page 74: Messaging

    Storage location management 5.1 FB_STOR (FB_STORI, FB_STORR) Output structure Output Message text Meaning QWM_PERR Parameter assignment error of the FB_UA_WM QERR_VER QERR_VER Version check error Error in the version information 5.1.6 Messaging The "FB_STOR" block uses the "ALARM_8P" block to generate messages. Following CPU startup, messages are suppressed (QMSG_SUP = 1) until the "RUNUPCYC"...
  • Page 75: Fb_Sact

    Storage location management 5.2 FB_SACT The following associated values are used: Associated value Format Value SD_1 @1%s@ BA_NA SD_2 @2%d@ STEP_NO SD_3 @3%d@ BA_ID SD_4 @4%d@ SD_5 @5%d@ REC_ID SD_6 @6%s@ NAME part 1 SD_7 @7%s@ NAME part 2 SD_8 SD_9 SD_10 FB_SACT...
  • Page 76: Generation

    Storage location management 5.2 FB_SACT Program execution starts once the "RUNUPCYC" cycles have elapsed. During startup, the output "QRUN_UP" = 1. Time characteristics The block must be called from a cyclic interrupt OB. Communication Data exchange with the "FB_UA_WM" communication block on the AS level is performed via the "UDT_UA_W_REQ_S"...
  • Page 77: Functions

    Storage location management 5.2 FB_SACT 5.2.3 Functions Overview The figure below provides an overview of the "FB_SACT" block function: How it works At a request from the OS, the "FB_SACT" block reads the current actual values of the storage locations from the AS and sends these as a data cell to the requesting OS using the "FB_UA_WM"...
  • Page 78 Storage location management 5.2 FB_SACT When the function is triggered by the OS and "OP_REC_W" = 1, the actual values are read from the instance data blocks of the "FB_STOR" block and entered in full in a data cell. The number of "IN_COUNT"...
  • Page 79 Storage location management 5.2 FB_SACT CELL FORMAT Bytes Address IN_COL2 IN_FOR2 IN_COL3 IN_FOR3 IN_COL4 IN_FOR4 IN_COL5 IN_FOR5 IN_COL6 IN_FOR6 IN_COL7 IN_FOR7 IN_COL8 IN_FOR8 IN_COL9 IN_FOR9 IN_COL10 IN_FOR10 IN_DBaa, REC_ID DINT IN_DBaa, FORMAT DINT IN_DBaa, requested value 1 Requested format Depends on for‐ IN_DBaa, requested value 2 Requested format Depends on for‐...
  • Page 80: I/Os

    Storage location management 5.2 FB_SACT CELL FORMAT Bytes Address … … IN_DB…, requested value y Requested format Depends on for‐ … Maximum of 16229 5.2.4 I/Os Input parameters The following table shows the input parameters of the "FB_SACT" block: Parameter Description Type Default...
  • Page 81 Storage location management 5.2 FB_SACT Output parameters The following table shows the output parameters of the "FB_SACT" block: Parameter Description Type Default QREC_W Status request data write QINDBERR 1 = Error, no instance DB or incorrect length BOOL QRUN_UP Status display startup active = 1 BOOL QNOT_OK Block flag "OK"...
  • Page 82: Error Handling

    Storage location management 5.2 FB_SACT In/out parameters The following table shows the input and output parameters of the "FB_SACT" block: Parameter Description Type Default OP_REC_W Operator: 1 = Data request BOOL APF_AS APF function block version in AS WORD APF_OS APF function block version in OS WORD 5.2.5...
  • Page 83: Messaging

    Storage location management 5.2 FB_SACT 5.2.6 Messaging The "FB_SACT" block uses the "ALARM_8P" block to generate messages. Following CPU startup, messages are suppressed (QMSG_SUP = 1) until the "RUNUPCYC" cycles have elapsed. The following messages can be output: Message Message class Event Message text SIG_1...
  • Page 84: Fb_St_Ac

    Storage location management 5.3 FB_ST_AC FB_ST_AC 5.3.1 Description Object properties The following table shows the object properties of FB_ST_AC: Name Number Family Module FB_ST_AC FB1782 Storage location man‐ agement Area of application The "FB_ST_AC" block (storage account) handles the booking and clearing of materials/ material lots from the AS.
  • Page 85: Functions

    Storage location management 5.3 FB_ST_AC 5.3.3 Functions Overview The figure below provides an overview of how the "FB_ST_AC" block works: FB_ST_AC Booking / clearing Booking is done at the block using the "FB_UA_RM" block. The following data are transferred to the "FB_UA_RM" block upon a positive edge at the "L_REC_W" input: ●...
  • Page 86 Storage location management 5.3 FB_ST_AC Deleting material If the storage location is empty (STOR_CONT column <= 0), you can use the "L_MAT_DEL" input to delete the material in the storage location. The storage location is then set to 0 in the user archive.
  • Page 87: I/Os

    Storage location management 5.3 FB_ST_AC Once the booking process is complete, part lots which have been rebooked and their partial quantities are available for further processing at the 30 block outputs "QMLx_ID", "QMLxAC_I" and "QMLxAC_R" (x = 1..10). Converting units You can convert units.
  • Page 88 Storage location management 5.3 FB_ST_AC Parameter Description Type Default RESET Reset data from write job BOOL MODE Mode WORD MLOT_ID Material lot ID DINT AC_VAL_I Booking value in DINT format DINT AC_VAL_R Booking value in REAL format REAL MSG_EVID ALARM_8P: EV_ID DWORD "MODE"...
  • Page 89 Storage location management 5.3 FB_ST_AC Parameter Description Type Default QRM_PERR FB_UA_RM: 1 = Parameter assignment er‐ BOOL ror, duplicate REQ_ID or incorrect ID_1, R_ID_1 or ID_2, R_ID_2 QMLOTMAX 1 = Error, max. number of material lots BOOL reached QREL_ERR 1 = Release error BOOL QMLOTERR 1 = Error, "MLOT"...
  • Page 90: Error Handling

    Storage location management 5.3 FB_ST_AC Parameter Description Type Default QML4AC_R Partial quantity in part material lot 4 (Real) DINT QML5_ID Part material lot ID 5 DINT QML5AC_I Partial quantity in part material lot 5 (integer) DINT QML5AC_R Partial quantity in part material lot 5 (Real) DINT QML6_ID Part material lot ID 6...
  • Page 91 Storage location management 5.3 FB_ST_AC The following error messages can be generated: Request structure Output Meaning QPARAMF Parameter assignment error; ID or TIME_MON <= 0 QERR Data error REQ_ID in request and receive structure not the same MON_ERR QMONERR Runtime error; Monitoring timeout QRM_ERR Error from FB_UA_RM: Data error,...
  • Page 92: Messaging

    Storage location management 5.3 FB_ST_AC 5.3.6 Messaging The "FB_ST_AC" block uses the "ALARM_8P" block to generate messages. Following CPU startup, messages are suppressed (QMSG_SUP = 1) until the "RUNUPCYC" cycles have elapsed. The following messages can be output: Message Message class Event Message text SIG_1...
  • Page 93: Fb_Stloc

    Storage location management 5.4 FB_STLOC Associated value Format Value SD_5 @5%d@ REC_ID SD_6 @6%d@ MLOT_ID SD_7 @7%d@ REQ_ERR SD_8 SD_9 SD_10 FB_STLOC 5.4.1 Description Object properties The following table shows the object properties of FB_STLOC: Name Number Family Module FB_STLOC FB1779 Storage location man‐...
  • Page 94: Generation

    Storage location management 5.4 FB_STLOC Startup characteristics The "FB_STLOC" block is called from the startup OB upon CPU startup. This call is configured during CFC configuration by the CFC editor. Internal data and outputs are reset upon startup. Program execution starts once the "RUNUPCYC" cycles have elapsed. During startup, the output "QRUN_UP"...
  • Page 95: Functions

    Storage location management 5.4 FB_STLOC 5.4.3 Functions Overview The AS function block "FB_STLOC" is used to search storage locations for a material from the AS. You specify the storage location using a search filter defined in the AS. The "FB_UA_RM" block sends the search query to the OS.
  • Page 96: I/Os

    Storage location management 5.4 FB_STLOC The following feedback is output when the "START" function is completed: ● The execution of the "START" function was successful: QIDLE = 0, QACTIVE = 1, QRUN_ERR = 0 ● The execution of the "START" function was not successful: QIDLE = 1, QACTIVE = 0, QRUN_ERR = 1 If the check of the selected storage location is negative in automatic mode, the next storage location found in the list is automatically checked.
  • Page 97 Storage location management 5.4 FB_STLOC Parameter Description Type Default FORMAT Data format, quantity DINT BA_NA Batch name STRING[32] BA_ID Batch ID DWORD COUNT Number of repetitions if an error occurs TIME_MON Monitoring time for read job REAL 30.0 EN_FILT Activates user-defined filter/sorting BOOL SEL_MODE Activates 2-step mode...
  • Page 98 Storage location management 5.4 FB_STLOC Parameter Description Type Default LVALUE5B Interconnectable input: DWORD 16#0 Value 5 (date part 2) LVALUE6 Interconnectable input: Value 6 (date part 1) DWORD 16#90010100 LVALUE6B Interconnectable input: Value 6 (date part 2) DWORD 16#0 OP_EN Enabled operations WORD 16#FFFF...
  • Page 99 Storage location management 5.4 FB_STLOC "HIDE_BUT" parameter You can hide buttons in the faceplate with the input word "HIDE_BUT". Name Meaning MANAUT 0 = "Auto" and "Manual" are shown 1 = "Auto" and "Manual" are hidden not used SEARCH 0 = "Search" is shown 1 = "Search"...
  • Page 100 Storage location management 5.4 FB_STLOC Parameter Description Type Default QHITPLUS 1 = More than 10 storage locations found BOOL QSEL_POS 1 = Storage location(s) found, selection of storage BOOL location possible QSEL_OK 1 = Storage location selected BOOL QSEL_ERR 1 = Error in storage location search BOOL QRUN_ERR 1 = Error starting storage...
  • Page 101 Storage location management 5.4 FB_STLOC Parameter Description Type Default Read data: ID QARCH_NA Read data: Archive name STRING[16] QARCH_NO Read data: Archive number DINT QREC_ID Read data: Data record number in user archive DINT QNO_REC Read data: Number of rows to be read DINT QCOLUMN Read data: Column number at which reading com‐...
  • Page 102 Storage location management 5.4 FB_STLOC Parameter Description Type Default QHITS 0 to 10 - number of matching storage locations for DINT display / selection QHIT_MAX 0 to 11 - number of matching storage locations DINT 11 = There are more than 10 matching storage locations S_ID_P01 Storage location found P01: ID...
  • Page 103: Error Handling

    Storage location management 5.4 FB_STLOC Parameter Description Type Default RCON_Pn Storage location found Pn (n = 02 to 10): REAL Content in REAL format RMAX_Pn Storage location found Pn (n = 02 to 10): REAL Maximum fill level in REAL format EN_AUT Operator control enable: Auto BOOL...
  • Page 104: Messaging

    Storage location management 5.4 FB_STLOC The following error messages can be generated: Request structure Output Meaning QPARAMF Parameter assignment error; ID or ARCH_NA=' ' or TIME_MON <= 0 QRLENERR Data block length of the receive data is not correct QRERR Data error Header data in request and receive structure not the same MON_ERR...
  • Page 105 Storage location management 5.4 FB_STLOC Message Message class Event Message text SIG_5 AS process control QRUN_ERR: Error starting storage $$BlockComment$$ QRUN_ERR Message - error ID @4 REC_ID "@5 STORGR @6 quantity @8 / @9 @7 SIG_6 AS process control QEND_ERR: Error completing stor‐ $$BlockComment$$ QEND_ERR Message - error ID @4 REC_ID "@5 STORGR @6 quantity...
  • Page 106: Fb_Stmat

    Storage location management 5.5 FB_STMAT FB_STMAT 5.5.1 Description Object properties The following table shows the object properties of FB_STMAT: Name Number Family Module FB_STMAT FB1780 Storage location man‐ agement Area of application The AS function block "FB_STMAT" (storage material) is used to search materials in storage locations from the AS.
  • Page 107: Generation

    Storage location management 5.5 FB_STMAT Communication Data exchange with the "FB_UA_RM" communication block on the AS level is performed via the "UDT_UA_R_REQ_ST" (request) and "UDT_UA_R_ST" (feedback) structures. For operator control and monitoring, signal exchange takes place between the AS and the OS via the inputs/outputs of the "FB_STMAT"...
  • Page 108 Storage location management 5.5 FB_STMAT Use of remainder Use of remainder is activated at the "EN_REM = 1" input. The maximum number of storage locations to be included with remainders is specified at the "SPLIT_PT" input parameter. When the function is started, the selected storage locations are reserved with the specified partial quantities.
  • Page 109 Storage location management 5.5 FB_STMAT Triggering the "START" function Following a positive edge at the "L_START" input of the block, the selected storage location is checked against the filter criteria. If they match, the setpoint quantity is reserved at the storage location.
  • Page 110: I/Os

    Storage location management 5.5 FB_STMAT 5.5.4 I/Os Input parameters The following table shows the input parameters of the "FB_STMAT" block. Search criteria can be set via the LMAT to LFILTER2 parameters. Parameter Description Type Default OS tag SAMPLE_T Sampling time [s] REAL RUNUPCYC Number of startup cycles...
  • Page 111 Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag LMATSTA2 Interconnectable input: DINT Material status 2 LMATSTA3 Interconnectable input: DINT Material status 3 LMATSTA4 Interconnectable input: DINT Material status 4 LPROREL1 Interconnectable input: Procedure enable 1 DINT LPROREL2 Interconnectable input: Procedure enable 2 DINT LPROREL3...
  • Page 112 Storage location management 5.5 FB_STMAT "MODE" parameter You can define the mode of the block using the input word "MODE": Name Meaning EDGE_START_NEC 0 = Positive edge at the "L_START" input required. 1 = No positive edge at the "L_START" input required. QSEL_ERR_MSG 0 = OS QSEL_ERR message deactivated 1 = OS QSEL_ERR message is active...
  • Page 113 Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag QNOT_OK Block flag "OK" not set, error = 1 BOOL QRELEASED 1= Function block released for processing BOOL QGR_ERR Function block group error/fault BOOL QERR_VER 1 = Version check error BOOL QPARAMF 1 = Parameter assignment error,...
  • Page 114 Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag Material DINT MAT_LOT Material lot DINT STO_STA1 Storage location status 1 DINT STO_STA2 Storage location status 2 DINT STO_STA3 Storage location status 3 DINT STO_STA4 Storage location status 4 DINT MAT_STA1 Material status 1...
  • Page 115 Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag S_NA_SEL Selected first storage location: Name STRING[64] M_ID_SEL Selected storage location: Material ID DINT MLOT_SEL Selected first storage location: Material lot ID DINT TAGN_SEL Selected first storage location: TAG name STRING[128] UOM_SEL Selected first storage location: Unit of the meas‐...
  • Page 116 Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag RAMSLn Selected nth storage location (n = 02 to 10): REAL Quantity in REAL format RCONSLn Selected nth storage location (n = 02 to 10): REAL Content in REAL format RMINSLn Selected nth storage location (n = 02 to 10): REAL...
  • Page 117 Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag IMIN_P01 Storage location found P01: Minimum fill level in DINT DINT format IRAM_P01 Storage location found P01: Remainder in DINT DINT format RAM_P01 Storage location found P01: Quantity in REAL for‐ REAL RCON_P01 Storage location found P01: Content in REAL for‐...
  • Page 118: Error Handling

    Storage location management 5.5 FB_STMAT Parameter Description Type Default OS tag EN_SEAR Operator control enable: Search BOOL EN_POS Operator control enable: Selected row number BOOL DIS_MAAU 1 = Display of manual / auto buttons in the face‐ BOOL plate DIS_SEAR 1 = Display of search button in the faceplate BOOL QPOS...
  • Page 119: Messaging

    Storage location management 5.5 FB_STMAT Request struc‐ Output Meaning ture QRERR Data error Header data in request and receive structure not the same MON_ERR QMONERR Runtime error; Monitoring timeout QRM_ERR Error from FB_UA_RM: Data error, job data in WinCC communication interface do not correspond to original job data QRM_AERR Error from FB_UA_RM: Archive error;...
  • Page 120: User Archives

    Storage location management 5.6 User archives Message Message class Event Message text SIG_5 AS process control QRUN_ERR: Error starting export $$BlockComment$$ QRUN_ERR ID @4%d@ REC_ID @5%d@ MAT @6%d@ Message - fault quantity @8%d@ / @9%f@ @7%s@ SIG_6 AS process control QEND_ERR: Error completing export $$BlockComment$$ QEND_ERR ID @4%d@ REC_ID @5%d@ MAT @6%d@ Message - fault...
  • Page 121: Fb_Storattrib

    Storage location management 5.6 User archives Element Description Format Location identifier of the storage location STRING 32 group TXTLIB ID for multilingual management in the text INTEGER 32 library 5.6.2 FB_STORATTRIB In this user archive, up to 50 storage location attributes (properties) are defined. The archive has the following structure: Element Description...
  • Page 122 Storage location management 5.6 User archives Integer value Format STRING 64 characters STRING 128 characters STRING 14 characters (for PLM Dairy Library) 20xx DATE 21xx TIME 22xx DATE AND TIME BOOL ENUMERATION MATERIAL MATERIAL (release check) X MATERIAL LOT (release check) X MATERIAL LOT CONTENTS FORMAT X CONTENTS FORMAT (format-related value, cannot be modified) 32BITS (material releases) X...
  • Page 123: Fb_Storvalue

    Storage location management 5.6 User archives 5.6.3 FB_STORVALUE In this user archive, up to 50 storage location process values (actual values) are defined. The archive has the following structure: Element Description Format Position in the visualization order INTEGER 32 NAME Name of the attribute STRING 64 Unit of the actual value...
  • Page 124: Fb_Storage

    Storage location management 5.6 User archives Integer value Format MATERIAL 32BITS (static procedure enables from the Dairy Library) X 32 BITS (dynamic procedure enables from the Dairy Library) X CONTENTS FORMAT (format-related numerical value) STORAGE STATE (storage location status) X MATERIAL STATE (material status) X The values marked X are not free for use.
  • Page 125 Storage location management 5.6 User archives Element Description Format ACC_MODE Booking mode of storage location INTEGER 32 MATID ID of base material INTEGER 32 MLOTID1 ID of material lot (1 to 10) INTEGER 32 …. MLOTID10 MLOT_CONT1 Quantity of material lot in storage location DOUBLE (1 to 10), each by MLOTIDn ….
  • Page 126 Storage location management 5.6 User archives Element Description Format ACT_REL1DYN Status of dynamic procedure enables (1 INTEGER 32 to 4) …. ACT_REL4DYN VALUE_<ioname> Actual value (1 to 50) Corresponds to formats of the actual values from the corre‐ …. Maximum of 50 cells sponding user archive VALUE_<ioname>...
  • Page 127: Fb_Stor_St_Status

    Storage location management 5.6 User archives FORMAT The FORMAT column specifies the numerical format for the CONT_MAX, CONT_MIN, STOR_CONT, STOR_USE_IN, STOR_USE_OUT and ACT_CONT_A columns. This is required for display in the OS and for the corresponding AS block. The following table shows the format coding in "INTEGER": Integer value Mode INTEGER 32...
  • Page 128: Fb_Stor_Mat_Status

    Storage location management 5.6 User archives 5.6.6 FB_STOR_MAT_STATUS A range of different material states are saved in this user archive. The archive has the following structure: Element Description Format REC_ID Internal ID of material location status INTEGER 32 NAME Name of material state STRING 32 TXTLIB ID for multilingual management in the text...
  • Page 129: Operator Control And Monitoring

    Storage location management 5.7 Operator control and monitoring Operator control and monitoring 5.7.1 Block icons @TypicalsAPF.pdl The "@TypicalsAPF.pdl" template picture contains templates for automatically generating block icons from the plant hierarchy: Block Templates FB_STLOC FB_STMAT @Template_APF.pdl The "@Template_APF.pdl" template picture contains templates for block icons and for calling additional functions for use in the process pictures.
  • Page 130: Picture Objects

    Storage location management 5.7 Operator control and monitoring 5.7.2 Picture objects The interface for storage location management operator control and monitoring consists of the following picture objects: WinCC flow charts ● FB_STOR_ED.pdl The picture allows you to create, change, delete and copy storage location master data and to carry out updates with AS data.
  • Page 131: Messages

    Storage location management 5.7 Operator control and monitoring ● @PG_FB_ST_SEARCH.pdl This faceplate enables you to search for storage locations corresponding to the selected search criteria. ● @PG_FB_MAT_SEARCH.pdl This faceplate enables you to search for materials / material lots in the storage locations that correspond to the selected search criteria.
  • Page 132 Storage location management 5.7 Operator control and monitoring Message class Event Message text OS process control error FB_ST_AC, @PG_FB_MAT_IN/OUT/ @7%s@: Maximum number of material lots is ADJ/IO.pdl reached! OS process control error FB_ST_AC, @PG_FB_MAT_IN/ADJ/ @7%s@: Maximum content limit reached! IO.pdl OS process control error FB_ST_AC, @PG_FB_MAT_OUT/ADJ/ @7%s@: Minimum content limit reached!
  • Page 133 Storage location management 5.7 Operator control and monitoring Message class Event Message text OS process control error Cyclic backup action: The readout of @7%s@: Project path could not be read. Cannot the project path was incorrect. copy the backup file OS process control error Cyclic backup action: Directory 1 could @7%s@: Backup directory 1 does not exist / could...
  • Page 134: Other

    Storage location management 5.8 Other Other 5.8.1 User-defined filter/sorting 5.8.1.1 Basic procedure Note You need basic knowledge of T-SQL and the C programming language to create the user- defined filter / sorting. The following function blocks / faceplates support user-defined searches: ●...
  • Page 135 Storage location management 5.8 Other The following information must be saved in the C function for each case defined: iFilterAndSortNameTextLibID = Text library ID for the name of the filter and / or sorting lpszValue1UOM = Unit of the first free value (integer) lpszValue2UOM = Unit of the second free value (integer) lpszValue3UOM = Unit of the third free value (real / float) lpszValue4UOM = Unit of the fourth free value (real / float)
  • Page 136: Configuration Example C Function

    Storage location management 5.8 Other lpszSQLFilter and lpszSQLSort can be used simultaneously but do not have to be. You can, for example, define sorting only for a given search. If lpszSQLFilter is left blank and only lpszSQLSort is configured, the search results are simply sorted.
  • Page 137: Default Values

    Storage location management 5.8 Other strncpy(lpszSQLFilter, "(REC_ID >= @1@) AND (REC_ID <= @2@) AND ((STOR_CONT > @3@) AND (STOR_CONT < @4@)) AND (CHANGEDATE = @5@)", iSQLFilterLength-1); //filter string (length <= 1024) strncpy(lpszSQLSort, "STOR_CONT DESC, REC_ID ASC", iSQLSortLength-1); //sort string (length <= 1024) break;...
  • Page 138: Restrictions

    Storage location management 5.8 Other Faceplates Faceplates display values, value names and value units in a popup window. If all six values are used, they are listed in row 1 to row 6. The popup window in the faceplates for the FB_STLOC and FB_STMAT blocks is used simply to display the filters and values selected in the AS.
  • Page 139: Split" Point

    Storage location management 5.8 Other ● "L_NEXT" input switches selected storage locations one after the other to the active data range "QS_ID" .. "QRRAM" ● Only two-step operation is possible, regardless of the setting at the "SEL_MODE" input 5.8.3.1 "Split" point To solve the problem of not achieving the required setpoint with the storage locations / quantities displayed with the set filter, there are two separate filters (LFILTER and LFILTER2 inputs) and a "split"...
  • Page 140: Output Of Selected Storage Locations

    Storage location management 5.8 Other 5.8.3.3 Output of selected storage locations The FB_STMAT function block has output areas for the selected storage locations (S_ID_SEL .. RRAM_SEL to S_IDSL10 .. RRAMSL10) and an output area for the active storage location (QS_ID .. QRRAM). 5.8.3.4 Switching the active storage location A positive edge at the binary input "L_NEXT"...
  • Page 141: Material Class / Material Type Releases

    Storage location management 5.8 Other L_START Upon a positive edge at the input L_START, all selected storage locations are re-examined and those with a positive result are reserved in the respective quantities in the STOR_USE_OUT column of the user archive. The first storage location in the list (the first selected in the faceplate) is also copied to the "Active storage location"...
  • Page 142 Storage location management 5.8 Other Details of the releases can be accessed by clicking on the object. The picture window that then opens shows the material classes / material types for the object and their releases. In the two following pictures, only two materials classes / three material types are available. If there are more in the archives, they are automatically displayed in these pictures.
  • Page 143: Static And Dynamic Procedure Enables

    Storage location management 5.8 Other 5.8.5 Static and dynamic procedure enables In other libraries, so-called procedure enables are used to block or release certain user-defined operations on tanks. To achieve compatibility, these enables are also available in the storage location management of the APF Toolbox. They function in a similar way to material class / material type releases.
  • Page 144: Storage / Material State

    Storage location management 5.8 Other 5.8.6 Storage / material state A storage location can be assigned a range of states as integer values with storage / material state. There is an assigned text for this integer value in the FB_STOR_ST_STATUS and FB_STOR_MAT_STATUS archives.
  • Page 145: Parameter Management

    Parameter management FB_XXXPA 6.1.1 Description Object properties The following table shows the object properties of FB_XXXPA: Name Number Family Module FB_XXXPA Assigning block numbers with Parameter management the engineering tool. Area of application The block is used to request and provide parameter set data in the AS. Startup characteristics The "FB_XXXPA"...
  • Page 146: Generation

    Parameter management 6.1 FB_XXXPA 6.1.2 Generation For each parameter group created using the engineering tool in the "FB_PARAMGROUP" user archive, a block of the type "FB_XXXPA" is generated and saved in the master data library. The generated blocks are numbered consecutively. The block input and output parameters depend on the structure of the "FB_PARAMATTRIB_XXX"...
  • Page 147: Functions

    Parameter management 6.1 FB_XXXPA 6.1.3 Functions Overview The figure below gives an overview of how the "FB_XXXPA" block works: FB_XXXPA Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 148 Parameter management 6.1 FB_XXXPA Mode The "FB_XXXPA" block can operate in normal or in multiplexer mode. The mode is set at the "MODE" input parameter. ● In normal mode, the block performs the following functions: ● Reading a parameter data record from the parameter set archive and providing the data at the outputs ●...
  • Page 149 Parameter management 6.1 FB_XXXPA The properties specified using the APF Engineering Tool are saved in the "FB_PARAMATTRIB_XXX" user archive. The structure of this archive determines the input and output parameters of the corresponding "FB_XXXPA" block. The parameter set values to be normalized and recalculated and the reference quantity are defined with the process picture and saved in the "FB_PARAM_XXX"...
  • Page 150 Parameter management 6.1 FB_XXXPA the "Calculate" button is enabled in the process picture depends on the "CALOP_EN" parameter of the "FB_XXXPA" block. Recalculation is only performed when "CALOP_EN = 1". Individual parameters are only calculated with formats 0-5 (INTEGER and REAL). Once the write job has been processed, the "FB_UA_WM"...
  • Page 151: I/Os

    Parameter management 6.1 FB_XXXPA You can use the "ACK_DIS" block input to specify whether a confirmation button is to be displayed in the message box. The value of the "ACK_DIS" input is transferred in the block to the "DIS_ACK" output. Confirming with the button sets the in/out parameter "QMSBOACK".
  • Page 152 Parameter management 6.1 FB_XXXPA Parameter Description Type Default WinCC tag ACK_DIS Display of button for confirmation BOOL REL_EN Activates release BOOL RELOP_EN Activates operator release BOOL CALOP_EN Activates recalculation BOOL L_REL Automatic release BOOL L_CAL Triggers recalculation BOOL TIME_MON Monitoring time for read job REAL 30.0 IMP_T...
  • Page 153 Parameter management 6.1 FB_XXXPA Parameter Description Type Default WinCC tag QWM_ERR FB_UA_WM: 1 = Write error, requested data and BOOL written data do not match QWM_AERR FB_UA_WM: 1 = Archive error, invalid data in BOOL send buffer QWM_CERR FB_UA_WM: 1 = Communication error, error mes‐ BOOL sage from "BSEND"...
  • Page 154 Parameter management 6.1 FB_XXXPA Parameter Description Type Default WinCC tag QCH_DATB Read data: DWORD 16#59590000 Time of change part 2 QVAL_DAT Read data: DWORD 16#08123123 Validity time part 1 QVAL_DATB Read data: DWORD 16#59590000 Validity time part 2 QREL Read data: Permission BOOL QREL_DAT Read data:...
  • Page 155: Error Handling

    Parameter management 6.1 FB_XXXPA Parameter Description Type Default WinCC tag APF_OS APF function block version in OS WORD GEN_AS Generation information in AS DWORD GEN_OS Generation information in OS DWORD "x": WinCC tag available; "-": WinCC tag not available 6.1.5 Error handling Errors occurring in the block are signaled via an integrated "ALARM_8P"...
  • Page 156 Parameter management 6.1 FB_XXXPA The following messages can be output: Message Message class Event Message text SIG_1 AS process control Length of the read data does not match $$BlockComment$$ QLEN_ERR data the length of the block outputs block length of the receive data is not cor‐ Message - fault rect ID @4%d@ REC_ID @5%d@ ac‐...
  • Page 157: Fb_Pa_St

    Parameter management 6.2 FB_PA_ST FB_PA_ST 6.2.1 Description Object properties The following table shows the object properties of FB_PA_ST: Name Number Family Module FB_PA_ST FB1795 Parameter management Area of application The block is used for coding the structure UDT_PA_REQ_ST (QPA_REQ) and for decoding the structure UDT_PA_CON_ST (PA_CON).
  • Page 158: Functions

    Parameter management 6.2 FB_PA_ST 6.2.3 Functions Overview The block can be used to connect the inputs or the outputs of the FB_XXXPA block and has the following functionality: ● Combines individual inputs in the UDT_PA_REQ input structure of the FB_XXXPA block. This structure is used to transfer data and trigger reading of the parameter set data to FB_XXXPA.
  • Page 159: I/Os

    Parameter management 6.2 FB_PA_ST "Multiplexer mode" Together with a parameter set block in "Multiplexer mode" (see description of parameter set management), the FB_PA_ST block can be used to read parameter set data from other parameter set blocks and copy them to the associated parameter set block. The following links must be configured for this purpose: ●...
  • Page 160: C Functions For Normalization/Recalculation

    Parameter management 6.3 C functions for normalization/recalculation Parameter Description Type Default WinCC tag ARCH_NO Archive number DINT BA_NA Batch name STRING[32] BA_ID Batch ID DWORD SETPOINT Setpoint REAL PA_CON Feedback structure of the data request UDT_PA_CON_ST "x": WinCC tag available; "-": WinCC tag not available Output parameters The following table shows the output parameters of the "FB_PA_ST"...
  • Page 161 Parameter management 6.3 C functions for normalization/recalculation using the FB_XXXPA block (CFC connection or a button in the faceplate). This is done using either the L_CAL block input or the "Calculate" button in the faceplate. Whether or not this option is available depends on the CALOP_EN enable bit at the block. CALOP_EN shows and enables the button in the faceplate, and there is only a response to the L_REL input if CALOP_EN = 1.
  • Page 162: User Archives

    Parameter management 6.4 User archives Example The individual parameters to be normalized/recalculated with another formula can be adjusted either with the APF Engineering Tool or in the "FB_PARAMSTTRIB_XXX" archive. A unique number (>1) must be entered in the "NORM" column of the relevant individual parameters for this purpose.
  • Page 163 Parameter management 6.4 User archives The archive has the following structure: Element Description Format Position in the visualization order INTEGER 32 NAME Parameter name STRING[32] Unit of parameter STRING[16] FORMAT Format of parameter INTEGER 32 ENUM_MAT Coding/enumeration of parameter STRING[16] High limit of operator control for numerical values DOUBLE Low limit of operator control for numerical values...
  • Page 164: Fb_Param_Xxx

    Parameter management 6.4 User archives Integer value Format BOOL ENUMERATION MATERIAL Two additional values are available for the formats DATE, TIME and DATE AND TIME: Integer value Format German date format (DD.MM.YYYY) + time (hh:mm:ss) German date format (DD.MM.YYYY) + time (hh:mm) U.S.
  • Page 165: Fb_Param_Calc_Xxx

    Parameter management 6.4 User archives The archives are structured as follows: Element Description Format REC_ID Internal ID of the parameter set INTEGER 32 * NAME Name of the parameter set STRING 64 DESCR Description of the parameter set STRING 128 Unit of the parameter set STRING 16 NORMAMOUNT...
  • Page 166: Operator Control And Monitoring

    Parameter management 6.5 Operator control and monitoring Element Description Format VERSION Current version of the parameter set REAL CHANGEUSER Name of the operator who made the last STRING 32 change CHANGEDATE Date of the last change DATE VALIDDATE Date of validity DATE RELEASED Permission...
  • Page 167: Messages

    Parameter management 6.5 Operator control and monitoring Faceplates ● @PG_FB_XXXPA.PDL Faceplate for editing the data of the parameter set loaded to the AS. ● @FB_PARAM_WINDOW.PDL You can use this picture to edit the attribute parameters of the parameter sets. This picture is integrated as a window in the "@PG_FB_XXXPA"...
  • Page 168 Parameter management 6.5 Operator control and monitoring Message class Event Message text Operator message Save button @7%s@: Low limit @2%s@: new = @5%.4f@ @8%s@ old = @4%.4f@ @8%s@ parameter set group: @6%s@ Operator message Save button @7%s@: Parameter set limits @6%s@ changed OS process con‐...
  • Page 169 Parameter management 6.5 Operator control and monitoring Message associated Format Value value Message associated @4%s/d@ Old value (string or number) value 4 Message associated @5%s/d@ New value (string or number) value 5 Message associated @6%s@ Parameter set name + ID, here: Parameter set name (ID) value 6 Message associated @7%s@...
  • Page 170 Parameter management 6.5 Operator control and monitoring Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 171: Order Management

    Order management FB_JOB 7.1.1 Description Object properties The following table shows the object properties of FB_JOB: Name Number Family Module FB_JOB FB1785 Order management Area of application The "FB_JOB" block has the following functions: ● Managing of jobs (job data records) in a job list ●...
  • Page 172 Order management 7.1 FB_JOB AS communication Data exchange with the "FB_XXXPA" block on the AS level is performed via the "UDT_PA_REQ_ST" (request) and "UDT_PA_CON_ST" (feedback) structures. Up to 10 jobs can be managed in a job list. Each item in the job list is assigned an "FB_XXXPA" function block (normal mode) in the AS.
  • Page 173: Generation

    Order management 7.1 FB_JOB AS - OS communication For operator control and monitoring, signal exchange over the inputs/outputs of the "FB_JOB" takes place between the AS and the OS. ALARM_8P blocks are used to implement data communication for operational / fault messages. The scripts used in the OS are only for display / input / message control purposes in the faceplate.
  • Page 174: Functions

    Order management 7.1 FB_JOB 7.1.3 Functions Overview The figure below provides an overview of how the "FB_JOB" block works: FB_JOB FB_XXXPA FB_XXXPA FB_XXXPA Operating mode The mode is set using the "MODE" parameter: MODE Meaning Symbol Bit 1 Specifies the job name: DENOM_TITLE 0 = Automatic 1 = Manual...
  • Page 175 Order management 7.1 FB_JOB MODE Meaning Symbol Bit 8 1 = Automatic start if a job is available; CYCLE_AUTO_START "Activate job" automatically starts the jobs in the job list one after the other; even following an empty job list, the next job in the job list is automatically started again.
  • Page 176 Order management 7.1 FB_JOB Displaying mode / operating mode The status word "QSTATUS" is used to display the selected modes: QSTATUS SYMBOL Meaning Bit 0 EXTINT 0 = Internal mode, 1 = External mode Bit 1 MANAUT 0 = Manual mode 1 = Automatic mode Bit 2 LINKIT...
  • Page 177 Order management 7.1 FB_JOB Function releases The following outputs of the "FB_JOB" function block provide information on the function enables (1 = Enabled, 0 = Not enabled). Function Output Conditions "Start" RELSTART ● Job processing is not active ● Job available ●...
  • Page 178 Order management 7.1 FB_JOB The operator control enable signals are available at the corresponding block outputs. Function OP_EN Output Additional conditions "Start" Bit 0 EN_START ● "Manual" mode ● Job available ● Job released ● Job processing not started "Hold" Bit 1 EN_HOLD ●...
  • Page 179 Order management 7.1 FB_JOB Function OP_EN Output Additional conditions "Up" Bit 11 EN_POSUP ● "Internal" mode ● Job selected ● New position available "Down" EN_POSDO ● "Internal" mode ● Job selected in list ● New position available "Activate job" Bit 12 EN_TAOV "Internal"...
  • Page 180 Order management 7.1 FB_JOB Message box A message box with user-defined texts can be displayed in the faceplate. These texts can be created beforehand in multilingual format in the text library. The message box display is controlled using the "MSBO_ACT" (display) and "MSBO_NO" (text number) block inputs. Input Meaning MSBO_ACT...
  • Page 181 Order management 7.1 FB_JOB Creating a job In "External" mode, a job can be created using the following inputs. For a job to be successfully applied, it must have a name, an ID, a valid parameter set number and possibly also a setpoint (depending on whether or not it is a reference quantity).
  • Page 182 Order management 7.1 FB_JOB Selecting a job (sorting) In "External" mode, a job can be created using the following inputs of the "FB_JOB" block: EXT_IT Input Description EXT_SEL Selection of a job from the job list with the ID (DWORD) of the job EXT_POUP A positive edge moves the job selected at the "EXT_SEL"...
  • Page 183 Order management 7.1 FB_JOB Output Meaning ACT_DESC Description ACT_BDT1 ACT_BDT2 Time of creation ACT_ORIG Creator ACT_SDT1 ACT_SDT2 Start time ACT_STAT With bit 0 = 1 "reference quantity" ACTSTATE Bit 0 1 = An "FB_ERROR" (AS input) has occurred during job execution Bit 1 1 = A control system error has occurred during job execution Bit 5...
  • Page 184 Order management 7.1 FB_JOB Job list The data records of the jobs created are available at the following outputs for further processing: Output Meaning TIT_Pxx Job list item xx: Name ID_Pxx Job list item xx: ID PNO_Pxx Job list item xx: Parameter set number SP_Pxx Job list item xx: Setpoint DES_Pxx...
  • Page 185 Order management 7.1 FB_JOB Controlling a job In "Automatic" mode, a job can be controlled using the following inputs of the "FB_JOB" block: L_IT Input Description L_START Once a job has been activated, it is ready for starting in the job interface. Following a positive edge at the "L_START"...
  • Page 186 Order management 7.1 FB_JOB Control signals to/from the process There are two alternative interfaces for signal exchange with the process. If an SFC block (sequential control system) is being used for process control, the signals from the SFC are interconnected directly with "FB_JOB". The SFC interface is activated at the "EN_SFC" input of the "FB_JOB"...
  • Page 187 Order management 7.1 FB_JOB QJOBSTAT Symbol Meaning Bit 23 JOB_ACTIV 1 = Job running (not paused) Bit 25 START 1 = Job "start Bit 26 HOLD 1 = Job "hold" Bit 27 RESUM 1 = Job "resume" Bit 28 GO_END 1 = Job "end"...
  • Page 188: I/Os

    Order management 7.1 FB_JOB 7.1.4 I/Os Input parameters The following table shows the input parameters of the "FB_JOB" block: Parameter Description Type Default WinCC tag SAMPLE_T Sampling time [s] REAL RUNUPCYC Number of startup cycles NO_OF_PS Number of job data records (max. of 10) UNIT Plant unit STRING[24]...
  • Page 189 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag EDI_RCSP Create job internal: Setpoint REAL EDI_RCDS Create job internal: Description STRING[128] EDI_RCD1 Create job internal: Time of creation part 1 DWORD 16#08123123 EDI_RCD2 Create job internal: Time of creation part 2 DWORD 16#59590000 EDI_RCOR...
  • Page 190 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag EXT_ACJO External job list interconnected signals: BOOL Activate first job in job list EXT_POUP External job list interconnected signals: Move job BOOL with ID "EXT_SEL" up in the list EXT_PODO External job list interconnected signals: Move job BOOL with...
  • Page 191 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag IT_END Job control automatic IT signals: 1 = End BOOL IT_ABORT Job control automatic IT signals: 1 = Abort BOOL OP_EN Operator control enables buttons WORD 16#FFFF HIDE_BUT Display enables buttons WORD MODE Function mode...
  • Page 192 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag MSGSTAT5 ALARM_8P5: STATUS WORD MSG_ACK5 ALARM_8P5: ACK_STATE WORD MSGSTAT6 ALARM_8P6: STATUS WORD MSG_ACK6 ALARM_8P6: ACK_STATE WORD MSGSTAT7 ALARM_8P7: STATUS WORD MSG_ACK7 ALARM_8P7: ACK_STATE WORD QJOBSTAT Job status DWORD QSTATUS Status double word DWORD QERROR Error double word...
  • Page 193 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag QABORT Job control: Abort job = 1 BOOL SFC_START Job control, SFC signal "START" BOOL SFC_HOLD Job control, SFC signal "HOLD" BOOL SFC_RESUME Job control, SFC signal "RESUME" BOOL SFC_ABORT Job control, SFC signal "ABORT"...
  • Page 194 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag QSP_UOM Unit of measurement for the setpoint STRING[16] TIT_P01 Job list item 01: Name STRING[32] ID_P01 Job list item 01: ID DWORD PNO_P01 Job list item 01: Parameter set number DINT 16#0 SP_P01...
  • Page 195 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag PNO_P05 Job list item 05: Parameter set number DINT 16#0 SP_P05 Job list item 05: Setpoint REAL DES_P05 Job list item 05: Description STRING[128] BDT1_P05 Job list item 05: Time of creation part 1 DWORD 16#08123123 BDT2_P05...
  • Page 196 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag BDT1_P09 Job list item 09: Time of creation part 1 DWORD 16#08123123 BDT2_P09 Job list item 09: Time of creation part 2 DWORD 16#59590000 ORI_P09 Job list item 09: Creator STRING[32] STAT_P09 Job list item 09: Status data record...
  • Page 197 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag EN_POSUP Operator control enable: Up BOOL EN_POSDO Operator control enable: Down BOOL EN_NEW Operator control enable: Creating a job BOOL EN_DEL Operator control enable: Deleting a job BOOL EN_ACJO Operator control enable: Activating a job BOOL EN_TAOV Operator control enable: Apply...
  • Page 198 Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag QPA_07 Parameter set request for job with UDT_PA_REQ data record number 07 QPA_08 Parameter set request for job with UDT_PA_REQ data record number 08 QPA_09 Parameter set request for job with UDT_PA_REQ data record number 09 QPA_10...
  • Page 199: Error Handling

    Order management 7.1 FB_JOB Parameter Description Type Default WinCC tag AUX_PR10 ALARM_8P: external associated value SD_10 "x": WinCC tag available; "-": WinCC tag not available 7.1.5 Error handling Errors occurring in the block are signaled via integrated "ALARM_8P" blocks and displayed at the outputs of the block.
  • Page 200: Messaging

    Order management 7.1 FB_JOB 7.1.6 Messaging The "FB_JOB" block uses six "ALARM_8P" blocks to generate messages. Following CPU startup, messages are suppressed (QMSG_SUP = 1) until the "RUNUPCYC" cycles have elapsed. ALARM_8P_1 ALARM_8P_1 is used to output fault messages and free external messages: Message Message class Event...
  • Page 201 Order management 7.1 FB_JOB ALARM_8P_2 ALARM_8P_2 is used to output "operating messages" for the job list: Message Message class Event Message text SIG_1 Operating message – with‐ QMSG bit 8 "NEW" $$BlockComment$$ @4%6s@ job New process cell out acknowledgment ID@3%d@ parameter set @5%d@ setpoint @6%g@@8%s@ creator @9%s@ SIG_2 QMSG bit 9 "DEL"...
  • Page 202 Order management 7.1 FB_JOB ALARM_8P_3 ALARM_8P_3 is used to output "operating messages" for job control: Message Message class Event Message text SIG_1 Operating message – with‐ QMSG bit 0 $$BlockComment$$ @10%6s@ start out acknowledgment "START" ID@3%d@ parameter set @5%d@ setpoint @6%g@@8%s@ SIG_20 QMSG bit 1 "HOLD"...
  • Page 203 Order management 7.1 FB_JOB ALARM_8P_4 ALARM_8P_4 is used to output "operating messages" for job control: Message Message class Event Message text SIG_1 Operating message – with‐ State $$BlockComment$$ job active out acknowledgment Job active ID@3%d@ parameter set @5%d@ setpoint @6%g@@8%s@ actual @7%g@@8%s@ SIG_2 State $$BlockComment$$ job paused...
  • Page 204 Order management 7.1 FB_JOB Associated value Format Value SD_8 @8%s@ Unit of setpoint/actual value (UOM) SD_9 @9%s@ Creator SD_10 @10%s@ MAN or AUTO or IT ALARM_8P_5 ALARM_8P_5 is used to output "error messages" for job management: Message Message class Event Message text SIG_1 AS process control...
  • Page 205 Order management 7.1 FB_JOB Associated value Format Value SD_7 SD_8 SD_9 SD_10 ALARM_8P_6 ALARM_8P_6 is used to output "error messages" for job control: Message Message class Event Message text SIG_1 AS process control QERROR bit 16 $$BlockComment$$ @4%6s@ Message - fault "REQ_QERR"...
  • Page 206 Order management 7.1 FB_JOB The following associated values are used: Associated value Format Value SD_1 @1%s@ BA_NA SD_2 @2%d@ Parameter set number with "Cre‐ ate job" SD_3 @3%d@ ID with "Create job" SD_4 @4%s@ INT or EXT or IT SD_5 @5%d@ ID with "Activate job"...
  • Page 207: User Archives

    Order management 7.3 Operator control and monitoring Associated value Format Value SD_6 @6%d@ Parameter set number with "Ac‐ tivate job" SD_7 @7%d@ Active ID with "Activate job" SD_8 SD_9 SD_10 User archives The parameter management user archives are used to access the parameter sets. For more information, refer to the section Parameter management (Page 145).
  • Page 208: Picture Objects

    Order management 7.3 Operator control and monitoring 7.3.2 Picture objects The operation and monitoring of job management is performed in a faceplate that uses the following pictures for the various views: ● @PG_FB_JOB_STANDARD.PDL This picture is the operator control and monitoring interface for job control. In this picture, you select "Cyclic"...
  • Page 209: Messages

    Order management 7.3 Operator control and monitoring 7.3.3 Messages Operator messages The following messages can be output: Message Event Offset Message text class Operator Apply button INT job create new ID@4%d@ parameter set @9%s@ message setpoint @5%g@@8%s@ Delete button INT job delete ID@4%d@ parameter set @9%s@ set‐ point @5%g@@8%s@ Activate job button 2 INT job activate ID@4%d@ parameter set @9%s@ set‐...
  • Page 210 Order management 7.3 Operator control and monitoring Message associated value Format Value Message associated value 5 @5%g@ Setpoint Not used Message associated value 6 @6%@ Message associated value 7 @7%s@ Logged-on user Message associated value 8 @8%s@ Message associated value 9 @9%s@ Parameter set Message associated value 10...
  • Page 211: Archive Management

    Archive management FB_XXXA (FB_XXXAI, FB_XXXAR) 8.1.1 Description Object properties The following table shows the object properties of FB_XXXAD: Name Number Family Module FB_XXXA FB1793 Archive management Area of application The "FB_XXXA" block is used to archive data records from the AS. You can add new data records to the user archive and update or delete existing data records.
  • Page 212: Generation

    Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) 8.1.2 Generation Using the APF Engineering Tool, the following blocks are generated on the basis of the "FB_XXXA" (FB1793) block for each archive group created: Function block (FB) Number Function FB_XXXAI Specified by the "FB Number Creates, updates, and deletes archive (I)"...
  • Page 213 Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 214: Functions

    Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) 8.1.3 Functions Overview The figure below gives an overview of how the "FB_XXXA" block works: FB_XXXAI/AR Adding data Following a request by a positive edge at block input "WREC_INS", the system writes the block input values for archiving to the user archive on the basis of the archive name, archive number, etc.
  • Page 215 Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) The value "REC_ID" must be unique for each archive for its entire life cycle. In "Insert" mode, a new unique data record number REC_ID (REC_ID_MAX + 1) is automatically generated on the OS. This number is returned to the requesting block at the end of the write job by "FB_UA_WM"...
  • Page 216: I/Os

    Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) An error message is output after the last repetition. Exception: The job is not repeated after inserting (WREQ_INS). 8.1.4 I/Os Input parameters The following table shows the input parameters of the "FB_XXXA" block: Parameter Description Type Default...
  • Page 217 Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) Parameter Description Type Default WinCC tag VALUE7 Example: Archive value 7 DINT VALUE8 Example: Archive value 8 DINT VALUE9 Example: Archive value 9 DINT MSG_EVID ALARM_8P option: EV_ID DWORD "x": WinCC tag available; "-": WinCC tag not available; Output parameters The following table shows the output parameters of the "FB_XXXA"...
  • Page 218 Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) Parameter Description Type Default WinCC tag QIN_PROC Error: 1 = Action not possible because an action BOOL is already active (insert/update/delete) QREQ_WM Write job active BOOL WR_OK Data have been written BOOL W_REQ_ST Request structure to FB_UA_WM UDT_UA_W_ REQ_ST QREQ_ID...
  • Page 219: Error Handling

    Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) In/out parameters The following table shows the in/out parameters of the "FB_XXXA" block: Parameter Description Type Default WinCC tag APF_AS APF function block version in AS WORD APF_OS APF function block version in OS WORD GEN_AS Generation information in AS...
  • Page 220: Messaging

    Archive management 8.1 FB_XXXA (FB_XXXAI, FB_XXXAR) Archive errors In contrast to normal troubleshooting, a special error output and the setting of the "WR_OK" output indicate those errors occurring during operation which are not related to communication between FB_XXXA / FB_UA_WM / OS script. Error bit Output Meaning...
  • Page 221: C Functions For Export And Backup

    Archive management 8.2 C functions for export and backup Message Message class Event Message text SIG_7 AS process control More than one trigger in a cycle $$BlockComment$$ QREQ_ERR, more (WREC_INS / WREC_DEL / than one trigger of function active ID Message - fault WREC_UPD);...
  • Page 222: Data Export

    Archive management 8.2 C functions for export and backup The following C functions are used as a template and copied and adapted by the APF Engineering Tool: ● "FB_ARExportTrigger0.pas" Triggers export of the data according to the specified method ● "FB_ARBackupTriggerEN0.pas" Triggers data backup for the engineering/configuration data ●...
  • Page 223 Archive management 8.2 C functions for export and backup The various export methods are distinguished as follows, and are defined separately for each archive in the "EXPORT_METHOD" column of the "FB_ARCHGROUP" archive (numbers 1… 6 correspond to the export method): 1.
  • Page 224 Archive management 8.2 C functions for export and backup 5. Data management as circular archive – Data in the archive are not archived externally and are only available during runtime. – If the archive is full (data records in the archive >= FULL_NO_OF_REC), the C function "FB_ARExportTrigger0.pas"...
  • Page 225: Data Backup

    Archive management 8.2 C functions for export and backup REC_FINISHED = 1 Naming convention for the export files / backup files ● Export methods 1-4: <Year><Month><Day>_<Time>_<Archive name> Example: 091224_183059_Archiving_004 ● Data backup: sav_<Year><Month><Day>_<Time>_<Archive name> Example: sav_091224_183059_Archiving_004 Export file redundancy There are two backup paths (engineering tool) and two export paths (specified separately in the group archive for each group).
  • Page 226: User Archives

    Archive management 8.3 User archives User archives 8.3.1 FB_ ARCHGROUP The archive groups are defined in this user archive. The archive has the following structure: Element Description Format REC_ID Internal ID of the group INTEGER 32 NAME Name of the group STRING 32 DESCR Description of the storage location group STRING 128...
  • Page 227 Archive management 8.3 User archives Element Description Format Low limit of operator control for numeri‐ DOUBLE cal values DESCR Description of the parameter STRING 128 TXTLIB ID for multilingual management in the INTEGER 32 text library FCT_BLOCK_IO_NAME Name of the input in the corresponding STRING 20 function block VISIBLE...
  • Page 228 Archive management 8.3 User archives Integer value Format 32BITS (material type releases) 32BITS (static procedure enables from the Dairy Library) 32BITS (dynamic procedure enables from the Dairy Library) CONTENTS FORMAT (format-related value, can be modified) STORAGE STATE -> STRING 32 characters in archive MATERIAL STATE ->...
  • Page 229 Archive management 8.3 User archives STORAGE/MATERIAL/JOB STATE format The APF Engineering Tool creates the following user archives, where various job, storage and material states are saved: ● FB_JOB STATUS ● FB_STORAGE_STATUS ● FB_MATERIAL_STATUS The archives are structured as follows: Element Description Format REC_ID...
  • Page 230: Fb_Archiving_Xxx

    Archive management 8.3 User archives 8.3.3 FB_ARCHIVING_XXX Up to 2000 archive data records and their values are saved in each of the "FB_ARCHIVING_XXX" user archives. There are two types of archives when using the engineering tool. Depending on the type of archive group defined with the APF Engineering Tool and saved in the "FB_ARCHIVGROUP"...
  • Page 231: Fb_Job_Status, Fb_Storage_Status, Fb_Material_Status

    Archive management 8.3 User archives Element Description Format CHANGEDATE Date of the last change to parameter set DATE STATUS Status designation STRING 64 STATUS_ID ID of the status INTEGER 32 VALUE_<ioname> First value to be archived Depends on "FB_ARCHVAL‐ UE_XXX" archive ….
  • Page 232: Aenumeration (Name In Enum_Mat)

    Archive management 8.4 Operator control and monitoring 8.3.5 AENUMERATION (name in ENUM_MAT) The archives are structured as follows: Element Description Format REC_ID Internal ID INTEGER 32 NAME Name STRING 128 TXTLIB ID for multilingual management in the INTEGER 32 text library Operator control and monitoring There are no picture objects assigned to the "FB_XXXMA"...
  • Page 233 Archive management 8.4 Operator control and monitoring Message class Event Message text OS process control message Cyclic export action: The readout of the @7%s@: Project path could not be read. Cannot project path was incorrect. copy the export file OS process control message Cyclic export action: Directory 1 could @7%s@: Export directory 1 does not exist / could not be created not be created...
  • Page 234 Archive management 8.4 Operator control and monitoring Message associated value Format Value Message associated value 4 @4%d@ ID of the FB_UA_WM block Message associated value 5 @5%d@ ID of the FB_XXXAR / FB_XXXAI block Message associated value 6 @6%s@ Archive name / archive group + data record ID Message associated value 7 @7%s@ Logged-on user...
  • Page 235: Best Before / Utc Time Supply

    Best before / UTC time supply FB_BBD 9.1.1 Description Object properties The following table shows the object properties of the "FB_BBD" block: Name Number Family Module FB_BBD FB1794 Best before Area of application The block is used to generate and provide the date of birth (DOB) and best before date (BBD), and to supply the UTC time, local time (LOT) and modified Julian date (MJD).
  • Page 236: Functions

    Best before / UTC time supply 9.1 FB_BBD 9.1.2 Functions Overview The block executes the following functions: ● Generating and providing the date of birth (DOB) ● Generating and providing the best before date (BBD) ● Outputting UTC time, local time (LOT) and the modified Julian date (MJD) The date of birth and best before data are provided at the block outputs either cyclically or on request, depending on the mode.
  • Page 237 Best before / UTC time supply 9.1 FB_BBD Local time The local time is displayed at the QLOT_DT and QLOT_DTB outputs of the block. The local time is the UTC time adjusted for daylight saving time and time zone. The divergence between local time and UTC time due to the time zone is specified at the "LOT_DEV"...
  • Page 238: I/Os

    Best before / UTC time supply 9.1 FB_BBD Rounding DOB and BBD to full minutes, hours and days The date of birth / best before data can be rounded up to full minutes, hours or days. The rounding function is executed before the function for suppressing seconds, minutes and hours. ●...
  • Page 239: Error Handling

    Best before / UTC time supply 9.1 FB_BBD Output parameters The following table shows the output parameters of the "FB_BBD" block: Parameter Description Type Default QRUN_UP Status display startup active = 1 BOOL QNOT_OK Block flag "OK" not set, error = 1 BOOL QGR_ERR Function block group error/fault...
  • Page 240: User Archives

    Best before / UTC time supply 9.3 Operator control and monitoring User archives There is no access to user archives. Operator control and monitoring There are no picture objects assigned to the "FB_BBD" block. Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...
  • Page 241: Data Structures And Data Formats

    Data structures and data formats 10.1 UDT_UA_R_ST The "UDT_UA_R_ST" structure is used to provide the read data from the "FB_UA_RM" communication block. The structure is as follows: Parameter Description Type Default REQ_ID Repetition of request data: ID of the requesting block INT ARCH_NA Repetition of request data: Archive name STRING 16...
  • Page 242: Udt_Ua_R_Req_St

    Data structures and data formats 10.2 UDT_UA_R_REQ_ST Parameter Description Type Default QPARAMF 1 = parameter assignment error BOOL FALSE duplicate REQ_ID or incorrect ID_1, R_ID_1 or ID_2, R_ID_2 Feedback from status bit 1 - 11 on read job BOOL FALSE Application-specific value, written by OS script 10.2 UDT_UA_R_REQ_ST...
  • Page 243: Udt_Ua_W_St

    Data structures and data formats 10.3 UDT_UA_W_ST Parameter Description Type Default WM_ID ID of the FB_UA_WM, The ID is used in parameter management to recal‐ culate the parameters. DATA_EN Activation of the application-specific auxiliary data BOOL FALSE cell 0 = Not active 1 = Active, The data are entered in the communication inter‐...
  • Page 244: Udt_Ua_W_Req_St

    Data structures and data formats 10.4 UDT_UA_W_REQ_ST The structure is as follows: Parameter Description Type Default REQ_ID Repetition of request data: ID of the requesting block MODE Repetition of request data: Operating mode WORD W#16#0 ARCH_NA Repetition of request data: Archive name STRING 16 ARCH_NO Repetition of request data: Archive number...
  • Page 245 Data structures and data formats 10.4 UDT_UA_W_REQ_ST The structure is as follows: Parameter Description Type Default REQ_ID ID of the requesting block The ID must be unique. MODE Mode, evaluated by OS script: WORD W#16#0 e.g.: 1 = Create new data record 2 = Overwrite existing data record ARCH_NA Archive name...
  • Page 246: Udt_Alarm_St

    Data structures and data formats 10.5 UDT_ALARM_ST Parameter Description Type Default REQ_TYP Unique ID of a block type. BYTE B#16#0 Examples of block type IDs: FB_UA_RM FB_UA_WM FB_XXXMA FB_MLOT FB_STLOC FB_STMAT FB_STOR FB_ST_AC FB_SACT FB_XXXPA FB_JOB FB_000DP FB_000PG FB_000PH FB_DJOB FB_DS FB_DP FB_MP...
  • Page 247: Udt_Pa_Req_St

    Data structures and data formats 10.7 UDT_PA_CON_ST Parameter Description Type Default SD_5 Associated value 5 UDT_ANY_ST SD_6 Associated value 6 UDT_ANY_ST SD_7 Associated value 7 UDT_ANY_ST SD_8 Associated value 8 UDT_ANY_ST SD_9 Associated value 9 UDT_ANY_ST SD_10 Associated value 10 UDT_ANY_ST 10.6 UDT_PA_REQ_ST...
  • Page 248 Data structures and data formats 10.7 UDT_PA_CON_ST Parameter Description Type Default QPARAMF 1 = parameter assignment error BOOL FALSE - Duplicate REQ_ID - Incorrect ID_1, R_ID_1 or ID_2, R_ID_2 QLEN_ERR 1 = Read error BOOL FALSE - The data length of the requested data does not match that of the read data QARCHERR 1 = Archive error...
  • Page 249: Additional Information

    Additional information 11.1 Configuration file General system settings and module-specific system settings are saved in the "FB_Configuration.ini" file for all APF modules that access user archives. This file is located in the "\library\APF" subfolder of the project directory and must be available on and identical across all project computers.
  • Page 250: Storage At The Backup Path

    Additional information 11.2 Data backup of the user archives Examples of triggers The engineering tool generates the following three triggers for material master data when two material classes are defined: ● FB_MMBackupTriggerEN.pas Backs up the configuration/engineering archives FB_MATCLASS, FB_MATTYPE_001, FB_MATTYPE_002, FB_MATATTRIB_001, FB_MATATTRIB_002. ●...
  • Page 251: Data Backup Procedure

    Additional information 11.3 User archives 11.2.3 Data backup procedure Data backup has been implemented in an external program to minimize disruption to normal OS server operation. The program exports the content of the archive to a csv file and then copies this file to the two backup paths.
  • Page 252 Additional information 11.3 User archives Advanced Process Functions (APF) Function Manual, 07/2016, A5E38719883-AA...

Table of Contents