Hi Jim,

nvm i over read the part with "Reading was OK" :D


Am Do., 11. März 2021 um 16:21 Uhr schrieb Matthias Milan Strljic <
[email protected]>:

> Hi Jim,
>
> an addition to what Ben wrote. Make sure that you wrote the symbol of a
> Siemens value correct. Some versions of Siemens TIA Variable mappings
> require the ["]-Symbol included. So your path could also be required to
> escape those.
> In your case this could be something like:
> builder.addItem("S7PLC.CureAbort", "ns=2;s=\"S7PLC\".CureAbort:BOOL", true);
> As far as i worked with it correlates with the structure of your project
> and your modularization in Components and FunctionBlocks but this is not
> consistent over all used PLC or Sinumerik Controls.
>
> Greetings Matthias
>
>
> Am Do., 11. März 2021 um 15:29 Uhr schrieb Wang, Jim <
> [email protected]>:
>
>> 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?
>> Thanks,
>>
>> Jim
>>
>>
>> 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 = builder.build();
>>               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
>> ======================================
>> opcua:tcp://localhost:49601/
>> [main] INFO org.apache.plc4x.java.PlcDriverManager - Instantiating new
>> PLC Driver Manager with class loader
>> jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951<mailto:
>> jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951>
>> [main] INFO org.apache.plc4x.java.PlcDriverManager - Registering
>> available drivers...
>> [main] INFO org.apache.plc4x.java.PlcDriverManager - Registering driver
>> for Protocol s7 (Siemens S7 (Basic))
>> [main] INFO org.apache.plc4x.java.PlcDriverManager - Registering driver
>> for Protocol opcua (OPC UA (TCP))
>> [main] INFO org.apache.plc4x.java.opcua.connection.OpcuaTcpPlcConnection
>> - Configured OpcuaTcpPlcConnection with: host-name 127.0.0.1
>> [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: 0.5.3
>> [main] INFO org.eclipse.milo.opcua.sdk.client.OpcUaClient - Eclipse Milo
>> OPC UA Client SDK version: 0.5.3
>> Error[S7PLC.CureAbort]: ACCESS_DENIED
>> Find West on Twitter <http://twitter.com/#!/WestPharma> and LinkedIn<
>> http://www.linkedin.com/company/west-pharmaceutical-services?trk=fc_badge
>> >.
>>
>> ________________________________
>> 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 again.
>>
>>

Reply via email to