[Development] Writing to upc ua server with QOpcUaNode::writeAttributeRange

Jannis Völker jannis.voelker at basyskom.com
Tue Jul 28 17:18:10 CEST 2020


Hello,


this mailing list is for topics around the development of Qt itself, https://lists.qt-project.org/listinfo/interest is the list for questions regarding the usage of Qt.


According to Part 4, 5.10.4.2 of the OPC UA specification, the status code returned by the write operation is used if the server does not support writing the index range for the node.
Are there already values on the server for the range you are trying to write? Usually, servers fail to update a range if there is no previous value for one or more elements.


If you were just trying to write the entire array, use writeAttribute() with a QVariantList.

Best regards
Jannis


 From:   "AGAYEV, LEVON" <levon.agayev at g-mail.fr> 
 To:   <development at qt-project.org> 
 Sent:   28.07.2020 16:41 
 Subject:   [Development] Writing to upc ua server with QOpcUaNode::writeAttributeRange 


Hello,
I apologise for my bad english in advance..

After searching for a while and not finding any solution i have to bother you here.



I am trying to read and write to an array of doubles in my opcua server.
Reading works good but I have troubles with the use of  QOpcUaNode::writeAttributeRange methode.


this is what i try 
QList<QVariant> myList;
   for(int i=0;i<10;i++){
      myList.append(static_cast<double>(i));
     }
// QVariant myList("0,1,2,3,4,5,6,7,8,9");  
m_listNode->writeAttributeRange(QOpcUa::NodeAttribute::Value, myList, "0:9", QOpcUa::Types::Double);


In my slot connected to  QOpcUaNode::attributeWritten  signal i get  this status
"BadWriteNotSupported" 
Can someone please tell me what could cause this issue ? 


I use Qt 5.15 and mingw81_64  on windows10
my server is an opcua server embedded in Beckhoffs Twincat 3 running on the same pc


Thank you very much in advance 
Best regards
Levon





 



 

_______________________________________________
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200728/8856421c/attachment.html>


More information about the Development mailing list