utaharrow Posted April 3, 2007 Report Share Posted April 3, 2007 Hello, I am trying to send the following command packet: $78 $11 $02 $06 $72 $00 to a picoboard which will control four servos. The command packet will be sent through a RS 232 serial port. The values in the command packet are in hex? The first number is the Servio's (board) default address. the second number is the port number. the third is the servo function command. the fourth and fifth are the positioning of the servo in 16 bit hex format with the most significant bit first. the sixth is the speed with which the servo should move. An example of using the above packet is provided in the user manual (pages 12-14). the manual is available from http://www.picobotics.com/ServioManual.html. I have tried sending the packet as it is...but my servo does not respond. Am i missing something? Do i have to use some converter in LabVIEW to send the packet? I would be grateful for any input. Thanks. Quote Link to comment
LAVA 1.0 Content Posted April 3, 2007 Report Share Posted April 3, 2007 QUOTE(utaharrow @ Apr 2 2007, 04:29 PM) Hello,I am trying to send the following command packet: $78 $11 $02 $06 $72 $00 to a picoboard which will control four servos. The command packet will be sent through a RS 232 serial port. The values in the command packet are in hex? The first number is the Servio's (board) default address. the second number is the port number. the third is the servo function command. the fourth and fifth are the positioning of the servo in 16 bit hex format with the most significant bit first. the sixth is the speed with which the servo should move. An example of using the above packet is provided in the user manual (pages 12-14). the manual is available from http://www.picobotics.com/ServioManual.html. I have tried sending the packet as it is...but my servo does not respond. Am i missing something? Do i have to use some converter in LabVIEW to send the packet? I would be grateful for any input. Thanks. If you attach what yo have tried that would make it much easier to help you. With the information you have provided my best guess is that you are writing the ASCII representation of the HEX values. Right click on the string control or constant that is feeding the VISA write (or Serial) and select hex display then enter your hex value. http://forums.lavag.org/index.php?act=attach&type=post&id=5385 Quote Link to comment
Mike Ashe Posted April 4, 2007 Report Share Posted April 4, 2007 Post your VI here, the one that you have tried and are having trouble with. Secondly, don't post with all bold or caps, it is considered shouting on forums and rather impolite. Quote Link to comment
utaharrow Posted April 7, 2007 Author Report Share Posted April 7, 2007 I have attached the block diagram of the labview program i am using to send signals to the servo board. I tried to do what was mentioned, but the servos still dont respond. Is there a way of converting the Hex command into binary and then passing it through the VISA block? And sorry about the bold text, i didnt realise it could be taken as shouting. I do apologise. First time using a forum...so am learning. Many thanks. here is the diagram again Quote Link to comment
crelf Posted April 9, 2007 Report Share Posted April 9, 2007 This may or may not help, but take 30 seconds to check that your port settings are correct - it may look like communication is working even when you've got something wrong (baud speed, stop bits, etc). Quote Link to comment
Ton Plomp Posted April 9, 2007 Report Share Posted April 9, 2007 QUOTE(Mike Ashe @ Apr 8 2007, 12:42 AM) Are you using the 4.5 manual or the 6.0? QUOTE(utaharrow @ Apr 8 2007, 12:09 PM) That happens even if I write the packet using the 16 bit format i.e. 0078 0011 0002 0006 0072 0000. Why use a 16 bit format? just send '7811 0206 7200' The manual (V6) states (p. 8): QUOTE Command Packet: Throughout this manual, references to “command packet†or “Packet†means; the address byte, followed by a pin number and one configuration byte, followed by a number of data bytes (if any) to form a complete command string. Also the $ means hex (weird notation but hey): QUOTE Hexadecimal Base: Hexadecimal number system or “hex†will be used throughout this manual. $ will be used as a prefix to any hex number (i.e. $1F). Sometimes, hex numbers are represented by attaching an h to the end of the hex number (i.e. 01h) or a 0x at the beginning (i.e. 0x2E). If you do not know hex base, you should learn it. You will not be able to do much without this knowledge when dealing with computers. It’s a bit awkward at first since we think in decimals, but like anything else, practice makes perfect. All data sent to Servio must be in binary format. NOT ASCII characters. One reason for this choice was because it’s the quickest. It takes one byte to represent numbers up to 255 decimal ($FF) using RAW binary data as opposed to 3 bytes, using ASCII character strings (2,5,5). By the same token, it takes 2 bytes to represent numbers up to 65535 ($FFFF) with binary as opposed to 5 bytes in ASCII characters (6,5,5,3,5). Also have a look at the Pacing (in between those definitions). After having read/writing this I begin to wonder if you have RTFM'd? (esp. the explanation of your example is pretty clear about the hexability of the $) Ton Quote Link to comment
utaharrow Posted April 11, 2007 Author Report Share Posted April 11, 2007 I did follow what the example said...i didn't get any response from my servo. I thought maybe writing it in a different format might help. I was also wondering...the example is for PBasic...not LabVIEW. Could that be a reason why....when i send '7811 0206 7200'....the LED blinks once? i.e. the message format is going through using LabVIEW. Quote Link to comment
jbrohan Posted April 11, 2007 Report Share Posted April 11, 2007 This is for a Lynx Motion robot. values are 0-255 in 1 byte. It takes the array of values and then casts it to a string (the only hting that can be output to a port). Good Luck John Quote Link to comment
Ton Plomp Posted April 11, 2007 Report Share Posted April 11, 2007 QUOTE(utaharrow @ Apr 10 2007, 07:31 PM) I thought maybe writing it in a different format might help. I was also wondering...the example is for PBasic...not LabVIEW. Could that be a reason why....when i send '7811 0206 7200'....the LED blinks once? i.e. the message format is going through using LabVIEW. So does it work? Have you tried other commands? (one on a digital line is easy to verify with a mulit-meter) Ton Quote Link to comment
utaharrow Posted April 12, 2007 Author Report Share Posted April 12, 2007 QUOTE(tcplomp @ Apr 10 2007, 10:11 PM) So does it work?Have you tried other commands? (one on a digital line is easy to verify with a mulit-meter) Ton I did try other commands...i changed the port number ( and made sure I connected the servo to the chosen port), the position and speed, but i still get the same response...one blink of the LED. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.