CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Feb 18, 2020 8:37 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Jan 14, 2020 5:23 pm 
Offline

Joined: Fri Jun 26, 2015 6:23 pm
Posts: 50
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 ?


Top
   
PostPosted: Wed Jan 15, 2020 12:39 am 
Offline

Joined: Tue Mar 26, 2019 4:28 pm
Posts: 91
1. Yes.
2. Create a button with the input configuration set to open the Visu dialogs.fileopensave as per https://help.codesys.com/webapp/_visu_d ... pen-dialog


Top
   
PostPosted: Wed Jan 15, 2020 9:05 am 
Offline

Joined: Fri Jun 26, 2015 6:23 pm
Posts: 50
1- How ? On raspberry, it's : "/mnt/sdb1" ?
I use this code:
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 ?
Code:
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:
Code:
parameter : filelistprovider; type: VISU_FBFILELISTPROVIDER; Value : ????


Top
   
PostPosted: Fri Jan 17, 2020 3:16 pm 
Offline

Joined: Fri Jun 26, 2015 6:23 pm
Posts: 50
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 !


Top
   
PostPosted: Mon Jan 20, 2020 11:41 am 
Offline

Joined: Fri Jun 26, 2015 6:23 pm
Posts: 50
Edwin, could you help me !?!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited