Biopac MP36 Parallel Porting with Matlab
조회 수: 10 (최근 30일)
이전 댓글 표시
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
Thomas
2023년 6월 20일
Hi there - I'm working on something similar. Did you ever figure this out? Thanks
답변 (2개)
Jack
2023년 3월 24일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!