nigelrogasch / MAGIC

Magnetic stimulator interface controller toolbox
23 stars 9 forks source link

magstimObject.fire() did not trigger stimulation pulse #23

Open hungshao opened 7 months ago

hungshao commented 7 months ago

Hi team, Thank you so much for creating this MAGIC. I am trying to connect a computer (Dell PC) with MagStim 200 TMS device. I am able to arm and disarm the TMS device as well as setting the amplitudes by using the code you provided. However, after I execute magstimObject.fire(), the TMS did not deliver the pulse. Instead, I have to manually click the button on the TMS coil to fire.

Given that I can arm/disarm and adjust the amplitude using code, I am not sure if the issue is on the hardware cable setup or is on the code part. Greatly appreciate any suggestions/pointers on how to fix this issue.

umair-hassan commented 7 months ago

Hi!

thank you for contacting us. Can you please let us know about the Matlab version you are using? If there's any warning or error - a screenshot will also help.

The sequence of events also helps, first you should connect, then arm, then set amplitude, then fire.

The fire will only work if your remote control settings on the magstim are active, so perhaps check those too!

Best, Umair

hungshao commented 7 months ago

Thanks so much for the speeded reply. Sorry, I should have provided more info. The Matlab version is 2022a

Here is my code: matlab_test_code

When I look at the output from line 9 ([status, out] = magstimObject.fire();), status is 0 and out is an empty [].

Only one warning showed up after running the connect code and it said "serial will be removed in a future release, Use serialport instead".

How do I check whether the remote control settings are active?

umair-hassan commented 7 months ago

Okay, this serialport is a known issue, can you please use a 2017 ir 2018 matlab version and let us know if this script worked there? this will be a huge help!

hungshao commented 7 months ago

Hi, I just tested this code using Matlab 2018b and it still does not trigger the pulse. The serialport warning is gone though.

umair-hassan commented 7 months ago

Okay, so the problem is probably caused by something else. I tried that, and everything works on my end, therefore the problem is most likely in the peripheral. I can join you online to look into this together.

hungshao commented 7 months ago

Thank you so much. I will send you an email.