Xpc read from disk and write to disk

Discussion in 'MATLAB' started by Rein, Sep 9, 2010.

  1. Rein

    Rein Guest

    In order to perform a lifetime test I would like to log the number of runs to a file on the pc. so that when xpc restarts it can read this file and continue counting. (for use with embedded xpc)

    I tried to connect a file scope to my run counter and save that info to disk, which works

    I tried to read the file using the 'xpc from file' block and that works as well

    The problem is that it doesnt work at the same time, since both blocks want to access and lock the same file. Also, when restarting, the data is lost when the filescope initialises.

    I thought about a few workarounds:
    * somehow manage to rename the filename at startup so that the two blocks read from a different file. I don't know how to rename a file at startup..

    * somehow manage to introduce an initialisation step in xpc which loads the variable in the file, closes the file and then loads the model with the variable stored in some block

    Can anyone help with this problem?
    Rein, Sep 9, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.