SetPos (FB) ¶ FUNCTION_BLOCK SetPos EXTENDS CBM.ETrig This function block modifies the current offset for a file access. The file must be opened via FILE. Open . InOut: Scope Name Type Comment Input hFile CAA.HANDLE File handle udiPos __UXINT Offset position, Number of bytes from the start of the file Output eError ERROR Local library error ID (0: no error; 5101: time out)
Write (FB; Prefix filwr) ¶ FUNCTION_BLOCK Write EXTENDS CBM.ETrigToA This function block writes data into the file, which was previously opened via ”FILE. Open ”. The contents of the memory area indicated by pointer ” pBuffer ” should not be modified during the write action! The size of the structure of the memory containing the bytes to be written as well as the number of bytes to be written will not be checked. If the stability of the pointer on the data structures and their contents cannot be guaranteed in case of an online change, an online change must be avoided with the help of functions from the ”CAA_Application library”. InOut: Scope Name Type Comment Input hFile CAA.HANDLE File handle pBuffer CAA.PVOID The address from where the data can be obtained, can be determined with the help of operator ADR . szSize CAA.SIZE Number of bytes to be written (can be determined via operator SIZEOF ) Output eError ERROR Local library error ID (0: no error; 5101: time out)
Functions ¶ GetProperty (Function)
GetProperty (FUN) ¶ FUNCTION GetProperty : DWORD This function provides information on target-specific settings and functionalities, which concern the file or directory system or the implementation of optional function blocks. Properties table Nr. Constant name Meaning Return value function block – support 1 FILE_gc_PDIRRENAME Support of function block FILE_DirRename 0: No 1: Yes 2 FILE_gc_PRENAME Support of function block FILE_Rename 0: No 1: Yes 3 FILE_gc_PCOPY Support of function block FILE_Copy 0: No 1: Yes 4 FILE_gc_PSETATTRIBUTE Support of function block FILE_SetAttribute 0: No 1: Yes Restrictions on directories and files 100 FILE_gc_PFILENAME83 Restriction of the directory and file names to 8.3 format 0: No 1: Yes 101 FILE_gc_PCAPITALLETTERS Restriction on capital letters for directory and file names 0: No 1: Yes Path specification 200 FILE_gc_PABSOLUTEPATH Restriction on absolute path specification 0: No 1: Yes 201 FILE_gc_PDRIVELETTER Support of drive letters 0: No 1: Yes 210 FILE_gc_PRESOLVER Support of Resolver Syntax for file names 0: No 1: Yes 211 FILE_gc_PFTPRESOLVER Support of FTP-Client functions 0: No 1: Yes 212 FILE_gc_PHTTPRESOLVER Support of http-Client functions 0: No 1: Yes Network 300 FILE_gc_PNETWORKDRIVES Support of network drives 0: No 1: Yes InOut: Scope Name Type Comment Return GetProperty DWORD Return value describes the property, see table. Input wProperty WORD Number of the property, see table.
Global Variables ¶ CAA_Globale_Constants (GVL)
CAA_Globale_Constants (GVL) ¶ library specific property constants InOut: Scope Name Type Initial Constant gc_PDIRNAME WORD 1 gc_PRENAME WORD 2 gc_PCOPY WORD 3 gc_PSETATTRIBUTE WORD 4 gc_PFILENAME83 WORD 100 gc_PCAPITALLETTERS WORD 101 gc_PABSOLUTEPATH WORD 200 gc_PDRIVELETTER WORD 201 gc_PNETWORKDRIVES WORD 300
Structs ¶ FILE_DIR_ENTRY (Struct)
FILE_DIR_ENTRY (STRUCT) ¶ TYPE FILE_DIR_ENTRY : STRUCT This data structure holds information of a directory entry. It is filled by FILE.DirList for every entry in the open directory by sequential call. InOut: Name Type Comment sEntry CAA.FILENAME Name of directory or file szSize CAA.SIZE File size xDirectory BOOL Directory or file: TRUE: directory, FALSE: file xExclusive BOOL Access mode on file: TRUE: exclusive access mode, FALSE: multiple access mode possible dtLastModification DT Date and time of last modification, e.g. 2006-05-08-00:00:00
GetMessageDataPointer (FUN) ¶ FUNCTION GetMessageDataPointer : POINTER TO CL2I.DATA Returns pointer to the eight data bytes of a message. Number of valid bytes can be retrieved by GetMessageLength . Note The data is organised in the “Network Byte Order“ of the CANbus. The alignment of data types in the RTS memory may differ from the alignment in the data messages. Example VAR hMsg : CAA.HANDLE ; pData : POINTER TO CL2I.DATA ; usiMsgLen : USINT ; byFirstByte : BYTE ; bySecondByte : BYTE ; eError : CL2.ERROR ; END_VAR IF hMsg <> CAA.gc_hINVALID THEN //Get message data pointer pData := CL2.GetMessageDataPointer ( hMessage := hMsg , peError := ADR ( eError )); usiMsgLen := CL2.GetMessageLength ( hMessage := hMsg , peError := ADR ( eError )); //get number of valid bytes IF pData <> CAA.gc_pNULL THEN byFirstByte := pData ^ [0] ; bySecondByte := pData ^ [1] ; END_IF END_IF InOut: Scope Name Type Comment Return GetMessageDataPointer POINTER TO CL2I.DATA Pointer to message data Input hMessage CAA.HANDLE handle of message peError POINTER TO ERROR optional pointer to error enum
GetMessageId (FUN) ¶ FUNCTION GetMessageId : CL2I.COBID Returns the COBID of a message InOut: Scope Name Type Comment Return GetMessageId CL2I.COBID COBID of a message Input hMessage CAA.HANDLE handle of received message peError POINTER TO ERROR optional pointer to error enum