SysExceptGenerateException (FUN) ¶ FUNCTION SysExceptGenerateException : RTS_IEC_RESULT <description>Interrupt the execution of the currently running task, and set the application into an exception state. If the runtime system supports it, CODESYS may even highlight the source position where this function was called.</description> <result><p>RESULT: If succeeded this function doesn’t return at all, otherwise it returns ERR_FAILED.</p></result> InOut: Scope Name Type Return SysExceptGenerateException RTS_IEC_RESULT Input udiException UDINT
SysFileGetName2 (FUN) ¶ FUNCTION SysFileGetName2 : POINTER TO STRING Get the file name from file specified by handle InOut: Scope Name Type Comment Return SysFileGetName2 POINTER TO STRING File name of the specified file Input hFile RTS_IEC_HANDLE Handle of the file pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileGetPath (FUN) ¶ FUNCTION SysFileGetPath : RTS_IEC_RESULT Get the path of this file. If a path is specified in the filename, the path will be extracted from the filename. If no path is specified in the filename, the standard path for this file extension type will be returned. InOut: Scope Name Type Comment Return SysFileGetPath RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input szFileName STRING File name. Can contain an absolute or relative path Inout szPath STRING Path for this file Input diMaxLen DINT Maximum size in bytes of path length
SysFileGetSize (FUN) ¶ FUNCTION SysFileGetSize : __XWORD Get file size of the file specified by name. A standard path will be added to the filename, if no path is specified. InOut: Scope Name Type Comment Return SysFileGetSize __XWORD Size of the file in bytes Input szFileName STRING File name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library): ERR_OK: Successful ERR_NO_OBJECT: File not available ERR_FAILED: Failed to get file size
SysFileGetPos (FUN) ¶ FUNCTION SysFileGetPos : RTS_IEC_RESULT Get actual file pointer position InOut: Scope Name Type Comment Return SysFileGetPos RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input hFile RTS_IEC_HANDLE Handle of the file pulPos POINTER TO __XWORD Pointer to get actual position of the file pointer from the beginning of the file
SysFileGetSizeByHandle (FUN) ¶ FUNCTION SysFileGetSizeByHandle : __XWORD Get file size of the file specified by handle InOut: Scope Name Type Comment Return SysFileGetSizeByHandle __XWORD Size of the file in bytes Input hFile RTS_IEC_HANDLE Handle of the file pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileGetStatus (FUN) ¶ FUNCTION SysFileGetStatus : SYS_FILE_STATUS Get the file status InOut: Scope Name Type Comment Return SysFileGetStatus SYS_FILE_STATUS File status. See category file status Input hFile RTS_IEC_HANDLE Handle of the file
SysFileGetStatus2 (FUN) ¶ FUNCTION SysFileGetStatus2 : SYS_FILE_STATUS Get the file status InOut: Scope Name Type Comment Return SysFileGetStatus2 SYS_FILE_STATUS File status. See category file status Input hFile RTS_IEC_HANDLE Handle of the file pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysFileGetTime (FUN) ¶ FUNCTION SysFileGetTime : RTS_IEC_RESULT Get file time of the specified file. A standard path will be added to the filename, if no path is specified. InOut: Scope Name Type Comment Return SysFileGetTime RTS_IEC_RESULT The runtime system error code (see CmpErrors.library) Input szFileName STRING File name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! ptFileTime POINTER TO SYS_FILETIME Pointer to get the file time results.
SysFileOpen (FUN) ¶ FUNCTION SysFileOpen : RTS_IEC_HANDLE Open or create file. A standard path will be added to the filename, if no path is specified in the file name. If a file extension is specified in the settings, this path will be used (see category settings). Note File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! InOut: Scope Name Type Comment Return SysFileOpen RTS_IEC_HANDLE Handle to the file or RTS_INVALID_HANDLE if failed Input szFile STRING File name. File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/) and not with a Backslash (\)! am ACCESS_MODE Requested access mode to the file. See ACCESS_MODE for details. Here find some examples: AM_READ If file does not exist, an error is returned. If the file exists, the file will be opened AM_WRITE If file does not exist, a new file will be created. If the file exists, it will be overwritten! AM_APPEND If the file does not exist, an error is returned. If the file exists, the file will be opened pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)