Issuing Commands to Stepper Motor

Hey guys,
I want to issue serial commands to an RMS technologies R256 Stepper Motor Controller through Matlab2012a, Win 7 64-bit. I am not familiar with matlab serial interface. This is what I've tried thus far...
s = serial('COM5') <---that's the correct port
set(s, 'BaudRate', 9600)
fopen(s)
afterwards, I tried issuing commands with:
fwrite(s,'commandhere')
but I am getting no error or motor response. Here is a link to the R256 manual with commands.
Any help would be greatly appreciated.

 채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 12일

0 개 추천

You probably have forgotten to send the CR (carriage return) as part of the command. Also, be sure to configure the serial port to use CR as the line delimiter.

댓글 수: 1

MrCurious44
MrCurious44 2013년 4월 16일
You were absolutely right. I dug up some more and solved it by the following:
s=serial('COM5','BaudRate',9600) fopen(s) fwrite(s, ['insertcommandhere' 13 10])
Solution found here:http://www.mathworks.com/matlabcentral/newsreader/view_thread/270865 Hope this helps anyone else with a similar problem.
Thanks Walter

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by