IBH OPC UA:S7-1200/1500 optimized data blocks

From IBHsoftec Wiki English
Revision as of 15:12, 5 August 2026 by Axel (talk | contribs) (Explained S7-1200/1500 access and optimized data blocks using the Web Configurator image)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The IBH OPC UA Server/Client can read symbolic variables online from an S7-1200 or S7-1500. This also makes optimized data blocks available in the OPC UA address space without maintaining fixed absolute byte offsets.

Requirements

  • The S7-1200 or S7-1500 is reachable over Ethernet.
  • The current TIA Portal project is fully compiled and downloaded to the CPU.
  • Symbolic names and data blocks in the CPU match the project version.
  • CPU protection and access settings permit authorized online access.
  • Credentials are available when the CPU is protected.
  • The IBH OPC UA Server/Client license is valid.

Web Configurator view

Open S7-1200/1500 in the Web Configurator.

Symbolically read S7-1200 and S7-1500 variables. The example shows global and instance data blocks together with their OPC access attributes.

The image shows two controllers read online. The detected CPU order number and firmware version are displayed below each controller.

The variable tree is divided into the following areas:

GlobalVars
Global CPU areas such as inputs, outputs, memory, timers and counters.
Programs
Programs and data blocks available in the CPU.
DataBlocksGlobal
Global data blocks containing scalar variables, arrays, structures and user-defined data types.
DataBlocksInstance
Instance data blocks belonging to function blocks. They are shown separately from global DBs.

The tree uses the symbolic names stored in the CPU. For optimized data blocks, the server uses this symbolic information; the application does not need to maintain absolute offsets.

Add a controller and read variables

  1. Select Insert PLC.
  2. Enter a unique PLC name.
  3. Enter the CPU's Ethernet address.
  4. Select a timeout appropriate for the network.
  5. For a protected CPU, enter the required credentials.
  6. Confirm the dialog. The server connects and reads the online tags.
  7. Expand the CPU, Programs, DataBlocksGlobal or DataBlocksInstance.
  8. Verify that the expected blocks, structures and variables are present.
  9. Activate the configuration with Apply.

Reading the online tags can take some time depending on the project size, CPU and network. Do not interrupt the CPU connection during this operation.

Meaning of the OPC columns

Column Value 1 Value 0
Visible in OPC The node is published in the OPC UA address space. The node is hidden from the OPC UA address space.
Accessible in OPC An OPC UA client may access the value. Access to the value is blocked at the OPC layer.
Write protection in OPC The value is exposed as read-only by the OPC UA server. Writing is permitted at the OPC layer, provided that CPU protection and user permissions also allow it.

An empty field means that no separate value is displayed for the node. Check the setting of the parent data block or structure.

In the image, EvData1 and EvData2 have:

  • Visible in OPC = 1
  • Accessible in OPC = 1
  • Write protection in OPC = 0

Both variables therefore appear in the OPC UA address space and can be accessed. They are not write-protected at the OPC layer. Whether a write succeeds also depends on CPU protection levels, variable properties and OPC UA user permissions.

Configure visibility and access rights

Expose only the variables that OPC UA applications require.

  • Select a structure or data block to apply consistent settings where appropriate.
  • Disable Visible in OPC when the node must not appear in the address space.
  • Disable Accessible in OPC when the node belongs to the structure but its value must not be accessed.
  • Enable Write protection in OPC when clients may only read the value.
  • Select Apply to activate pending changes.

Permissions on parent structures and data blocks can affect child elements. Review critical variables individually.

Changes to the TIA Portal project

After changing data blocks, structures, data types or symbolic names:

  1. Compile the TIA Portal project completely.
  2. Download the changes to the correct CPU.
  3. Select the controller in the Web Configurator.
  4. Select Refresh PLC.
  5. Review the variable tree and OPC attributes.
  6. Select Apply.
  7. Browse again from OPC UA clients if the address space has changed.

Refresh PLC replaces the previously read online tags with the current CPU state. Pay particular attention to deleted or renamed variables.

Functional test with an OPC UA client

  1. Connect to the IBH OPC UA Server/Client endpoint.
  2. Verify the server certificate and security policy.
  3. Open the S7-1200 or S7-1500 station in the address space.
  4. Select a global or instance data block.
  5. Read test variables and check their status codes and timestamps.
  6. Write only to variables explicitly intended for writing.
  7. Verify the new value online in TIA Portal.

Buttons shown in the image

Insert PLC
Creates a new online connection to an S7-1200 or S7-1500.
Modify PLC
Changes the connection parameters of the selected controller.
Remove PLC
Removes the selected controller from the configuration.
Refresh PLC
Reads the CPU, programs, data blocks and symbolic tags online again.
Apply
Activates pending configuration changes.
Remove all
Removes all configured S7-1200/1500 controllers. Create a backup before using this function.

Troubleshooting

Controller not reachable
Check the IP address, subnet, CPU state, network path and firewall.
Access denied
Check the CPU protection level, user or password, and permitted communication access.
Secure connection initialization failed
Check the CPU certificate, system time, firmware and security settings.
A data block or variable is missing
Compile and download the project, then select Refresh PLC.
A variable is visible but cannot be read
Check Accessible in OPC, CPU protection and OPC UA user permissions.
A write is rejected
Check Write protection in OPC, CPU access protection, data type, variable properties and user permissions.

See also