Tooltip and textlist

galexis
2020-08-12
2020-08-17
  • galexis - 2020-08-12

    Hi,
    I would like to generate by code text of tooltip on webvisu (information wich appear when mouse is on element).
    tooltip have to be composed like:
    fixed text + text1 from textlist 1 + fixed text + text2 from textlist2

    I want to create function block to do that a lot of time on webvisu with 2 entries:
    - id of text1 (INT)
    - id if text2 (INT)
    and the result was the text to display on tooltip.

    Could you help me to do that?

     
  • galexis - 2020-08-17

    I created a function block, all on Tooltip variable:
    FUNCTION BLOCK Tooltip_Information : STRING (255);
    VAR_INPUT
    id1: UNIT;
    id2: UNIT;
    END_VAR
    VAR
    sTextId : STRING;
    sTextList : STRING;
    temp1: STRING;
    temp2: STRING;
    END_VAR

    sTextList := 'my_list_1';
    sTextId := UINT_TO_STRING(id1);
    temp1:= VisuElems.cmpDynamictext.DynamicTextGetDefaultText (ADR(sTextList), ADR(sTextId))^;

    sTextList := 'my_list_2';
    sTextId := UINT_TO_STRING(id2);
    temp2:= VisuElems.cmpDynamictext.DynamicTextGetDefaultText (ADR(sTextList), ADR(sTextId))^;

    Tooltip_Information:=CONCAT(STR1:='fixed_text1', STR2:=temp1);
    Tooltip_Information:=CONCAT(STR1:=Tooltip_Information, STR2:='fixed_text2');
    Tooltip_Information:=CONCAT(STR1:=Tooltip_Information, STR2:=temp2);

    It work fimaximum number of character on tooltip element ?

     

Log in to post a comment.