Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

FILE.GetProperty

hermsen
2017-08-07
2017-08-08
  • hermsen

    hermsen - 2017-08-07

    Hi Everybody,

    As I am writing my my own FileFactory Library. Therefore I want to check which functionalities the target runtime has.
    That way the filefactory can "adapt" to the target which makes the library more flexible and more user friendly.
    To achieve this, I have read into the CAA File library and the function FILE.GetProperty suits this purpose perfectly.
    I linked "File Acces" 3.5.7.0, which depends on "CAA File" 3.5.11.0
    According to the documentation, the function works very straightforward;

    Ouput (DWORD) := FILE.GetProperty( in := Input (WORD) );

    with

    Input = List of global constants which act as question
    Output = Anwser 0 or 1 (as DWORD) to input question
    https://help.codesys.com/webapp/CAA-File%2FFunctions%2FGetProperty;product=CAA_FILE;version=3.5.11.0

    To test this functionality i wrote a little testprogram to see if the function returns the targets capabilities;

    //Insert File Access in Library Manager
    PROGRAM GetProperty
        PDIRNAME : DWORD; // A1 
        PRENAME : DWORD; // A2 
        PCOPY : DWORD; // A3 
        PSETATTRIBUTE : DWORD; // A4 
        PFILENAME83 : DWORD; // A100 
        PCAPITALLETTERS : DWORD; //A101 
        PABSOLUTEPATH : DWORD; // A200 
        PDRIVELETTER : DWORD; // A201 
       
        // several declarations missing in global constants list 3.5.11.0 ?
        MIA210 : DWORD; //210
        MIA211 : DWORD;//211
        MIA212  : DWORD;//212
        PNETWORKDRIVES : DWORD; // A300 
    END_VAR
    DIRNAME       := FILE.GetProperty(wProperty := FILE.gc_PDIRNAME );      //    Support of function block FILE_DirRename
    PRENAME      := FILE.GetProperty(wProperty := FILE.gc_PRENAME );      //   Support of function block FILE_Rename
    PCOPY       := FILE.GetProperty(wProperty := FILE.gc_PCOPY );         //   Support of function block FILE_Copy
    PSETATTRIBUTE   := FILE.GetProperty(wProperty := FILE.gc_PSETATTRIBUTE);   //   Support of function block FILE_SetAttribute
    PFILENAME83    := FILE.GetProperty(wProperty := FILE.gc_PFILENAME83 );      //   Restriction of the directory and file names to 8.3 format
    PCAPITALLETTERS := FILE.GetProperty(wProperty := FILE.gc_PCAPITALLETTERS );   //   Restriction on capital letters for directory and file names
    PABSOLUTEPATH     := FILE.GetProperty(wProperty := FILE.gc_PABSOLUTEPATH );   //   Restriction on absolute path specification
    PDRIVELETTER     := FILE.GetProperty(wProperty := FILE.gc_PDRIVELETTER );   //   Support of drive letters
    // missing constants?
    MIA210 := FILE.GetProperty(wProperty := 210 ); //Support of Resolver Syntax for file names
    MIA211 := FILE.GetProperty(wProperty := 211 ); //Support of FTP-Client functions
    MIA212 := FILE.GetProperty(wProperty := 212 ); //Support of Http-Client functions
    PNETWORKDRIVES := FILE.GetProperty(wProperty := FILE.gc_PNETWORKDRIVES );   //   
    

    Now, I ran this code on target x86 non RT, x64 non RT and RPi3, all v3.5.11.0, without ANY of the anwsers becoming "1" at runtime on all 3runtimes.

    I assume this cannot be correct behaviour, am I doing something wrong? If so, what am I doing wrong?
    I checked the input on the function and I think that works fine, the function has a valid argument and is called correct.

    Q1: Can someone check my findings on the non-performing of the FILE.GetProperty function?
    Q2: Are the 3 constants missing by design? E.G.;
    MIA210 := FILE.GetProperty(wProperty := 210 ); //Support of Resolver Syntax for file names
    MIA211 := FILE.GetProperty(wProperty := 211 ); //Support of FTP-Client functions
    MIA212 := FILE.GetProperty(wProperty := 212 ); //Support of Http-Client functions

    Many Thanx!

     
  • e.kislov - 2017-08-08

    Hi. Some info from CODESYS bug-tracker about CAA File:

    1. GetProperty: "This function will not be implemented, because the 3S CAA implementation should behave in teh same way on all plattforms and there is no need to retrieve implementation properties.
      The function will be removed (or hidden) during the next rework of the CAA libs." (CDS-20219)

    2. FTP/HTTP - not implemented (CDS-2697 and etc.)

     
  • hermsen

    hermsen - 2017-08-08

    Hi,

    Thanks fo the anwser. Topic closed

    Ps.
    I have no access to the bugtracker.

     

Log in to post a comment.