Is there a way to assign a string variable with the contents of a string from the GlobalTextList?
Also of import, when it assigns the variable from the GlobalTextList it uses the correct language from the GlobalTextList.
Do you want to get from static dynamic text list a string in ST?
This function will do it:
FUNCTION F_GetText : STRING
VAR_INPUT
sTextList : STRING;
sId : STRING;
END_VAR
sTextList := CONCAT('Port_851.',sTextList);
F_GetText := VisuElems.CmpDynamicText.DynamicTextGetText(
pstTextList:= ADR(sTextList),
pstTextIndex:= ADR(sId)
)^;
If its a static text, give as argument the number as STRING
If you are using TwinCAT this approach needs the license of HMI. Other option is though ADS and an external program to do the job.
Related post:
Codesys 3. How to get the translations from static or dinamic text file in ST?