Matlab sync data issue

ereming's Avatar

ereming

13 Jan, 2015 04:40 PM

Here's the scenario: say I'm running an experiment, and have not yet started streaming data, but I am syncing data to matlab. If I then open a data stream, MWorks sets "sync" to 0, and clears the the currently cached data. I understand why you would want to clear the cache so that the data you're seeing online matches the datafile, but I don't understand why syncing is turned off.

- Evan

  1. Support Staff 1 Posted by Christopher Sta... on 13 Jan, 2015 08:43 PM

    Christopher Stawarz's Avatar

    Hi Evan,

    This is (another) artifact of the event stream infrastructure. In short:

    When the event file is opened, MWServer sends out a copy of the codec (the mapping from event codes to variable names) to ensure that it's recorded in the event file. The MATLAB window sees the codec, assumes that a new experiment has been loaded, and resets itself.

    As part of resetting itself, the MATLAB window sets the sync variable to 0. I think the reason for this is to maintain internal consistency: After reset, the window is in "not collecting data" mode, which corresponds to a value of 0 for sync.

    While it's not clear to me that anything bad would happen if we didn't reset sync, the real issue here is that, in this case, the window shouldn't be resetting itself at all, since the loaded experiment has not actually changed. Let me think about how we can prevent the reset from happening.

    Chris

  2. Christopher Stawarz closed this discussion on 02 Apr, 2015 02:26 PM.

  3. Support Staff 2 Posted by Christopher Sta... on 07 Apr, 2015 07:38 PM

    Christopher Stawarz's Avatar

    Hi Evan,

    This issue is now fixed in the nightly build. The MATLAB window now checks each received codec against the previous one and resets itself only if they differ.

    Cheers,
    Chris

  4. Christopher Stawarz closed this discussion on 14 Apr, 2015 04:59 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac