[r907]: / branches / develop / mqttsparkplug / mqttsparkplug / Sparkplug™ MQTT edge and host / Function Blocks / FB_MetricFileTransfer / FB_MetricFileTransfer / ReturnFileName / svnobj  Maximize  Restore  History

Download this file

18 lines (17 with data), 2.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
PT := ADR(FileName);
l := stu.StrLenW(FileName);
SLASH_CNT := 0;
FOR pos := 1 TO l DO
	IF pt^ = GC_sparkplug.FW_SLASH THEN 
        SLASH_CNT := SLASH_CNT + 1; 
    END_IF;
    PT := PT + 1;
END_FOR;
RightMostAfterLastSlash := l - SLASH_CNT;
    FileName : T_MaxString; // File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/)
END_VAR
VAR
    SLASH_CNT : UINT;
    l: DINT;
	pt : POINTER TO WSTRING;
	pos: DINT;