Dear, The blog, 'How to use the SQLite in a PLCNext C++ project ', showed us a new way to use database. The test was done successfully. But I have a question, how to use the string varible in the PLCNext C++ project. I defined several data type, such as array of unit16 and array of unit8, can be used to transfer the string in ASCII, but there is a need to write new function block to reassembly the string. Is there any suggestion to use the string variable? Thank you.
Hello, I guess that you would like to define a GDS port of type ‘string’ in your C++ program. You may have seen in this recent thread that it is currently not possible to do this: https://www.plcnext-community.net/index.php?option=com_easydiscuss&view;=post&id;=1681&Itemid;=221⟨=en#reply-1696 … and the only possibility (currently) is to transfer a string as an array of bytes, which you seem to be doing already. I will try to find the current status of this feature, and I will post an update when I know more. - Martin.
Hello Martin. Is there any update for this topic.
I mean if I can define a GDS port of type “string” in my C++ project. Thank you. Mauro
Hello Mauro, Yes, it has always been possible to declare port variables of type StaticString in C++. What is new, since PLCnext Engineer version 2020.0, is that those GDS port variables can now be connected to matching String port variables in PLCnext Engineer. That solves the issue mentioned in the original post. Hope this helps. ~ Martin.