problem in sending serial data to monochromator controller
显示 更早的评论
I have a AMS DCB-241 Stepper motor controller controlling the Monochromator's grating motion.
I am trying to automate this system with MATLAB, i am using serial communication port USB-SIN11 adapter cable to connect computer to the controller.
With the propitiatory software commands like ex. '-1000' (move the grating to 1000nm clockwise), '+1000' move the grating to 0th positing anticlock wise) 'V=1000' (slew speed 1000 steps/s) etc...
When i send these commands through the Matlab code, Controller is NOT responding by moving the stepper motor in the monochormator.
Can you please help me out in resolving ths issue? Is there a problem with the code?
Kindly do the needful and oblige.
Here is the mat lab code i wrote:
s1 = serial ('com3', 'BaudRate', 9600, 'DataBits', 8);
fopen(s1);
fprintf (s1, 'i=50');
fprintf (s1, 'k=100,100');
fprintf (s1, 'v=1000');
fprintf (s1, '-8908');
pause (20);
fprintf (s1, '-213');
pause (10);
fprintf (s1, '-240');
pause (10);
fprintf (s1, '-133');
pause (10);
fprintf (s1, '+9494');
pause (20);
fclose(s1);
delete(s1);
Thanks in advance
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Texas Instruments C2000 Processors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!