I have a Question about using WSTRING. How I can operate with WSTRING? I need to use Czech characters like “ěščřžýáíé”. I am not able to write any of these characters to watch (it’s just no typing).
AS 6.7:
Var def:
Watch:
MappView:
Var def in AS Code:
AS Code: Always bad
AS Code:
AS Code after reopen:
Var def in AS6.7: or
Watch:
MappView:
MappView: It’s for now only way, how to write it.
MappView:
Watch: - It’s showing correct!!!
Some tips, how to do it correctly? Using *.tmx files? I need it to use it also in ladder program.
If you use mappView, you should use tmx files.
tmx files are utf8 and you can watch the strings in mappView.
In the AS-watch the string is only visible after converting it to c null terminated string with functions from the AsHttp library (httpUtf8ToString()).
Ok. I solve MappView to use tmx files, so use string and ‘$$IAT/…’ and it’s PLC language independent
But it’s not solving using it in PLC program without MappView. I try “ArTextSysGetText”, but’s it’s not user friendly. I want some way, how to write in program/watch “ěščřžýáíé” without tmx and converting utf-8 to wstring in program.
i am not sure if i fully understand your question …
WSTRING is just a container for two-byte characters and doesn’t say anything about the character encoding inside.
So it’s up to the corresponding HMI, Browser, Client etc. what characters are shown.
Typicall today’s Software expects Unicode – Wikipedia or UTF-8 – Wikipedia.
You can see what’s inside a WSTRING by overlaying it by an UINT - array:
``` VAR unicode : REFERENCE TO ARRAY[0..19] OF UINT; MyWstring : WSTRING[80]; MyString : STRING[80]; END_VAR
```
I understand unicode, but I know the way, how to write it in code like var := "ěščřžýáíé" or in watch without $xxxx.
I try to copy string from watch and paste after and it’s break whole string. I have hope, that there is some way, how to do it, because the monitor show it correctly, but how do it in reverse.