From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing Ardupilotmega with Labview with Mavlink Protocol

Hello,

 

I am trying to use Labview to read a Mavlink data stream (http://qgroundcontrol.org/mavlink/start) from an Ardupilotmega UAV board (http://code.google.com/p/ardupilot-mega/). I would then link to pass this data stream over the internet via a TCP connection onto my ground station computer with labview and create a front panel displaying the information. The Ardupilotmega UAV board outputs the data stream via a serial connection (Xbee) telemetry port. I am trying to read this serial port via a UART port on a EPIA P830 Pico ITX (http://www.e-itx.com/epia-p830-12l.html).

 

As far as I understand Mavlink protocol is just a C-strut header library, however I do not know how to use labview to send Mavlink commands over a serial connection to the UAV board. I do not understand the required protocol. Especially the data stream, I do not understand how labview handles and processes a data stream over a serial connection. Here is some info on Mavliunk:

 

b15e6d130c9d606305c31ffedb3c1118_media_400x98.png

 

http://code.google.com/p/ardupilot-mega/wiki/Protocol

 

https://pixhawk.ethz.ch/mavlink/

 

Can Labview handle this? I understand labview well, however this sort of custom serial communication protocol is beynd me. I cannot find anything on the internet about mavlink inside labview.

 

Thanks in advance,

Physicsnole

0 Kudos
Message 1 of 75
(13,589 Views)

If it's a serial connection you'd use VISA to send/receive a stream of bytes. With the VISA functions you use strings to represent the stream of bytes. How you create the sequence of bytes is up to you. One suggestion is to create an array of U8 values (each being a byte in the message) and then using Byte Array to String to create a string that you can pass to VISA Write. The reverse can be done with VISA Read. The protocol seems to be well-defined, so you can create your sequence of bytes for each message that you want to send. You can make this a rigid or as flexible as you want. I.e., you can have subVIs for each message type that contains controls for the various values of the parameter for the command, and the VI will create the payload. That array of bytes can be passed into a VI that prepends the other bytes of the frame (such as the STX bytes, LEN, etc).

 

Examples have been posted before on doing this kind of messaging.

0 Kudos
Message 2 of 75
(13,551 Views)

hey...

 

i worked on a labview - mavlink 1.0 interface too ...

 

so here is a simple Mavlink Read example ...

it´s without CRC check , it only check the payload lengh .. but it works ...

 

maybe anybody can ad a CRC check .. or maybe i do it self in any time ....

 

And i know ... The code is a litle bit horrobil an confuse ... Maybe later i clean it up ... But the mainthink is that it´s work...

 


https://www.dropbox.com/s/qm8kpvc1k8cwna2/Labview%20Mavlink%201.0%20Read.rar 

0 Kudos
Message 3 of 75
(12,447 Views)
0 Kudos
Message 4 of 75
(12,338 Views)

A another cleaned up Version ...

 

With auto Buffer Memory or so .. ???  ...

 

I think i self don´t understand this what i do right ... Take a look

 

https://www.dropbox.com/s/ownyc1n8g171qjz/Mavlink%20Read%201.1.rar

0 Kudos
Message 5 of 75
(12,294 Views)

Please stop linking to some odd third party site. If you have code that you want someone to look at, attach it to your post.

0 Kudos
Message 6 of 75
(12,288 Views)

Hello Dennis,

I am I very active labview user but fairly new to this type of serial communication. I am having some diffulty setting up my LabView serial communication port with Ardupilot 2.5. Hoping you can help out 

 

When I use APM software(Mission Planner MAV 1.0) I am able to see all the data from my UAV, with very little drop outs. But I close APM software and start Labview2013 and try to read the serial port with the very basic code below. I get notting but junk data, as if I am decoding it wrong. I think its somthing simple but just can't figure it out. Any help would be greatly appreciate.

 

Thanks

Jose

 

DATA looks like this:             œx}DÂ?ð

0 Kudos
Message 7 of 75
(11,933 Views)

Hey all, this is the exact same thing that I have been working on. 

I'm currently implementing checksum today.

 

Jose Linares, right click on the display where you get junk data, and check display HEX. you will get useful data.

 

I ended up using convert to byte array and pulling the array data for numerical analysis.

 

daniel did you figure out how to implement the checksum? to me the original code looks like its doing several XOR and logic shifting for crc... I'll be trying this evening.

0 Kudos
Message 8 of 75
(11,924 Views)

here is what we have so far. I am very very new at labview, and this took me forever 🙂

0 Kudos
Message 9 of 75
(11,918 Views)

This is what I just wrote for checksum. It is not giving me the right checksum for the packet at hand... Any ideas anyone?

 

0 Kudos
Message 10 of 75
(11,897 Views)