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.

String sending issue

More
22 Jun 2022 15:34 - 22 Jun 2022 15:35 #11002 by support
Replied by support on topic String sending issue
OPC UA uses UTF-8 to encode the strings. This means that "é" , which is Unicode U+00E9, gets encoded as two bytes, \xc3\xa9 .
If it became "é", it is probably these two bytes interpreted on the PLC in some other encoding - which would be a server bug.

Which encoding have you used when making up the byte array?

Regards
Last edit: 22 Jun 2022 15:35 by support.

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

More
22 Jun 2022 15:22 #11001 by CHRDEI
Replied by CHRDEI on topic String sending issue
Thank you for your fast reply.
I have fixed the problem by sending the string as a byte array.

It seems to work, tks again.

Best regards

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

More
21 Jun 2022 07:05 #10998 by support
Replied by support on topic String sending issue
Hello. I have some questions.

1. How do you observe the result of the Write? Is it through some other UA client, or something on the PLC or attached device, or how?
2. Have you tried the same using some other OPC UA client, and what were the results?
3. What makes you think this is a client issue?

If we do not find an answer by other means, the way to go would be to use WireShark to monitor the communication, and analyze whether the data is properly encoded or not.

It should be noted that we do not officially support QuickOPC old versions; but there were no changes that I recall in this area, so I do not expect any differences in behavior compared to the current version.

Best regards

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

More
20 Jun 2022 06:57 - 20 Jun 2022 10:47 #10997 by CHRDEI
String sending issue was created by CHRDEI
Good morning,
I am using "QuickOPC-2019.2-Windows-Production" and I find out a problem with string sending when the string is compoused by special character.
In the details, client is a C# .NET program (2022) and the server is a Schneider PLC.
All is working well, but if a string is compoused by character as "à" or "ç" (typical of Italian or French language) the string is not properly transferred.

e.g.:
Instead of 'modalità' the string received by the PLC is 'modalitÃ'
Instead of 'les axes ne sont pas alimentés' the string received by the PLC is 'les axes ne sont pas alimentés'


Maybe I need to use a different method or a different declaration... Below the code I am using:
public bool SendStringAllarm(string StrToSend)
        {
 
                try
                {
 
                    if (StrToSend.Length >= 256)
                        StrToSend.Substring(0, 256);
 
                    _Client.WriteValue(_EndPoint[0], "nsu=OpcUaServer;ns=2;s=Application.GVL_MacManage.HTP_LastAll", StrToSend);
 
                    return true;
                }
                catch
                {
                    return false;
                }
            }
            else
                return true;
        }
Where I have declared these objects:
privtate EasyUAClient _Client = new EasyUAClient();
private UADiscoveryElementCollection _EndPoint = _Client.DiscoverLocalEndpoints("opc.tcp://192.168.250.1");


Thanks in advance, I kindly wait for your reply.
best regards
Last edit: 20 Jun 2022 10:47 by support. Reason: code formatting

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

Moderators: support
Time to create page: 0.048 seconds