writevalues using the legacy java stack|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
writevalues using the legacy java stack
Avatar
Georges ATTALI
New Member
Members
Forum Posts: 1
Member Since:
08/19/2020
sp_UserOfflineSmall Offline
1
08/19/2020 - 03:10
sp_Permalink sp_Print

Hello,

I would like to write values to my OPCUA server from client, but I don't understand well the use of RequestHeader and its authenticationToken. 

I haven't been able to find examples in Java. 

The code I wrote until now is : 

  public EnvoyerValeursACapsem (WriteValue[] tWriteValue) {
    // comment renseigner AuthenticationToken ???
    // NodeId authenticationToken = Identifiers.RootFolder;
    NodeId authenticationToken = null;
 
    RequestHeader requestHeader 
      = new RequestHeader(authenticationToken   // NodeId AuthenticationToken
                                         , null                // DateTime Timestamp
                                         , null                // UnsignedInteger RequestHandle
                                         , null                // UnsignedInteger ReturnDiagnostics
                                         , null                // String AuditEntryId
                                         , null                // UnsignedInteger TimeoutHint
                                         , null);              // ExtensionObject AdditionalHeader
 
    WriteRequest  writeRequest  = new WriteRequest(requestHeader, tWriteValue);
    try {
      WriteResponse response = mSession.Write(writeRequest);
    }
    catch (Exception e) {
        // manage exception ...
    }   

 

Help please !
Is that correct ? What should I use as authenticationToken  ?

Many Thanks.
Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 32
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855