Hi Eghbal,
Sorry for the delayed response. Taking your questions in reverse order:
I remember Mworks had issues with Apple MacPro systems in connecting to NIDAQ through thunderbolt connection. I was curious if it is fixed now.
It was an NI driver problem, not an MWorks problem. I don’t think anything has changed, but you could check with Evan in the Jazayeri Lab.
I think the python is falling behind as it is saving images at 200Hz, and it is falling behind the next call. when I run the python script without saving, the schedule action does not fall behind. I was wondering if you have any advice on that
Given that a typical video file is encoded at 30 or 60 frames per second, 200 images per second seems excessive. Are you sure you need to save all of them? Maybe it would be sufficient to save every second or third image?
Would it be possible if you could direct me to an example of python thread to use as a reference?
This turned out to be a little more complex than I initially expected. Importantly, I realized that creating plots inside MWServer (e.g. via run_python_file) really doesn’t work. Thus, I’ve attached two example experiments with associated Python files: one that runs its Python code in the server and does not do any plotting, and another that runs its Python in a separate process (via a conduit) and does do plotting.
The first example (in_server.mwel
) uses a Python file resource and the run_python_string action to execute its Python code within MWServer. The Python code periodically updates two position variables, which in turn determine the position of a white dot on the stimulus display. If everything is working, the dot should change position once per second.
The second example (via_conduit.mwel
) accomplishes the same task, but the Python code runs in a separate process and communicates with MWorks via a conduit. Also, in addition to generating positions, it continuously updates a scatter plot showing all the positions it has generated. To run it, first start the experiment, then run the Python code in one of two ways:
- From the command line, e.g.
python via_conduit.py
- From MWClient’s Python Script Bridge window
I realize there’s a lot going on in these examples, so please let me know if you have questions. Also, I’d be happy to sit down with you and go over them, if that would be helpful.
Cheers,
Chris