Configuring WinCC User Archive Read and Write Managers in SIMATIC PCS 7 APF: Connection ID Parameterization
In SIMATIC PCS 7 Advanced Process Functions (APF), configuring the User Archive Read Manager (FB_UA_RM) and Write Manager (FB_UA_WM) requires coordinating the S7 connection parameter ID with the channel identifier R_ID. The parameter ID must match the exact hexadecimal connection ID defined in NetPro for the S7 connection between the Automation Station and the WinCC OS application. Every manager block sharing the same connection must be assigned a unique R_ID (1 to 65535) to multiplex transactions. In addition, parameter UA_NO must match the target User Archive ID, and the data buffer DB must be sized to accommodate the complete archive field structure.
Table of Contents
- Architecture of User Archive Manager Blocks (FB_UA_RM / FB_UA_WM)
- NetPro S7 Connection Configuration and Hexadecimal ID Assignment
- Multiplexing Transactions via the R_ID Channel Identifier
- Data Buffer Data Block (DB) Structuring and Length Alignment
- Comparative Parameter Schedule: FB_UA_RM vs FB_UA_WM Configuration
- Step-by-Step Commissioning and Error Handling Workflow
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of User Archive Manager Blocks (FB_UA_RM / FB_UA_WM)
SIMATIC PCS 7 Advanced Process Functions (APF) delivers standardized technological modules for material management, recipe execution, and tracking in process manufacturing. The core interface bridging the PLC runtime program with the WinCC SQL database consists of two standard function blocks:
FB_UA_RM(User Archive Read Manager - FB1102): Reads complete data records (or single fields) from a WinCC User Archive table and populates an S7 Data Block (DB) in the controller.FB_UA_WM(User Archive Write Manager - FB1101): Takes process data, actual batch quantities, and material IDs from an S7 Data Block and writes or updates records in the WinCC User Archive table.
Both blocks execute asynchronous data transfers using the underlying system communication blocks BSEND and BRCV. Proper parameterization of connection pointers is mandatory to prevent communication deadlocks.
NetPro S7 Connection Configuration and Hexadecimal ID Assignment
The parameter ID on both FB_UA_RM and FB_UA_WM specifies the logical communication link between the AS and the OS:
- Configuring in NetPro: In NetPro, select the CPU and insert a new connection to the WinCC Application. The connection type must be S7 Connection (or S7 Named Connection in PCS 7 multiprojects).
- The Hexadecimal Connection ID: Open the connection properties dialog in NetPro. Note the value displayed in the field 'Block parameters: Local ID' (for example,
W#16#0001or16#000A). - Assigning in CFC: In the Continuous Function Chart, set the input parameter
IDofFB_UA_RMandFB_UA_WMto this exact hexadecimal value (16#0001). IfIDis parameterized with an invalid or un-downloaded connection number, the block immediately halts with errorQBS1_ERR = 1.
Multiplexing Transactions via the R_ID Channel Identifier
Because an automated plant may contain dozens of silos, material transfer lines, and dosing stations, multiple Read and Write managers frequently communicate across a single shared S7 connection:
- Role of
R_ID: The input parameterR_ID(DWORD) defines the unique transaction channel identifier for that specific block instance. - Strict Uniqueness Rule: Every instance of
FB_UA_RMandFB_UA_WMsharing the same connectionIDmust have a uniqueR_ID(e.g.,R_ID = DW#16#00000001for Silo 1 Write,DW#16#00000002for Silo 1 Read,DW#16#00000003for Silo 2 Write). - Telegram Collision: If two blocks share identical
IDandR_IDparameters, incomingBRCVtelegrams cannot be demultiplexed, causing corrupt buffer overwrites and communication timeouts.
Data Buffer Data Block (DB) Structuring and Length Alignment
Data read from or written to the User Archive is staged in a dedicated S7 Data Block:
- Archive Number (
UA_NO): ParameterUA_NO(INT) must match the numeric ID assigned to the target User Archive table in WinCC User Archive Editor (e.g., Archive ID1for Material Master,2for Silo Inventory). - Data Buffer Pointer (
ANYPointer): Input parameterDB_NOandDB_OFF(orANY_DATA) points to the memory area where records are mapped. - Byte-Length Alignment: The byte size of the S7 Data Block structure must match the field definitions in WinCC User Archive exactly. If the User Archive contains 5 fields totaling 64 bytes, but the S7 Data Block only allocates 48 bytes, the read/write transaction fails with length mismatch error
QERR_LEN = 1.
Comparative Parameter Schedule: FB_UA_RM vs FB_UA_WM Configuration
The following table summarizes the mandatory block parameters across both managers:
ID16#0001)R_IDDW#16#00000001)UA_NOFIELD_NO0 = Entire record; >0 = Specific field ID)REC_NODB_NODB_OFFSTARTQBUSY1 while asynchronous transaction is in progressQERR1 if transaction aborted with errorStep-by-Step Commissioning and Error Handling Workflow
Follow this sequence to commission APF User Archive communication:
- Configure NetPro S7 Connection: Insert an S7 connection between AS and WinCC OS. Download connection tables to AS and compile NetPro.
- Build Staging Data Block: Create an S7 DB matching the User Archive field schema (matching INT, REAL, STRING, and BYTE datatypes).
- Parameterize CFC Blocks: On
FB_UA_WM, setID, uniqueR_ID,UA_NO,DB_NO, andDB_OFF. - Trigger Transaction: Set
REC_NO = 1, populate data in the DB, and generate a positive edge pulse on inputSTART. - Monitor Outputs: Verify that
QBUSYtransitions to1and then returns to0withQERR = 0andQDONE = 1. - If
QERR = 1, inspect diagnostic outputQSTATUSto identify the specific error code (e.g. invalid connection ID, timeout, or archive lock).
Verification
Confirm that APF User Archive transactions execute reliably:
- Trigger a write transaction from
FB_UA_WMby pulsingSTART. - Open WinCC User Archive Control in WinCC Runtime; confirm that the target record row updates immediately with the newly transmitted values.
- Modify a value in the User Archive row from the WinCC faceplate.
- Trigger a read transaction on
FB_UA_RM; confirm in S7 DB monitoring that the modified value is transferred into controller RAM. - Verify that
QBS1_ERRremains0across repeated cyclic operations.
Limitations and Operational Precautions
Adhere to the following operational precautions:
- Never Pulse START While QBUSY is True: The manager blocks execute asynchronous multi-cycle transactions; pulsing
STARTwhileQBUSY == 1aborts the active transaction and corrupts SQL communication buffers. - User Archive Concurrency Locks: WinCC User Archives locks records during active SQL updates; ensure multiple PLCs do not attempt to write the same
REC_NOsimultaneously. - SCL Source Integrity: Do not modify internal APF manager block logic; use wrapper charts if custom signal pre-processing is required.
Engineer FAQ
Can FB_UA_RM read a single field from a User Archive record instead of the whole row?
Yes. By setting parameter FIELD_NO to a specific field number (>0), the block reads only that individual field into the staging buffer.
How do I know when an APF read or write transaction has finished?
Monitor output QBUSY. While QBUSY is 1, the transaction is executing. When QBUSY returns to 0, QDONE = 1 indicates success and QERR = 1 indicates failure.
What happens if the communication cable is unplugged during an APF User Archive transaction?
The block attempts communication retries until internal BSEND/BRCV timeouts expire, then sets QBS1_ERR = 1 and QERR = 1 with a timeout diagnostic code.
Technical References
- SIMATIC PCS 7 Advanced Process Functions (APF) Manual (Entry ID: 109746516)
- WinCC V7.3 / V7.4 System Manual: User Archives (Entry ID: 109746517)
- SIMATIC Process Control System PCS 7 Engineering System Manual (Entry ID: 109746514)
- Siemens Industry Online Support (SIOS) APF Programming Guide (Entry ID: 109740190)
Related Articles
- Simulating SIMATIC PCS 7 Advanced Process Functions (APF) with S7-PLCSIM
- Configuring WinCC User Archive Control Column Persistence and User Authorization
- SIMIT Simulation with S7-PLCSIM Advanced: HWCN-Export and Signal Mapping
Related Tags
- Advanced Process Functions (APF)
- FB_UA_RM Read Manager
- FB_UA_WM Write Manager
- User Archives
- NetPro Connection ID
- R_ID Channel Identifier