Last active
January 3, 2021 21:53
-
-
Save nikvoronin/b93b4b448e699798a4e390f53857f878 to your computer and use it in GitHub Desktop.
Testing of the TwinCAT3 POU FB_FileLoad from Tc2_System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM MAIN | |
VAR | |
START: BOOL; | |
FileLoad: FB_FileLoad; | |
bigBuf: ARRAY[0..35000000] OF BYTE; | |
timeCounter: UDINT; | |
GetRouterStatusInfo: FB_GetRouterStatusInfo; | |
RouterStatusInfo: ST_TcRouterStatusInfo; | |
END_VAR | |
VAR CONSTANT | |
BIG_FILENAME: STRING := '/Hard Disk/NK.BIN'; // ~32.7Mb | |
END_VAR | |
FileLoad.sPathName := BIG_FILENAME; | |
FileLoad.pReadBuff := ADR(bigBuf); | |
FileLoad.cbReadLen := SIZEOF(bigBuf); | |
FileLoad.tTimeout := T#1H; | |
FileLoad(sNetId:= '', bExecute:= START); | |
IF FileLoad.bBusy THEN | |
timeCounter := timeCounter + 1; | |
ELSE | |
START := FALSE; | |
END_IF | |
GetRouterStatusInfo(sNetId:= '', bExecute:= TRUE); | |
IF NOT GetRouterStatusInfo.bBusy THEN | |
GetRouterStatusInfo(sNetId:= '', bExecute:= FALSE); | |
RouterStatusInfo := GetRouterStatusInfo.info; | |
END_IF | |
END_PROGRAM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment