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
-
While my Library is turned on in iTunes, I keep getting the following message from my AppleTV: "Could not connect to Chuck's Library." What am I doing wrong. I am a newbie, just getting started. Ultimately, I'm trying to get everything linked up so I can view My Picture on TV (via my wireless network - of course).
Thanks for any help you can provide!Welcome to the Apple Community.
Does your Firewall allow access for iTunes, do you have any security software installed, is your network working correctly. -
I recently downloaded the i07 on my iphone 4s. Now I am unable to connect to my wi-fi. What am I doing wrong???
I just got a new router and couldn't connect to my new Wi-Fi. I had to go and turn on airplane mode, select the network then it connected and I turned the airplane mode off. I hope this works for you.
-
I have downloaded a movie off iTunes and when I tried to press play it said"cannot open" I have received an email of my purchase but cannot watch the movie ,what do I do ?
Select the content which is causing a problem and use the 'Report a problem' button in Your Purchase History on your computer.
-
I updated my iPhone 4S with the new iOs 6. It was successfully installed, but when I open passbook app and tapped App Store I get this message saying cannot connect to apple iTunes Store . What did I do wrong?
Try connecting to your Mac or PC and using iTunes to sync your iPhone. Disconnect your iPhone after syncing, make sure in Settings>iTunes&AppStore you have your Apple ID and password entered, and launch App Store and sign in. It should work now, but do not sign out from App Store. There seems to be a bug that prevents us from signing in again after signing out.
-
I have purchased a tv series from iTunes for Mac.. When I try to download either the episodes individually or the entire series all I get are the first minute or so of each. What am I doing wrong? ( My Internet connect is strong and good.)
first, try this:
Choose Authorize Computer from the Store menu. The server will recognize you are reauthorizing and not count your computer a second time.
if that doesn't work, then try this:
Quit iTunes.
In Terminal, go to /Users/Shared/ and rename the "SC Info" folder to something else.
Run iTunes, and do the authorize as mentioned above.
please let me know if this helps. -
have just bought my youngest an Ipod. Have set up a new user accout as suggested by the man in the Apple store, got a separate email account and everything seemed ok. HOwever, cannot get it to connec to the Itunes store so cannot redeem any vouchers. I have now spent hours on this and am rapidly losing patience! Can anyone help please.
This may help.
Can't connect to the iTunes Store
What happens whenyou try to connect? Error messages? -
ive locked my ipad but dont know, once i have it connected to itunes what to do
Do as the manual tells you to do and restore the ipad.
If you are unable to restore then:
iPad: Unable to update or restore
iOS: Unable to update or restore -
Is this the only way to save a document in pages 5?
The solution to this was given by Kreklo in 2 posts in the following thread:
https://discussions.apple.com/message/19175531#19175531
Good luck! -
Receiving data via 802.15.4 radio
Hi,
I am familiar with using a bluetooth radio to receive data wirelessly through the serial port using VISA in LabVIEW. However due to the range limitations of my bluetooth radio, I'd like to have a go at receiving date via from an 802.15.4 radio. Has anyone any experience doing something like this and is it possible using VISA and a serial port? Presuming I know the data packet format, it should be ok right..?
StrokesLewis G wrote:
Hi Strokes,
Do you plan on buying a third party 802.15.4 wireless device that connects to your computer through the serial port? What hardware do you intend to use?
I assume you wish to use your existing code that was designed for the Bluetooth dongle. Are you communicating using a serial protocol or Bluetooth protocol (Bluetooth or Serial VIs)?
What is your current setup? Do you have a Bluetooth device that connects to your PC via serial? What hardware do you have sending and receiving the data?
Have you seen the NI Wireless Sensor Networks and have you thought about Using LabVIEW with TCP/IP and UDP?
Kind Regards
No I plan on using a Shimmer device (see here) which as a 802.15.4 radio on it's circuit board to communicate to a laptop via serial port.
I'm not set on using the existing code as used with the bluetooth radio on the Shimmer, but if it will reduce the workload then yes of course I will. The existing code currently uses serial protocol so I guess I could modify the existing code?
My current setup is: I have a Shimmer (wireless sensor, accelerometer in this case) that has both a bluetooth radio and 802.15.4 radio. Due to my application needs, I would like to transmit data to the serial port via the 802.15.4. There is existing code which allows the Shimmer to communicate with the serial port using Bluetooth radio.
I'm not looking for code or anything, just wanted to know how to go about it and if I could use VISA which I'm fairly familiar with.
Thanks,
Strokes -
I bought an HDTV cable to connect my MacBook Pro to my Sony TV via HDML. The TV recognizes my computer; I see my basic computer screen on the TV. I tried to watch videos on my TV but got nothing. (tried via my facebook vidoes and Youtube. What am I doing wrong?
I've got a similar (but different!) problem: I have a MacBookPro3,1 running Mac OS X 10.6.8. I want to connect to my HD TV using a HDMI to DVI cable but the MBP cannot detect the TV display. What's the solution? Is this a bug in Mac OS X 10.6.8 ? Any ideas what I can do to make things work with the HDMI to DVI cable. (N.B.: I have separate audio cable running from the MBP to amplified speakers for the sound side of things. It’s the video that’s the problem!)
-
I submitted my information to receive a replacement 1st generation nano but somehow did not notice what steps I needed to take to return the Ipod to Apple. What needs to be done after submitting the serial number information online in order to obtain a replacement?
They're supposed to send you a box with shipping instructions which you then use to send them your 1st generation iPod, however, I've been waiting a month for my box and can't figure out why I have not received it
-
I am trying to connect with a friend via FaceTime from my IPad to his IPhone and it will not connect. We are both on wifi. What are we doing wrong?
Read this:
There is a troubleshooting section at bottom.
http://support.apple.com/kb/TS5419 -
Why can't I connect to Exchange Server 2003? I'm using OS Lion. My iphone connects, what am I doing wrong?
the iPhone uses active sync. Desktop clients do not. Desktop clients use another exchange protocol (which i can't remember as i'm not a microsofty).
Just because you can access via active sync doesn't mean you can access it by other methods, and vice versa. -
When I turn on my iPad the grey 'brightness slider' is in the centre of the screen and I can't get rid of it. I've tried switching on / off 'auto-brightness' in 'settings' but it won't go away. What am I doing wrong? Any advice gratefully received.
That folder with the question mark icon means that the MacBook can't find the boot directory. That can either mean it can't find the hard drive or the Operating System data on the hard drive is somehow corrupted.
Put your install DVD into the optical drive (CD/DVD drive) and reboot. As soon as you hear the boot chime, hold down the "c" key on your keyboard (or the Option key until the Install Disk shows up). That will force your MacBook to boot from the install DVD in the optical drive.
When it does start up, you'll see a panel asking you to choose your language. Choose your language and press the Return key on your keyboard once. It will then present you with an Installation window. Completely ignore this window and click on Utilities in the top menu and scroll down to Disk Utility and click it. When it comes up is your Hard Drive in the list on the left?
If it is then click on the Mac OS partition of your hard drive in the left hand list. Then select the First Aid Tab and run Repair Disk. The Repair Disk button won't be available until you've clicked on the Mac OS partition on your hard drive. If that repairs any problems run it again until the green OK appears and then run Repair Permissions.
If your hard drive isn’t recognized in Disk Utility then your hard drive is probably dead.
Maybe you are looking for
-
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??
-
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
-
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