Biopac MP36 Parallel Porting with Matlab

19 vues (au cours des 30 derniers jours)
Busra
Busra le 24 Mar 2023
Réponse apportée : Busra le 21 Juin 2023
Hello,
I am new to Matlab and designing my first experiment with Matlab for acquiring data from eyelink response. I am pretty much done with design but I do not know how to send inputs to my EMG device. I see that Data Acquisition Toolbox might be used for that but I am using MacOS with Matlab R2022b version and this toolbox is not supported in my pc. Do you know other ways or codes. Thanks for your help. Have a good day.
Best regards,
  1 commentaire
Thomas
Thomas le 20 Juin 2023
Hi there - I'm working on something similar. Did you ever figure this out? Thanks

Connectez-vous pour commenter.

Réponses (2)

Jack
Jack le 24 Mar 2023
Hello! It's great to hear that you are designing your first experiment with MATLAB.
Since you are using macOS with MATLAB R2022b, and the Data Acquisition Toolbox is not supported on your machine, you may consider using other options to communicate with your EMG device. One option is to use a serial communication interface between your computer and the EMG device. Here are some steps to get started:
1. Connect your EMG device to your computer using a serial cable.
2. In MATLAB, use the 'serial' function to create a serial object that represents the serial port that your EMG device is connected to. For example:
s = serial('/dev/tty.usbserial-A9007UX1', 'BaudRate', 9600);
3. Replace '/dev/tty.usbserial-A9007UX1' with the name of the serial port that your EMG device is connected to.
4. Open the serial port using the 'fopen' function:
fopen(s);
5. Send commands to the EMG device using the 'fprintf' function. For example, if your EMG device expects the command 'start', you can send it like this:
fprintf(s, 'start');
6. Replace 'start' with the command that your EMG device expects.
7. Read data from the EMG device using the 'fread' or 'fscanf' function. For example:
data = fread(s, 10, 'int16');
8. This will read 10 samples of 16-bit integer data from the serial port.
9. Close the serial port using the 'fclose' function:
fclose(s);
Note that the exact commands and data formats that you need to send and receive will depend on the specific EMG device that you are using, so you should consult its documentation for more information.
I hope this helps! Let me know if you have any further questions.
  1 commentaire
Busra
Busra le 24 Mar 2023
Thanks for your help, I will try to do this🙏 my supervisor told me that I need both parallel porting for EMG and matlab to just synchronize the trials with the device also serial porting for other purposes. Maybe I should use windows computer for that particular aim through Data Acqusition Toolbox

Connectez-vous pour commenter.


Busra
Busra le 21 Juin 2023
Hi Thomas, I did not figure the problem out and switched the another problem called E-Prime 2.2 which my supervisor bought for himself. What I learn from other labs, in order to use parallel port, we either need to download 2016 version mathlab and use windows computer or switch the other programming tools :( maybe you can try to download matlab 2016 :/ and look at configure io codes. I hope you find your own way :)

Catégories

En savoir plus sur Data Acquisition Toolbox Supported Hardware dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by