Rpi: backup persistant on files and select files on webvisu

galexis
2020-01-14
2020-01-20
  • galexis

    galexis - 2020-01-14

    Hi,
    I make backup of persistant on sd card, with date and hour name, with AppStoreRetainsInFile.

    Question 1: is it possible to store backup files on external USB flash disk ?

    Question 2: I would like to choose with webvisu, which backup file I have to restore, with AppRestoreRetainsFromFile. How to make chooser of file ?

     
  • galexis

    galexis - 2020-01-15

    1- How ? On raspberry, it's : "/mnt/sdb1" ?
    I use this code:

    PROGRAM MEMORISATION_PERSISTANTS
    VAR
    fbDelete : FILE . Delete ; (* bloc pour effacer le contenu du
    fichier *)
    sFileName : STRING := 'data.ret' ;
    pApp : POINTER TO APPLICATION ;
    Result : RTS_IEC_RESULT ;
    xInit : BOOL ;
    RESTORE : bool ;
    END_VAR
    //CmpApp + CAA File + SysTypes Interfaces
    IF NOT xInit THEN
       pApp := AppGetCurrent ( pResult := ADR ( Result ) ) ;
        xInit := TRUE ;
        RESTORE := TRUE ;
        PERSIST_RESTAUREES := FALSE ;
     END_IF
    IF SAUVEGARDER = TRUE AND NOT RESTORE THEN
       fbDelete ( xExecute := TRUE , sFileName := sFileName ) ;
       IF fbDelete . xDone OR ( fbDelete . xError AND fbDelete . eError = File .Error . NOT_EXIST ) THEN
          fbDelete ( xExecute := FALSE ) ;
          IF pApp <> 0 THEN
             Result := AppStoreRetainsInFile ( pApp , sFileName ) ;
          END_IF
    END_IF
    IF RESTORE THEN
       Result := AppRestoreRetainsFromFile ( pApp , sFileName ) ;
    END_IF
    

    I have to specify ?```

    sFileName : STRING := '/mnt/sdb1/data.ret' ;

    2- I don't understand how to use dialogs.fileopensave ?
    I put it on vizualisation ? And after? Which configuration of it ?
    Or I create a button, on mouseclick, I call dialog box fileopensave ? But What I have to set about:
    

    parameter : filelistprovider; type: VISU_FBFILELISTPROVIDER; Value : ????

    ```

     
  • galexis

    galexis - 2020-01-17

    Point 1 :
    I do auto mount usb disk on /media/usb with user pi.
    On sFilename I do: '/media/usb/data.ret'. It work.

    And for point 2: I need help !
    I analyse example VisuDialogST, but the second application which can help me, doen't work. Please help me !

     
  • galexis

    galexis - 2020-01-20

    Edwin, could you help me !?!

     

Log in to post a comment.