Record data from io device when protocol is stopped

Hi Chris,

When I stop a protocol, data recording also stops. This means that I have gaps in my recorded data from io devices when I stop one protocol to begin another. Is it possible to to run an io device (and record its data) even if the protocol is stopped? If not, would it be difficult to add this feature as an option? For various reasons, this makes syncing mworks data to other, continuous data streams more difficult, as some sync signals are missed in mworks when the protocol is stopped. Let me know if anything is unclear.

Thanks,
Gabe

Hi Gabe,

When I stop a protocol, data recording also stops.

Actually, it doesn’t. If a data file is open when the experiment stops, data recording will continue. For example, if you use MWClient’s variables window to change the value of a variable, that change will be recorded to the event file, even when the experiment isn’t running.

Is it possible to to run an io device (and record its data) even if the protocol is stopped? If not, would it be difficult to add this feature as an option?

No, it’s not currently possible. When a protocol ends, MWorks automatically executes stop_io_device on all I/O devices in the experiment. In theory, an I/O device could be designed to continue receiving input data and saving it to variables (which would be recorded in the event file, as noted above) after stop_io_device is called. However, I’m not aware of any devices that currently work that way.

Adding this as an option would probably require changes to each individual I/O device type, so it would likely be a substantial project. What specific device types were you hoping to use in this way?

Cheers,
Chris

Gotcha. I’m using labjack for sync signals, which is where this option would have the most benefit.

Gabe

Hi Gabe,

I think it should be possible (and not too difficult) to make this work for LabJack devices. Let me give it a shot and get back to you.

Cheers,
Chris

Much appreciated!

Hi Gabe,

Sorry, I haven’t yet had a chance to investigate this further. Also, I’m going to be out on vacation all of next week, so the earliest I’ll be able to get to it is the following week. I hope that won’t be a problem.

Thanks,
Chris

Hi Gabe,

As of the current MWorks nightly build, LabJack LJM devices have a new parameter: read_inputs_while_stopped. If this parameter is set to true, the device will start reading inputs when the experiment loads and continue doing so until the experiment is unloaded. Stop IO Device will have no effect on input channels (although it will stop output channels as always).

When you have a chance, can you test this out and confirm that it meets your needs?

Thanks,
Chris