MWorks suggestions

Hi Chris, hope you are well. I just wanted to write to send along a few feature requests/suggestions. I was recently troubleshooting a new experiment and couldn’t figure out why the error “parser error : Start tag expected, ‘<’ not found” kept on coming up no matter what I wrote, even basic hello world scripts. I thought I might have had a corrupted installation. I finally figured out I had a typo in the file extension which makes sense why that would be a parser error. But a dedicated error message for this situation I think would be nice as I’m sure other people will encounter this in the future.

On another subject, I am starting to write some scripts with the blackrock LED driver setup and for the script to run, mworks requires the driver to be plugged in and on. This makes it difficult to develop on other computers than the lab computers. For things like the eyelink we have an alternate input device of the mouse. I know the LED array has an alternate output device as an optional parameter, but I’m confused about how I’d use it with the particular intricacies of the LED driver. What kind of device, if any, would you recommend using as an alternate out?

Thanks,

Simon

Hi Simon,

I finally figured out I had a typo in the file extension which makes sense why that would be a parser error. But a dedicated error message for this situation I think would be nice as I’m sure other people will encounter this in the future.

I see your point, but MWorks doesn’t require a particular file extension for anything except MWEL files. Let me think about whether there’s some other way to be more helpful in this situation.

I know the LED array has an alternate output device as an optional parameter, but I’m confused about how I’d use it with the particular intricacies of the LED driver. What kind of device, if any, would you recommend using as an alternate out?

The “alt” parameter isn’t going to help you much, because all the LED-driver-related actions require an actual LED driver instance.

I’m planning to add support for conditional code inclusion to MWEL, so that you can write things like

%if have_led_driver
    blackrock_led_driver_prepare (...)
%end

where have_led_driver is an expression macro that evaluates to true or false. If false, the contained statements are included; otherwise, they’re omitted. You could include the LED driver declaration and all related actions within such conditional blocks, and then enable/disable them all simply by changing the value of have_led_driver.

I think this would be a good approach in this situation. Unfortunately, I haven’t added support for it yet. An alternative would be to just comment out all the LED driver stuff when testing, but that’s a lot less convenient.

Chris