0
$\begingroup$

Serial interface RS232 control

I am using a stepper motor connected with RS232 protocol. But I am unable to write or read. I don't get any errors and I have waited after I open the device and then Write and read. I am also using Windows 10 with Mathematica 10.3

This is the code I am using:

MM3000 = DeviceOpen[
  "Serial", {"COM5", "BaudRate" -> 9600, "DataBits" -> 8, 
   "Parity" -> None, "StopBits" -> 1}]

wait and then:

DeviceWrite[MM3000, "2PA+3000"]
FromCharacterCode@DeviceReadBuffer[MM3000]

A few minutes ago I had something read but then it just stop working. I have been waiting for an hour trying to figure out what just happened but I have no idea what the problem can be.

$\endgroup$
2
  • $\begingroup$ Can you reproduce the DeviceWrite[MM3000, "?\n"]; FromCharacterCode@DeviceReadBuffer[MM3000] results that rhermans suggested in his answer to the linked question? $\endgroup$
    – MarcoB
    May 1 '16 at 21:41
  • $\begingroup$ Also, if your "stepper motor" is actually a Newport MM3000 motion controller, as the name might imply, the manual for that device says that "An MM3000 command (or a sequence of commands) has to be terminated with a carriage return character" (page 3.10). Have you tried perhaps "2PA+3000\n" as your command? $\endgroup$
    – MarcoB
    May 1 '16 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.