Return the properties of a specified file on the SD card
This FP instruction returns the properties of the file on the SD card specified by s_FullFileName and stores the result in d_dutStatus.
Input
File name
Output
Contains the file properties
The SD memory access active flag (sys_bIsSDMemoryAccessActive) turns to TRUE after the trigger EN of the SD card instruction has turned to TRUE and remains TRUE until execution has completed. During this time, other SD card instructions cannot be executed.
The SD memory access done flag (sys_blsSDMemoryAccessDone) is FALSE when the instruction is executed and turns to TRUE and remains TRUE when the instruction is completed.
FALSE: when the instruction has completed without error
TRUE: when the instruction has completed with an error
Use sys_iSDMemoryAccessErrorCode to evaluate the error code.
All input and output variables used for programming this function have been declared in the POU header.The same POU header is used for all programming languages.
VAR
bStart: BOOL:=FALSE;
(*activates the instruction*)
dutFileStatus: FP_SD_FILE_STATUS_DUT;
END_VAR
When the variable bStart changes from FALSE to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 4 ;
NETWORK_BODY
B(B_F,FP_SD_GET_FILE_STATUS!,,20,0,33,4,,?DEN?Ds_FullFileName?AENO?Cd_dutStatus);
B(B_CONTACT,,bStart,3,1,5,3,R);
B(B_CONTACT,,sys_bIsSDMemoryAccessActive,11,1,13,3,N);
B(B_VARIN,,'\Test\TestString1.csv',18,2,20,4,);
B(B_VAROUT,,dutFileStatus,33,2,35,4,);
L(1,2,3,2);
L(13,2,20,2);
L(5,2,11,2);
L(1,0,1,4);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF DF(bStart)AND not sys_bIsSDMemoryAccessActive then
FP_SD_GET_FILE_STATUS(s_FullFileName := '\Test\TestString1.csv', d_dutStatus => dutFileStatus);
END_IF;