Comments (2)
The constructor you're using for DataValue takes a value and uses
StatusCode.GOOD by default. If I remember correctly, the Beckhoff servers
are very picky about allowing writes that include a StatusCode. Try
building your DataValue using the full 4-argument constructor but supplying
null values for everything but the value argument.
On Sunday, October 2, 2016, tosuns [email protected] wrote:
After a while I started again with the evaluation of this library. My
previous issue seems to be resolved.
But now when I try to change a value on the Beckhoff-OPCUA-Server it fails
with the message Bad_WriteNotSupported, even if the variable is set to
readable and writable. I tried the Beckhoff OPCUA-Client and the write
operation worked fine and I'm able to read the value of the variable with
the milo opcua client (read-operation works fine, but not the write
operation).The Test-case in the milo project works fine too. So I'm not sure what
could actually be the cause for this issue.My Test-case looks as follows:
`Test
public void lowlevelTest() throws InterruptedException,
ExecutionException {final OpcUaClient opcUaclient = UaTcpStackClient.getEndpoints("opc.tcp://localhost:4840") .thenApply(endPoints -> { EndpointDescription endpoint = Arrays.stream(endPoints) .filter(e -> e.getSecurityPolicyUri().equals(SecurityPolicy.None.getSecurityPolicyUri())) .findFirst() .orElseThrow(() -> new RuntimeException("no desired endpoints return from the opcua server!")); OpcUaClientConfig clientConfig = OpcUaClientConfig.builder() .setApplicationName(LocalizedText.english("test opcua client")) .setApplicationUri("urn:test:opcua:client") .setEndpoint(endpoint) .setRequestTimeout(uint(60000)) .setExecutor(Executors.newCachedThreadPool()) .build(); return new OpcUaClient(clientConfig); }) .get(); final NodeId nodeId = new NodeId(7, "GlobalData.AirConditioning.Config.T_on"); final DataValue before = opcUaclient.readValue(0, TimestampsToReturn.Both, nodeId) .get(); System.out.println(MessageFormat.format("before write value: {0}", before)); final StatusCode statusCode = opcUaclient.writeValue(nodeId, new DataValue(new Variant(32f))).get(); Assert.assertTrue(statusCode.toString(), statusCode.isGood()); final DataValue after = opcUaclient.readValue(0, TimestampsToReturn.Both, nodeId) .get(); System.out.println(MessageFormat.format("after write value: {0}", after)); Assert.assertThat(after.getValue().getValue(), not(is(before.getValue().getValue())));
}`
The assertion regarding the StatusCode fails.
java.lang.AssertionError: StatusCode{name=Bad_WriteNotSupported,
value=0x80730000, quality=bad}
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.assertTrue(Assert.java:43)
at com.milo.opcua.MiloOpcUaClientNGTest.lowlevelTest(
MiloOpcUaClientNGTest.java:151)I'm testing the most recent master branch.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#57, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAUxMRHDZSZQHAonYjmy2N_ol7HRThKpks5qv6_ZgaJpZM4KMAnI
.
from milo.
Thanks, that worked 👍
from milo.
Related Issues (20)
- opcua monitors disconnection attempts several times? HOT 2
- ChunkDecoder doesn't handle sequence number wrapping
- ChunkEncoder wraps sequence number too early
- Missing Constraint when using as bundle in OSGi context
- Client stack - Reconnection does not restart subscriptions properly HOT 6
- The server has reached its maximum number of sessions HOT 1
- Error when connect to OPC UA server with long URL? HOT 1
- package not found [org.opcfoundation.opcua.binaryschema] HOT 2
- When subscribed to data changes and then read a value from the OPC-UA server, it will continue to receive subscribed data even if its value has not changed HOT 1
- The connection to S7 1500 gets interrupted while the connection to S7 1200 does not. HOT 1
- Get Bad_ArgumentsMissing instead of Bad_TooManyArguments HOT 1
- cant't write a Long value to opc-ua(the data type is UInt32) HOT 1
- Force TCP reconnect after SessionFsm keep-alive failure HOT 2
- Security upgrade to netty-4.1.105.Final
- CertificateValidationUtil issuer certificate KeyUsage checks
- How to read CustomStructType? HOT 1
- Remove dependency on lombok
- milo version 0.6.11 monitors the approximate limit of the number of PLC points HOT 1
- URI Reading Error HOT 8
- Port forwarding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from milo.