plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang, Jim" <>
Subject OPCUA Write
Date Thu, 11 Mar 2021 14:20:53 GMT
Hi PLC4X team,

When I use PLC4X's OPCUA protocol to write PLC, I always get ACCESS_DENIED for the PLC's tag
(Reading is OK.)
I list my code and message I get below in FYI: sections.
How can I get rid of this issue?


FYI: my codes
       public static void WritePLC(PlcConnection plcConnection) throws InterruptedException,
Exception, TimeoutException {
              PlcWriteRequest.Builder builder = plcConnection.writeRequestBuilder();
              builder.addItem("S7PLC.CureAbort", "ns=2;s= S7PLC.CureAbort:BOOL", true);
              PlcWriteRequest writeRequest =;
              PlcWriteResponse response = writeRequest.execute().get();
              for (String fieldName : response.getFieldNames()) {
                  if(response.getResponseCode(fieldName) == PlcResponseCode.OK) {
                     System.out.println("Value[" + fieldName + "]: updated");
                  else {
                     System.out.println("Error[" + fieldName + "]: " + response.getResponseCode(fieldName).name());

FYI: the message when I run my codees
[main] INFO - Instantiating new PLC Driver Manager
with class loader jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951<mailto:jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951>
[main] INFO - Registering available drivers...
[main] INFO - Registering driver for Protocol s7 (Siemens
S7 (Basic))
[main] INFO - Registering driver for Protocol opcua
[main] INFO - Configured OpcuaTcpPlcConnection
with: host-name
[NonceUtilSecureRandom] INFO org.eclipse.milo.opcua.stack.core.util.NonceUtil - SecureRandom
seeded in 0ms.
[main] INFO org.eclipse.milo.opcua.sdk.client.OpcUaClient - Eclipse Milo OPC UA Stack version:
[main] INFO org.eclipse.milo.opcua.sdk.client.OpcUaClient - Eclipse Milo OPC UA Client SDK
version: 0.5.3
Find West on Twitter <!/WestPharma> and LinkedIn<>.

The contents of this message are confidential and may be privileged. If you have received
this message in error, please permanently delete it, along with any files that may be attached
to this message, without reading, printing, copying, forwarding or otherwise distributing
it. Please notify the sender of the error immediately so that we can prevent it from happening

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message