krolikbest Posted September 26, 2022 Report Share Posted September 26, 2022 Hi, I'm sorry if such topic has already been covered but somehow I couldn't find it. So I need to read string column from data table into something like list of text, but according to help files that states: Quote Not all Data Types are supported: Unsupported types: Boolean, Byte, String, all 'Address of' types. Supported Data Types: Integer (16-bit), Long, Float, Timer (32 bit) I'm not sure if this is possible. If yes, could I ask for a link to this topic? Regards, Martin Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted September 26, 2022 MVP 2022 Report Share Posted September 26, 2022 4 hours ago, krolikbest said: I need to read string column from data table into something like list of text Normally, string data is stored in a vector of MIs, 2 characters per MI. You can easily read string data from a Data Table to an MI vector, but I don't think it's possible to directly transfer that data to a List of Texts HMI element. If there is some roundabout way to do this I'd love to know it. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted September 26, 2022 MVP 2022 Report Share Posted September 26, 2022 Sample code maybe useful C:\......................\Unitronics\Unitronics VisiLogic_C65\Examples\Version 900\Project examples\HMI V1210_display_DT_on_HMI.vlp Quote Link to comment Share on other sites More sharing options...
Fernando Castro Posted September 26, 2022 Report Share Posted September 26, 2022 5 hours ago, Flex727 said: Normally, string data is stored in a vector of MIs, 2 characters per MI. You can easily read string data from a Data Table to an MI vector, but I don't think it's possible to directly transfer that data to a List of Texts HMI element. If there is some roundabout way to do this I'd love to know it. Yes, you can. there is a workaround for that that I found using the string library: you store the strings on a data table load strings in the Data table to the desired MI using the data table read function. Set up String Library (String Storage 1 row 5 or whatever ) with variables pointing to the MIs where the string is stored. From the List of Text HMI element selects the string from String Library. That's all. Although depending on the application using String Storage instead of the Data table may be a better solution, I used the above because I set it up a list of descriptions and names that needs to be able to be updated, so it can not be a hard coded string. 2 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted September 26, 2022 MVP 2022 Report Share Posted September 26, 2022 9 minutes ago, Fernando Castro said: Yes, you can. there is a workaround for that that I found using the string library: you store the strings on a data table load strings in the Data table to the desired MI using the data table read function. Set up String Library (String Storage 1 row 5 or whatever ) with variables pointing to the MIs where the string is stored. From the List of Text HMI element selects the string from String Library. That's all. Although depending on the application using String Storage instead of the Data table may be a better solution, I used the above because I set it up a list of descriptions and names that needs to be able to be updated, so it can not be a hard coded string. Nice! Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted October 5, 2022 MVP 2022 Report Share Posted October 5, 2022 On 9/26/2022 at 1:40 PM, Fernando Castro said: Yes, you can. there is a workaround for that that I found using the string library: you store the strings on a data table load strings in the Data table to the desired MI using the data table read function. Set up String Library (String Storage 1 row 5 or whatever ) with variables pointing to the MIs where the string is stored. From the List of Text HMI element selects the string from String Library. That's all. @Fernando Castro, thank you for this. I suddenly had a pressing need for this strategy on my current project and it worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.