-
Notifications
You must be signed in to change notification settings - Fork 646
Add char support #175
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
Add char support #175
Conversation
Fixed bug regarding size calculation of small S7 Structs
…d fixed an issue regarding the start adress of arrays (those are always an even number in S7 structs)
|
Dear @Buchter, Sorry for this late response to your contribution. Can you explain what the goal is of this change? The char type in .NET is 16 bits (See I don't want to merge this change as-is, since it would block proper implementation of UTF-16 strings (which are supported on S7-1500). Please let me know if you have a different perspective on this. Also, I'd be happy to assist in finding a different solution to solve your problem if you so desire. |
|
Hello @mycroes , thanks for your response. The background is, I've written a parser that creates .NET classes from SCL sources of S7 Data Blocks and then use them with the I totally understand your point and think that in my case the solution could be to pass the information of the actual type as a property comment by the parser. Nevertheless, there is still the issue that arrays in S7 Data Blocks always start at an even adress what needs to be considered when calculating the class size. I know I shouldn't have included both changes in one commit in the frist place. I'm still new to GitHub, so I need some advice. Shall I create an other commit removing the switch case for |
|
Hi @Buchter, Please do that in a new PR. You can easily do that by resetting to S7NetPlus/develop, then create a new branch from there (fix-struct-field-offset) and then cherry-pick the commit that fixes the offset calculation. I must say though, that the even byte offset doesn't only apply to arrays. However, I'll be happy to merge a change that fixes that part. I don't use this functionality myself (honestly I'm not a real S7NetPlus user at all, I have a competing library that I use), so it's good to get fixes from someone that actually makes use of this functionality. |
|
Closed because Char support should probably use UTF-16 strings as stated before. Array offsets are fixed in #279. |
Added read and write support for .NET datatype Char (and therefore also Arrays of char) to Types.Class and fixed an issue regarding the start adress of arrays (those are always an even number in S7 structs)