Jump to content

Sending command packet from LabVIEW


utaharrow

Recommended Posts

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.

Link to comment

QUOTE(utaharrow @ Apr 2 2007, 04:29 PM)

Hello,

I am trying to send the following command packet:

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

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.