-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write String and WString not working #26
Comments
Are you using the tag classes for writing, PlcTagWString / PlcTagString? The constructor has an additional parameter, where you have to pass the string max.-length. By default it's 254, this is the length if you define a WString or a String without a specified length. |
Hello, no, I just used it like this: public void WriteStringVar(String SymAdress, string val) But there is just the used Stringdata in the buffer (Stringlength + chars). I changed it now to the PlcTagString method you suggested and this is working. Thanks a lot! |
The PlcTag classes are a layer above the ReadValues / WriteValues methods, as for some Plc datatypes you need informations of how to process the read data, and how to write the data in advance from the browsed informations. As you have seen for example in strings, they are transmitted as an array of byte (String) or ushort (WString). |
Thank you for that information. |
Hello!
First of all thank you for your outstanding work, this is a really great project. I ran some tests with a CPU 1510SP-1 and I encountered some problems with writing strings. Reading is ok, for all other datatypes that I've tried writing is also ok just strings and wstrings are
always giving me errors (S7CommPlusConnection - WriteValues: Write with errors. ReturnValue=2318368645692325907).
Thanks
The text was updated successfully, but these errors were encountered: