diff --git a/examples/opcua/opcuaviewer/main.py b/examples/opcua/opcuaviewer/main.py
index 6935c43c9..4a6ec7bc9 100644
--- a/examples/opcua/opcuaviewer/main.py
+++ b/examples/opcua/opcuaviewer/main.py
@@ -8,12 +8,16 @@ import sys
 from mainwindow import MainWindow
 from PySide6.QtCore import QCoreApplication
 from PySide6.QtWidgets import QApplication
-
+import os
 
 if __name__ == '__main__':
+    os.environ["QT_FORCE_STDERR_LOGGING"] = '1'
+    os.environ['QT_DEBUG_PLUGINS'] = '1'
+    os.environ["QT_LOGGING_RULES"] = "qt.opcua.debug=true"
     app = QApplication(sys.argv)
+
     QCoreApplication.setApplicationName('Qt for Python OpcUa Viewer')
-    initial_url = sys.argv[1] if len(sys.argv) > 1 else 'opc.tcp://localhost:48010'
+    initial_url = sys.argv[1] if len(sys.argv) > 1 else 'opc.tcp://localhost:4840'
     main_win = MainWindow(initial_url)
     main_win.show()
     sys.exit(app.exec())
diff --git a/examples/opcua/opcuaviewer/mainwindow.py b/examples/opcua/opcuaviewer/mainwindow.py
index 921a82898..819326c4b 100644
--- a/examples/opcua/opcuaviewer/mainwindow.py
+++ b/examples/opcua/opcuaviewer/mainwindow.py
@@ -1,3 +1,4 @@
+
 # Copyright (C) 2021 The Qt Company Ltd.
 # Copyright (C) 2018 Unified Automation GmbH
 # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
@@ -5,11 +6,14 @@
 import os
 from pathlib import Path
 from textwrap import dedent
+from typing import List
 
 from ui_mainwindow import Ui_MainWindow
 from opcuamodel import OpcUaModel
 from certificatedialog import CertificateDialog
 from helpdialog import HelpDialog
+from PySide6.QtOpcUa import QOpcUaWriteItem, QOpcUaWriteResult
+from PySide6.QtCore import Signal
 
 from PySide6.QtCore import (QCoreApplication, QDir, qDebug, QMetaObject,
                             Qt, QtMsgType, Slot, QUrl, qInstallMessageHandler,
@@ -63,6 +67,9 @@ def _messageHandler(msg_type, context, message):
 
 class MainWindow(QMainWindow):
 
+
+    writeNodeAttributesFinished = Signal(list)  # Added
+
     def __init__(self, initial_url, parent=None):
         global _main_window
 
@@ -135,6 +142,8 @@ class MainWindow(QMainWindow):
         if not self._opcua_client:
             client_name = self._ui.opcUaPlugin.currentText()
             self._opcua_client = self.mOpcUaProvider.createClient(client_name)
+            self._opcua_client.writeNodeAttributesFinished.connect(self.onWriteNodeAttributesFinished) # Added
+
         if not self._opcua_client:
             message = "Connecting to the given server failed. See the log for details."
             self.log(message, "", Qt.red)
@@ -224,6 +233,7 @@ class MainWindow(QMainWindow):
 
         self._opcua_client.namespaceArrayUpdated.connect(self.namespacesArrayUpdated)
         self._opcua_client.updateNamespaceArray()
+        self.onWriteNodeAttributes() # Added
 
     @Slot()
     def clientDisconnected(self):
@@ -352,3 +362,59 @@ class MainWindow(QMainWindow):
     def showHelpDialog(self):
         dialog = HelpDialog(self)
         dialog.exec()
+
+
+    # Added
+    def onWriteNodeAttributes(self):
+        # test code
+
+        batch = []
+        batch.append(
+            QOpcUaWriteItem(
+                "ns=6;s=S7-1500ET200MP-Station_1.PLC.DataRecipe.process.recipe.recipe[0].name",
+                QOpcUa.NodeAttribute.Value,
+                "test1 string test string",
+                QOpcUa.Types.String
+                )
+            )
+        batch.append(
+            QOpcUaWriteItem(
+                "ns=6;s=S7-1500ET200MP-Station_1.PLC.DataRecipe.process.recipe.recipe[0].qualified",
+                QOpcUa.NodeAttribute.Value,
+                False,
+                QOpcUa.Types.Boolean
+                )
+            )
+        j = 0
+        for i in batch:
+            print(j)
+            print(i.nodeId())
+            print(i.value())
+            print(i.attribute())
+
+            print(i.type())
+            print(i.statusCode())
+            print(i.sourceTimestamp())
+            j += 1
+
+        if not self._opcua_client.writeNodeAttributes(batch):
+            print("onWriteNodeAttributes: writing failed")
+            return False
+        return True
+
+    # Added
+    @Slot(list, QOpcUa.UaStatusCode)
+    def onWriteNodeAttributesFinished(self, results, serviceResult):
+        """Handle write node attributes finished event.
+
+        Args:
+            results (list): List of write results.
+            serviceResult (QOpcUa.UaStatusCode): Status code of the operation.
+        """
+        print("inside onWriteNodeAttributesFinished()")
+        # print(results)
+        print(serviceResult)
+
+        print("write node attributes finished, state: {}".format(
+        QOpcUa.statusToString(serviceResult)))
+        self.writeNodeAttributesFinished.emit(results)
