Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i send serial commands to USB mosquit I/O board?

Solved!
Go to solution

I recently bought a "Mosquit-IO" board from Trossen Robotics:

http://www.trossenrobotics.com/Mosquit-IO.aspx

 

It says all to do to control the servos plugged into the board is to send a command like:

255 25 42 69 25 42 69 /r

 

Where commands are sent at: 19200 baud, 8 bits , no parity, 1 stop bit, with RTS/CTS handshaking enabled.

 

I am trying to write a code to send these commands, but not having success talking with the board.  I am also just trying, using the "Basic Serial Write and Read" example from LabVIEW.  I'm even having no success with the example.  I believe if I can get labview's example to work, I can get my code to work.

 

When I send the commands on the "Basic Serial Write and Read" example, the command:

 255 25 42 69 25 42 69 /r

it turns into:

 255\s42\s69\s25\s42\s69\s25\s/r

 

but the servos do not move.

 

Can anyone help out?  

 

Thanks

0 Kudos
Message 1 of 3
(3,868 Views)
Solution
Accepted by topic author R0B0T

Hi,

 

I think you are mixing up data formats here. I guess that the you shouldn't send the ASCII string "255 25 42 69 25 42 69 /r" here, but the numbers represent byte values. E. g. the number 255 represents the maximum value of one byte, but if you put this value into a string and send it to your device, you effectively send three bytes with the values 50 (= ASCII value for the character "2"), 53 (= ASCII "5") and 53 (= ASCII "5"). /r is the symbol for carriage return which equals to a byte value of 13.

 

The best way to create your command string is to use a byte array (U8) and convert it into a string.

 

data conversion.jpg

 

The string is not human readable, but it represents the byte values of your commands.

 

I hope this helps,

Jochen Klier

National Instruments

0 Kudos
Message 2 of 3
(3,860 Views)
Awesome!  Thank you so much!  The servos work now.
0 Kudos
Message 3 of 3
(3,851 Views)