SQLite files MainDirectory and Disk change

lsislsis
2015-09-11
2016-03-28
  • lsislsis - 2015-09-11

    Is there any way to change the main directory and disk of alarm and trend files?
    I want to write these files at ram disk because if i have an unexpected shutdown of Raspberry the files produce a problem to run again the application after reboot.

    Regards

     
  • eschwellinger

    eschwellinger - 2015-09-11

    Hi,

    yes, this could be done:

    [SysFile]
    FilePath.1=/etc/, 3S.dat
    FilePath.2=/yourRamDisk/, .sqlite, sqlite.metadata

    the same with alarm files, you need to specify the path redirection.

    BR
    Edwin

     
  • lsislsis - 2015-09-12

    Hi Edwin

    I try:

    [SysFile]
    FilePath.1=/rts/, 3S.dat, .app, .crc
    FilePath.2=/etc/, .sqlite, sqlite.metadata

    but when i try to download the application i take error:

    "Received invalid answer from device"

    My default configuration that works is:

    [SysFile]
    FilePath.1=/rts/, 3S.dat
    FilePath.2=/rts/, .app, .crc

    Help Please

     
  • eschwellinger

    eschwellinger - 2015-09-22

    Hi,

    i've found the time now to test this and it works for me with the following settings:

    [SysFile]FilePath.1=/etc/, 3S.datFilePath.2=/home/pi/, .sqlite, sqlite.metadata, *sqlite-journal

    Attention:
    Guess before you redirect the path there should not be a bootproject on your pi with have some trend implemented.

    So the procedure is:
    Clean Pi (Reset Original)
    stop the plc by
    sudo Service codesyscontrol stop
    Redirect the path by changig the /etc/CODESYSControl.cfg
    sudo service codesyscontrol start
    download your trendapplication and check in the log if there are Errors and check your new Directory if These sqlite files exist in the
    new Directory Environment(redirected)

    BR
    Edwin

     
  • eschwellinger

    eschwellinger - 2015-10-14

    Hi,

    Need to do one additional remark:

    If you Redirect to another drive (USB whatever)
    you need to add *sqlite.tmp

    [SysFile]
    FilePath.1=/etc/, 3S.dat
    FilePath.2=/media/xxxx/, .sqlite, sqlite.metadata, *sqlite-journal, *sqlite.tmp

    BR
    Edwin

     
  • eschwellinger

    eschwellinger - 2015-10-14

    Edwin Schwellinger hat geschrieben:
    Hi,
    Need to do one additional remark:
    If you redirect to another drive (USB whatever..)
    you need to add sqlite.tmp
    [SysFile]
    FilePath.1=/etc/, 3S.dat
    FilePath.2=/media/xxxx/,
    .sqlite, sqlite.metadata, sqlite-journal,
    BR
    Edwin

     
  • lsislsis - 2016-03-23

    Please tell us how we can do the same trend files redirection to USB Flash with Codesys RTE 64bit.

    Regards

     
  • eschwellinger

    eschwellinger - 2016-03-23

    Hi,

    since SP8 you need to do this by the follwing:

    C:\Program Files\3S CODESYS\CODESYS Control RTE3\CODESYSControl.cfg

    [SysFile]
    PlcLogicPrefix=1
    PlaceholderFilePath.1=d:\yourdir, $trend$

    BR
    Edwin

     
  • lsislsis - 2016-03-23

    We need the same for alarms and recipes ?
    From SP8 change and for the Raspberry ?

    Regards

     
  • lsislsis - 2016-03-23

    Are you sure?

    IMG: TrendPrj.png

     
  • eschwellinger

    eschwellinger - 2016-03-23

    Hi,

    yes i'm pretty sure
    please just do it in the config file by using my snippet
    not in this configuration menu (tasktray), this leads to a path redirection for all files.
    This is not what you need in that case.

    BR
    Ew

     
  • lsislsis - 2016-03-24

    Hi Edwin

    Works OK for trends.
    Can i do the same with Raspberry?
    How can i do the same with Alarms and Recipes?

    Regards

     
  • eschwellinger

    eschwellinger - 2016-03-28

    Hi,

    this is the same:
    Example for Raspberry Pi

    [SysFile]
    FilePath.1=/etc/, 3S.dat
    PlcLogicPrefix=1PlaceholderFilePath.1=/home/pi/trend, $trend$PlaceholderFilePath.2=/home/pi/alarms, $alarms$

    on recipe you give the location to save them in CODESYS project on the recipemanager, this is different
    BR
    Edwin

     

Log in to post a comment.