My motor receives data via a serial connection, but it won't move. What am I doing wrong?

Hello everyone,
as the title says, I am trying to use a motor called "MP285" by Sutter Instruments via LabView. The control unit of this motor only has a RS232-output, but I use a Serial-to-Usb-Adapter to connect the device to the PC.
My problem is the following:
I tried to perform a basic Input/Output test by using the Ni MAX an sending ASCII strings to the control unit (after configuring it according to the reference manual), which worked fine. I also used the "jabber"-function of the control unit to send an output string to the PC and was also able to read that string from the buffer. Besides, when I used a LabView-VI to send a command via VISA Write, it also appears on the display of the control (at least the ASCII letters).
 Accordingly, I assume that the Serial-to-USB-adapter does work. Is that for sure, or can the adapter evoke any other problems?
However, when I try to use the shipped controlling software, the motor won't work. Furthermore, I contacted the customer support and they sent me some VIs and a LabView-Project, which was tested by the company. Unfortunately, it did not work for me. The motor wouldn't move, when I sent the command, although the LabView-interface indicates that there the connection between PC and controller has been established. As the program has many features and I only need a command to move the motor, read the position and set the origin, I tried to build my own VI. I had a look at some basic VIs for motor control and referred to the manual.
As it seems, the controller uses data streams of full bytes (8 bits, not ASCII) in Big Endian for its strings (I copied the information at the bottom of this text). Thus, I tried to concatenate particular strings to send it via VISA in the correct form (see attached). Do I have to convert the "m" into hexadecimal explcitly? I looked up "Convert ASCII to Hexadecimal", but when I try this, the output string does not change.
However, when I send this string to the controller in normal mode, nothing happens . When I activate the Input/Ouput test (see above), there is a m displayed on the controller unit. So I guess, I am messing up the command structure. Can anybody help me please?
Kind regards
PS: Sorry for cleaning up the diagramm..
PPS: For some reason, I could not attach the VI because " The contents of the attachment doesn't match its file type". So, I changed the name in "-vi" instead of ".vi" as suggested by a forum user. Hope this works for you!
Excerpt form the reference manual:
General Information:
"Command requests are single bytes followed by optional parameters and terminated by a
carriage return (CR, 0Dh). The data stream consists of full bytes (all 8 bits — not ASCII.
The lowest order byte (for example, of the four bytes encoding the X coordinate) is the first
into the controller and is the first out. The default Baud rate is 9600. Commands are
processed bytewise by interrupt and executed only after the terminating CR is received.
There are no delimiters within command strings. The controller will reply with carriage
return (CR, 0Dh) at the completion of normal command processing."
Command structure:
Get Current Position      command ‘c’CR 063h + 0Dh
                                           returns xxxxyyyyzzzzCR three signed long (32-bit) integers + 0Dh
Go To Position                 command ‘m’xxxxyyyyzzzzCR 06Dh + three signed long (32-bit) integers + 0Dh    
                                            returns CR 0Dh
Setting up for Serial Communication:
First, use the 9-pin serial port cable provided with the MP-285 to connect the “serial port” of
your computer to that of the MP-285 controller. Next configure your terminal emulator (e.g.,
HyperTerminal in Microsoft Windows (9X and above) to the following settings (or their
equivalent):
• TTY mode
• Echo typed characters locally only (do not echo input to the computer serial port back to
the controller)
• Baud rate to 9600
• 8 data bits, no parity, 1 stop bit
• COM port - set to the port to which you have connected the MP-285 controller
Solved!
Go to Solution.
Attachments:
MotorTestVI-vi ‏17 KB

Thank you for your feedback!
To make this clear: I dont know if the motor MOVES when sending the appropriate command via MAX. That is because I dont know how to enter the binary? command. I only tried to send some string like "dear moto please move" to see if this ASCII string can be displayed on the control unit while running the input-mode (which I described above).
This works for both, MAX and my Labview-Vi.
However, these are the I/O traces:
1. MAX: I sent the string: "Test"
NI I/O trace:
viWrite (ASRL25::INSTR (0x026B41E8), "Test", 4, 4) Process ID: 0x0000123C         Thread ID: 0x00001434 Start Time: 16:18:31.599       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
2. LabView-Vi (I removed everything that followed the first "Visa Write" and added the recommended property node to check if my termination char is correct). I sent string "TEST".
14.  viOpenDefaultRM (0x065171F0) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.918       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
15.  viParseRsrc (0x065171F0, "COM25", 4, 25) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.918       Call Duration 00:00:00.002 Status: 0 (VI_SUCCESS)
16.  VISA Set Attribute ("COM25", 0x3FFF001A, 3000) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.920       Call Duration 00:00:00.020 Status: 0 (VI_SUCCESS)
17.  VISA Set Attribute ("COM25", 0x3FFF0021, 1200) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.940       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
18.  VISA Set Attribute ("COM25", 0x3FFF0022, 8) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.940       Call Duration 00:00:00.001 Status: 0 (VI_SUCCESS)
19.  VISA Set Attribute ("COM25", 0x3FFF0024, 10) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
20.  VISA Set Attribute ("COM25", 0x3FFF0023, 0) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
21.  VISA Set Attribute ("COM25", 0x3FFF0038, 1) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
22.  VISA Set Attribute ("COM25", 0x3FFF0018, 13) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
23.  VISA Set Attribute ("COM25", 0x3FFF0025, 0) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
24.  VISA Set Attribute ("COM25", 0x3FFF00B3, 2) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
25.  VISA Get Attribute ("COM25", 0x3FFF0018, 13) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
26.  VISA Get Attribute ("COM25", 0x3FFF0038, True) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
27.  VISA Write ("COM25", "TEST", 4) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.001 Status: 0 (VI_SUCCESS)
28.  VISA Close ("COM25") Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.942       Call Duration 00:00:00.110 Status: 0 (VI_SUCCESS)
Both strings are correctly displayed.

Similar Messages

Maybe you are looking for

  • ICloud doesn't sync

    Hello guys! I bought a brand new iMac with OS X 10.8.4 recently and set up my iCloud with my Apple ID. I use my Calendar, Mail, Notes, Reminders and Contacts frequently but have found that none of the info from my desktop apps can be found in my iClo

  • How can i update my iphone from a different computer?

    I dont have internet access and need to update my iphone. Can i use a friends laptop to update it without erasing contacts, notes, etc??

  • Open Item Management Function

    Hi Experts, We have tried to activate open item management for a particular account which was not open item managed orginally. When we attempt to do the same we are unable to do the same. We have made the balance to Zero for the account. But our comp

  • Using quick query component

    hi, I am using quick query component. There is any way to show in the combo box of the quick query component only some and not all fields, because I do not need to display all. Please..

  • How to clear previously entered keywords in HUD in one fell swoop?

    Hi, Is there an alternative to hunting and pecking (AND MISSING) every previously checked box - and clearing all of them with one click? Thanks a lot, Raphael