CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sat Dec 15, 2018 7:30 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Nov 13, 2014 3:40 pm 
Offline

Joined: Tue Oct 14, 2014 1:38 pm
Posts: 8
Hello!
Does anybody have an IDEA how could I retrieve text from TextList in my programm?
I have a list, for example:
0:a
2:b
54:c

i saw function DynamicTextGetText, but I have no idea how to use it. It always returns '';
Thank you!


Top
   
PostPosted: Tue Nov 18, 2014 7:21 am 
Offline

Joined: Tue Oct 14, 2014 1:38 pm
Posts: 8
up


Top
   
PostPosted: Tue Nov 18, 2014 7:33 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Tue Jun 06, 2006 9:03 am
Posts: 406
It returns nothing if no language has been selected yet.
If you want to get the "default" text, then use:
Code:
VisuElems.cmpDynamictext.DynamicTextGetDefaultText(ADR(sTextList), ADR(sTextListID))^


If the user has selected a language, or if this is set in the application you can use:
Code:
VisuElems.cmpDynamictext.DynamicTextGetText(ADR(sTextList), ADR(sTextListID))^


What you can do is remember the latest selected language and load that at the start of the application.
Code:
// At start-up: initialise the actual language with the last selected language
IF xInit THEN
   visuElems.CURRENTLANGUAGE := gvlPersistent.sSelectedLanguage;
   xInit := FALSE;
END_IF

// Remember the selected language (if it is changed it needs to be activated again during start-up)
gvlPersistent.sSelectedLanguage := visuElems.CURRENTLANGUAGE;


Top
   
PostPosted: Tue Dec 02, 2014 1:59 pm 
Offline

Joined: Tue Oct 14, 2014 1:38 pm
Posts: 8
Thank you for your response!


Top
   
PostPosted: Wed Nov 11, 2015 11:13 am 
Offline

Joined: Fri Aug 28, 2015 11:12 am
Posts: 1
Does somebody have an programing example, how to use DynamicTextGetText, because it dont Work for me.


Top
   
PostPosted: Wed Nov 11, 2015 2:57 pm 
Offline

Joined: Fri Aug 07, 2015 9:59 pm
Posts: 57
Try this one


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Feb 16, 2018 1:59 pm 
Offline

Joined: Fri Jan 05, 2018 9:38 am
Posts: 6
Does anybody know, if it's possible to retrieve Text from enums with textlist Support? The data is also saved as .txt file, but in UTF-8 which doesn't work with "DynamicTextGetText" etc..


Top
   
PostPosted: Sat Feb 17, 2018 6:24 am 
Offline
Frequent User
Frequent User

Joined: Thu Mar 17, 2016 1:24 pm
Posts: 113
lst_tech wrote:
Does anybody know, if it's possible to retrieve Text from enums with textlist Support? The data is also saved as .txt file, but in UTF-8 which doesn't work with "DynamicTextGetText" etc..


Did you try to use "DynamicTextGetTextW"?


Top
   
PostPosted: Wed Feb 21, 2018 10:40 am 
Offline

Joined: Fri Jan 05, 2018 9:38 am
Posts: 6
Yes, I tried this one. The Problem is, that the file coding differs from "normal" text list (utf-8 / ANSI).
It seems that UTF-8 isn't working with DynamicTextGet... My solution is to read it manually with FileOpen/FileGets (According to the CSV reader example).

Thanks for your support


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited