Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
Error Writing a string value -> Write failed. Reason: BadWriteNotSupported
I do not fully understand your problem report, but it seems to me that the server is likely rejecting the value you are attempting to write. Although the data type of the variable is String, it does not mean that the server has to accept any string you write to it. From the node name, one can guess that is something more like a number. Isn't it simply that the values like "ABC123", which you have shown, is not the right syntax? Would "123" work?
Do I understand it correctly that you get this error not just with the software written with QuickOPC, but also with other clients?
Regards
Please Log in or Create an account to join the conversation.
- albi.majun.1960@gmail.com
-
Topic Author
- Offline
- Premium Member
-
- Posts: 14
- Thank you received: 1
in the menatime I did a search on documentation finding the following link:
opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...mps%20and%20status%20code.html
Applied and tested :
Private Sub Command1_Click()
Screen.MousePointer = vbHourglass
Rem This example shows how to write data (a value, timestamps and status code)
Rem into a single attribute of a node.
'Public Sub Write_Main_Command_Click()
OutputText = ""
Const GoodOrSuccess = 0
' Instantiate the client object
Dim Client As New EasyUAClient
' Modify data of a node's attribute
Dim StatusCode As New UAStatusCode
StatusCode.Severity = GoodOrSuccess
Dim AttributeData As New UAAttributeData
AttributeData.SetValue 12345
Set AttributeData.StatusCode = StatusCode
AttributeData.SourceTimestamp = Now()
' Perform the operation
On Error Resume Next
Call Client.Write(txtServer.Text, txtNodeId.Text, AttributeData)
' or "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
If Err.Number <> 0 Then
risp = MsgBox(OutputText & "*** Failure: " & Err.Source & ": " & Err.Description & vbCrLf, vbCritical)
Exit Sub
Else
risp = MsgBox("Scrittura eseguita...", vbInformation)
End If
On Error GoTo 0
'End Sub
Screen.MousePointer = Default
End Sub
but unsuccessfully: see attachment "Error_2021.12.07@11.35.05.jpg"
Where I'm wrong, again ?
Thanks+BR
Alberto
Please Log in or Create an account to join the conversation.
- albi.majun.1960@gmail.com
-
Topic Author
- Offline
- Premium Member
-
- Posts: 14
- Thank you received: 1
I'm getting this error in subject simpling writing a string in a field (string), see attachment "Write failed. Reason BadWriteNotSupported_2021.12.07@10.12.37.jpg"
Instruction is quite simple:
server$ = Trim(txtServer.Text)
nodo$ = Trim(txtNodeId.Text)
cosa$ = "ABC12345/2021"
Call Client.WriteValue(server$, nodo$, cosa$)
If Err.Number <> 0 Then
'txtResult.Text = ("WriteResult= ") & Err.Number & " - " & Err.Description
List1.AddItem ("Errore WriteResult ")
List1.AddItem (Err.Number)
List1.AddItem (Err.Description)
List1.AddItem ("
")
valore = Client.ReadValue(txtServer.Text, "ns=2;s=CurrentJobs.CurrentJob1.Order.OrderDataControl.SAPNumberResponse")
List1.AddItem (" >>> Response ")
List1.AddItem "SapNumberRequest" & valore
Else
valore1 = Client.ReadValue(txtServer.Text, "ns=2;s=CurrentJobs.CurrentJob1.Order.OrderDataControl.SAPNumberRequest")
valore2 = Client.ReadValue(txtServer.Text, "ns=2;s=CurrentJobs.CurrentJob1.Order.OrderDataControl.SAPNumberResponse")
List1.AddItem (" >>> Read response : ")
List1.AddItem (valore1)
List1.AddItem (valore2)
End If
I was able to do the same action in the same field on july 2021, see attachment for positive results:
WriteSapField_Request_OPC-UA-Client_2021.07.17@10.59.13.jpg
WriteSapField_ Response_OPC-UA-Client_2021.07.17@10.58.59.jpg
WriteSapField_WithOPCLabsSDK_2021.07.17@11.03.14.jpg
WriteSapField_ MachineHDMI_2021-07-17 at 11.10.37.jpeg
What I noticed is that
SourceTimeStamp and ServerTimeStamp values are aligned so 17/07/2021 11:53:xx
Instead today, as you can see from attachment "Write failed. Reason BadWriteNotSupported_2021.12.07@10.12.37.jpg"
SourceTimeStamp 18/11/2021 and ServerTimeStamp 07/12/2021 values are NOT aligned.
I did some search before opening this new topic, also in this Forum, and this error seems to be common an honestly I don't know how hot to fix it with
Which sequence of command have I to perform to fix the issue and to be able to write correcly such a SAP field
Any suggestion is welcome, thanks
BR
Alberto
Please Log in or Create an account to join the conversation.