Snap7 RDREC: Troubleshooting Direct S7-1200 Record Access

David Krause2 min read
S7-1200SiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Define the Access Requirement

The requested operation is an RDREC instruction, identified in the available evidence as SFB 52/SFC 59, targeting a Siemens S7-1200. The required records are selected by ID and index, and the engineer has already determined that the desired data does not appear accessible through an SZL read.

The evidence does not identify a Snap7 function that directly executes RDREC or exposes the same record-access path. Therefore, do not assume that an SZL read is interchangeable with RDREC, and do not assign an undocumented Snap7 call to this task.

Choose the Supported Data Path

Path Evidence-based assessment Decision
Read an SZL through Snap7 The required IDs and indexes do not appear accessible through the SZL path. Reject this path for the requested records unless testing proves otherwise.
Execute RDREC directly through Snap7 No direct Snap7 mechanism is established by the supplied evidence. Require library documentation or a verified test before using this design.
Execute RDREC in the PLC and expose the result in a DB This is the explicit fallback identified in the evidence. Use this path when direct library support cannot be demonstrated.

Implement and Verify the PLC-Side Fallback

  1. Execute RDREC in the S7-1200 program using the required ID and index.
  2. Store the returned record in a DB that Snap7 can read.
  3. Read that DB through Snap7 after the PLC-side operation completes.
  4. Verify that the returned DB content corresponds to the requested ID and index. Also confirm that the application does not consume stale DB content from an earlier request.

This arrangement separates the two responsibilities: the PLC performs the extended instruction, while Snap7 retrieves ordinary DB data. The evidence provides no timing, status-code, buffer-size, or synchronization details, so define and validate those items in the PLC/application interface rather than assigning unsupported values.

FAQ

Can Snap7 directly execute RDREC on an S7-1200?

The supplied evidence does not establish a Snap7 call that directly executes RDREC. Confirm direct support in the library documentation or use a verified test before relying on that architecture.

Can an SZL read replace SFB 52/SFC 59 RDREC?

Not for the records described here: the required IDs and indexes do not appear accessible through the SZL path. Treat SZL and RDREC as separate access paths unless testing proves equivalence for the specific record.

What is the practical Snap7 workaround for RDREC?

Execute RDREC in the S7-1200, copy the result into a DB, and read that DB with Snap7. Verify that each DB result belongs to the requested ID and index before using it.

Back to blog