Professional OPC
Development Tools

logos

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

More
08 Dec 2021 08:04 #10437 by support
Hello.

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.

More
07 Dec 2021 10:39 #10433 by albi.majun.1960@gmail.com
Hello Support,

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 "This email address is being protected from spambots. You need JavaScript enabled to view it."

Where I'm wrong, again ?

Thanks+BR
Alberto
Attachments:

Please Log in or Create an account to join the conversation.

More
07 Dec 2021 09:54 #10432 by albi.majun.1960@gmail.com
Hello support,

I'm getting this error in subject simpling writing a string in a field (string), see attachment "Write failed. Reason This email address is being protected from spambots. You need JavaScript enabled to view it."
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:

This email address is being protected from spambots. You need JavaScript enabled to view it.
WriteSapField_ This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
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 This email address is being protected from spambots. You need JavaScript enabled to view it."
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.

Moderators: support
Time to create page: 0.052 seconds