Interfacing with LabVIEW

Here are some building blocks to interface an mbed with LabVIEW, allowing LabVIEW programs to interact with the real world. This could be used for things like:

  • data acquisition in LabVIEW via sensors connected to mbed
  • controlling actuators connected to mbed from LabVIEW
  • LabVIEW programs with hardware-in-the-loop, where sensors and actuators are interfaced with mbed but calculations and control are in LabVIEW

We've created two ways for you to interface between LabVIEW and mbed.

  • LabVIEW RPC This allows you to directly control the mbed using the RPC. For many applications it wouldn't be necessary to write any custom code for the mbed.
  • Serial Communication These examples show how data can be transfered between the program running on mbed and your LabVIEW application.

LabVIEW Setup

To use mbed with LabVIEW, you need to have the NI-VISA drivers installed to give access to the USB serial port.

With LabVIEW and NI-VISA installed, you should be ready to go.

LabVIEW RPC

We've created a set of vi's that expose a lot of the mbed interface using RPC. The vi's we've created allow you to create and control new objects or control objects that are created in the mbed code.

The LabVIEW vi's

Here are the vi's that allow you to interface with the RPC and some examples of their use.

Relinking Files

When you download the files (especially the demos) they may not be in the same locations relative to the files they depend on as they were on the computer they were developed on. LabVIEW is very good at relinking files so just okay error messages or reconnect the files according to the locations in which you have saved them.

Using the LabVIEW RPC vi's

The LabVIEW vi's have been created to mirror the mbed api as closely as possible. They therefore take a similar object oriented approach. We create an mbed object and then using this create objects for each of the inputs and outputs. The vi's are contained in two folders:

  • The "mbed Interface" folder includes all the vi's for creating and controlling inputs and outputs on mbed.
  • The "Transport Mechanisms" folder contains the vi's for creating a connection to an mbed and then closing it.

We've provided the vi's as a zipped file which you can extract to any where on your computer. To make it a bit easier to access them we've also created a Library which might be a bit easier to develop with as you can drag vi's in from it. Just open the file mbed_LVlibrary from within LabVIEW.

Using the API

Information

To use these vi's your mbed needs to be running code which can receive and execute RPC commands. Information and examples of this, can be found on the Interfacing-Using-RPC page. Compile and run the program for RPC over serial to use the vi's on this page.

  • First create an mbed interface by using a transport mechanism. This can be either SerialRPC or HTTPRPC.

/media/uploads/MichaelW/ledserialsnippet.png /media/uploads/MichaelW/ledhttpsnippet.png

  • You can now create objects on mbed such as DigitalOut or AnalogIn. Wire up the input of a DigitalOut to the output from mbedSerial
    • To create an object connect controls or constants to the pin number. Pins are passed as a string eg "p21" or "LED1"
    • If you have an object created on mbed then you can tie to it by passings its name as a string into the existing object name.
  • You can now execute the methods that are defined in the mbed api. For example you can execute a write block on a DigitalOut to set the value of the pin. Wire the write block to the object you want to act on and then add a control to set the value of the pin.
  • Finally wire up the SerialRPC_delete method to the mbed wire so that the serial port is closed and is avaliable to other programs.

This is demonstrated in the LED flash example the block diagrams for which are displayed above. Note that only the write method is contained within the while loop as the object only needs to be created once at the start.

Using this approach you can connect multiple mbeds on different ports and control them from LabVIEW. The vi's have been designed to align as closely as possible with the api so looking in the Handbook should help explain what each method does. As its using the RPC the vi is directly calling the methods in the api.

Using RPC with Custom Code

The RPC-Interface-Library provides a mechanism for quickly adding RPC functionality to your own code. This LabVIEW library includes support for the RPCFunction and RPCVariable Objects. You can tie an RPCFunction or RPCVariable object to the corresponding object on mbed. You can then run the function or read and write to the variables which are attached. /media/uploads/MichaelW/rpcfunctionsnippet.png

The RPCVariable read and write blocks have both numeric and string inputs and outputs. You should wire to the appropriate one according to the type of variable it is corresponds with on mbed. The motor control IMU display demo at the bottom of the page show examples of these VIs in use.

Information

If you need to write your own entirely custom RPC command then you can use the RPC method that is part of the mbed class. Don't use the RPC methods in the Serial or HTTP class as this will prevent you from swapping transport mechanisms in the future. You can use this RPC method to create new interface classes. The name and method are passed as strings and the arguments are passed as an array of strings. /media/uploads/MichaelW/lvrpccmd.png

Serial Communication

Here are the mbed vi's we've created to communicate between mbed and LabVIEW:

  • mbed-ni.zip - mbed read and write VI's, plus Hello World examples

Download these and use them as components in your LabVIEW designs.

The Protocol

To keep things simple, we're assuming the communication between LabVIEW and mbed is a line-based text protocol. That means every "packet" between LabVIEW and mbed is a string followed by a newline character (\n). The mbed-read.vi returns a line read from mbed every time you run it, and the mbed-write.vi writes a string to the mbed every time you run it, so you can use this however you want.

Whilst the line string is the underlying data, there are also some common cases we've added support for such as sending single numbers, or comma separated value (csv) "packets". The inputs and outputs supported are:

  • A string (e.g. "hello" is transferred as "hello\n")
  • A number (e.g. 1 is transfered as "1.0000\n")
  • An array of strings (e.g. ["foo", "bar"] is transferred as "foo,bar\n")
  • An array of numbers (e.g. [1, 0.5] is transferred as "1.000,0.5000\n")

These make it easy to work in LabVIEW without having to do lots of packing/unpacking/conversion yourself.

mbed Read Hello World

A simple labview example is included that plots the state of an AnalogIn input, which looks like:

/media/uploads/simon/screen_shot_2010-07-29_at_22.45.23.png

And here is an example program to send some data:

» Import this program

00001 #include "mbed.h"
00002 
00003 DigitalOut myled(LED1);
00004 AnalogIn x(p20);
00005 
00006 int main() {
00007     while (1) {
00008         printf("%f\n", x.read());
00009         myled = !myled;
00010         wait(0.01);
00011     }
00012 }

The resulting output once the mbed COM port number has been selected in the VISA control, and when modifying AnalogIn, looks like:

/media/uploads/simon/screen_shot_2010-07-29_at_22.44.23.png

mbed Write Hello World

A simple labview example is included that controls the brightness of LED1 and LED2, which looks like:

/media/uploads/simon/mbed_write_example.png

And here is an example program that responds to the commands:

» Import this program

00001 #include "mbed.h"
00002 
00003 PwmOut myled(LED1);
00004 PwmOut myled2(LED2);
00005 
00006 int main() {
00007     while(1) {
00008         float brightness, brightness2;
00009         scanf("%f,%f", &brightness,&brightness2);
00010         myled = brightness;
00011         myled2 = brightness2;
00012     }
00013 }

The control panel looks like:

/media/uploads/simon/mbed-write_hello_world.png

Closed-Loop Motor Control Example - Serial Version

Here is an example of closed loop PID control of a motors position using LabVIEW. LabVIEW is very useful for experimenting with control because it allows you change the control constants on the go and you can graph the outputs of both demanded and actual response to see how well the control system is performing. Its also possible to pass any signal into your system as the demanded value, in this case a slider is used but this can be replaced with a function generator.

The basic serial version is for the serial examples is here:

» Import this program

00001 #include "mbed.h"
00002 #include "QEI.h"
00003 #include "Motor.h"
00004 
00005 Serial pc(USBTX, USBRX);
00006 QEI Encoder(p29 ,p30, NC, 48);
00007 Motor Wheel(p23, p21, p22);
00008 
00009 int main() {
00010     float MotorOutput = 0;
00011     Encoder.reset();
00012     while (1) {
00013         pc.scanf("%f", &MotorOutput);
00014         float NoPulses = Encoder.getPulses();
00015 
00016         float Percentage = (NoPulses / 48) * 100;
00017         pc.printf("%f\n", Percentage);
00018 
00019         Wheel.speed((MotorOutput - 50) * 2 / 100);
00020 
00021         wait(0.005);
00022     }
00023 }

Closed-Loop Motor Control Example - RPC Version

Also, RPCVariable objects can be used to pass the position of the wheel as a percentage of one rotation and the output to the motor. The Motor that has been used is from Pololu and includes an encoder. The wheel position is found using the QEI library and the motor is controlled using an L293D and the Motor library.

Here is the front panel and the block diagram for the LabVIEW vi. (Pictures of the setup coming soon!)

/media/uploads/MichaelW/lvmotorcontrolsnippet.png /media/uploads/MichaelW/lvmotorscreen.jpg

The red line shows the demanded value and the white line the actual motor position. As the motor has a gear box its quite slow and theres a lot of damping this means that the control is very simple and changing Kp just changes how long it takes to get to the demanded value. However at some values the porportional output to the motor becomes too low to actually drive the motor before it reaches the demanded position, in which case the integral control can be used elimiate the error.

Here is the code that was running on mbed for this demo.

» Import this program

00001 /**
00002 * Copyright (c)2010 ARM Ltd.
00003 * Released under the MIT License: http://mbed.org/license/mit
00004 */
00005 
00006 #include "mbed.h"
00007 #include "QEI.h"
00008 #include "Motor.h"
00009 #include "SerialRPCInterface.h"
00010 
00011 //Create the interface on the USB Serial Port
00012 SerialRPCInterface SerialInterface(USBTX, USBRX);
00013 
00014 QEI Encoder(p29 ,p30, NC, 48);
00015 Motor Wheel(p23, p21, p22);
00016 
00017 //Create float variables
00018 float MotorOutput = 50;
00019 float Percentage = 0;
00020 
00021 //Make these variables accessible over RPC by attaching them to an RPCVariable
00022 RPCVariable<float> RPCMotorOut(&MotorOutput, "MotorOutput");
00023 RPCVariable<float> RPCPercentage(&Percentage, "Percentage");
00024 
00025 int main(){
00026 
00027     Encoder.reset();
00028     float NoPulses;
00029     
00030     while(1){ 
00031          NoPulses = Encoder.getPulses();
00032         Percentage = ((NoPulses / 48) * 100);
00033         //RPC will be used to set the value of MotorOutput.
00034         Wheel.speed((MotorOutput - 50) * 2 / 100);
00035         wait(0.005);
00036     }
00037 }

IMU Demo

As well as control LabVIEW can also be used to visualise data in a much more intuitive way than just printing it to a terminal. This is the LabVIEW VI featured on Aaron's IMU page where its used to show the output from the IMU. Its gives a visual output which shows the measured orientation. Its then a lot easier to see what the values mean and how errors acumulate than when you're looking at a long list of figures at a terminal. The program running on mbed uses the example program on the IMU page but with a few changes. As the IMU class doesn't support RPC, RPCVariable objects were used to pass the yaw pitch and roll variables and so a few lines were altered in the example program:

//With the other object intialisations
float Roll, Pitch, Yaw;
//Now attach these varaibles to RPCVariable Objects
RPCVariable<float> rpcRoll(&Roll, "Roll");
RPCVariable<float> rpcPitch(&Pitch, "Pitch");
RPCVariable<float> rpcYaw(&Yaw, "Yaw");
SerialRPCInterface LabVIEW(USBTX, USBRX);


//And the while loop in main becomes
    while (1) {

        wait(FILTER_RATE);

        Roll = toDegrees(imuFilter.getRoll());
        Pitch = toDegrees(imuFilter.getPitch());
        Yaw = toDegrees(imuFilter.getYaw());

    }

This is the Block diagram for the VI which visualises the output.

/media/uploads/MichaelW/imusnippet.png




1 related question:


39 comments:

09 Dec 2010

It would be nice if somebody could re-save the vis that I can use them with LabView 8.2

06 Mar 2011

hi Simon, I need some help regarding Serial Port access. My data is coming via serial P28 and P27. Now i want that data via HTTP RPC. How to use Serial Block ?

Thank you, Vatsal

06 Mar 2011

Hi Vatsal

The best way access serial data on p28 and p27 using RPC really depends on what form that data takes and when and how it is receieved. There are really 3 ways to do this:

All of the RPC libraries such as the LabView one above or the JavaScript one allow you to create a serial port on mbed pins and then call the putc and getc methods (as well as the format methods etc). They work in eaxctly the same way as the classes for DigitalOut etc, you use the serial (note "Serial" not "SerialRPC") block and pass in the pin numbers or name of the serial object and then you use the "putc"/"getc" method blocks to commuicate over serial. There are also "gets" and "puts" blocks but I'd avoid using these if your data string has any spaces or nonalphanumeric characters as these are escape codes. Sending and reading individual characters would make this very slow over HTTP.

Alternativly you can use the RPCFunctions. These will allow you to create a function on med which reads your serial data and parses it into a string. The RPCFunction library has a custom handler so it will handle strings with any characters in, though there is a limit on length. This option is good if you need to say configure a sensor before reading the data from it. You can write a small function on mbed or use a library that has already been written to return the data. See RPC Interface Library for more details, there is an example using a range finder which is an example of I2C communication. In Labview you just use the RPCFunction block to set it up and then the run block to run the function on mbed.

Finally if your serial data parses into numeric values then you could use RPCVariables as in the motor example above. Code a while loop on mbed that regularly reads the serial data and updates the values of variables. Register these variables as RPCVariables and then you will be able to read the value from LABView.

Hopefully one of these options will be suitable, it entirly depends on what you are trying to read from and what form the data is. If you give an idea of what form your data is in, it will be easier to help.

Michael

06 Mar 2011

Hi Michal,

Thank you very much for your kind support. My data is coming from whole wireless sensor network.

Format of data is continues with 9600 baudrate in form of :

.Node:HUB0,Temp: 80.9F,Battery:3.6V,Strength:000%,RE:no .

.$0001, 87.6F,3.2,037,N#.

.$0002, 89.2F,2.5,035,N#.

.$0003, 96.2F,2.3,038,N#.

Now i want to analyse this data and display it in Labview.

So when it will detect HUB0 then it will show all temperature or other entities,battery volt and strength into it's fields. Data will end with "."

Now ".$" will start node 1 readings and end with "N#" and so on with others. Now i want to show separate readings in Labview.

I think RPCfunction and RPCvariable will be the right way to do so. But if i use Serial Block in Labview then it will be very easy to analyse the data.

Thank you,

Vatsal

30 Mar 2011

I just got done using my Universities LabView 9: File:Save For Previous Version in order to save the example VIs that only work on LabView 9 for my version of LabView 8.6. If anyone needs these versions I can email them or maybe publish them on the mbed site.

03 May 2011

Does anyone have those examples for LabView 8.5? Thanks!

19 May 2011

I have a question, in the first Hello_World programs, the code for mbed, is just scanf; printf; no Serial Object declared, but for the PID example, you declar a Serial pc object, why is that?

01 Sep 2011

i am unable to get the all the mbed VI to try out examples above .....which is my imp need in my project.... i hv installed labview version 11 ev. version.....i need mbed_read vi....bt I am nt getting it from above zips ....where i cn get mbed_read vi....i hv mbed vi of old version...so its nt loading..plz let me know if any one knows ......

04 Sep 2011

Hello, I may be repeating anohters question, if so please excuse me. In your example 'Using RPC with Custom Code' you show several vi's that are not in the libray. You call 'RPC Func' and 'RPC Func Run'. I dont see the 'RPC Func Run' in the library. Where is this file? I likewise do not see the 'RPC Variable Read' or 'RPC Variable Write Vis'. Where can I find these?

Thanks, Louis

05 Sep 2011

Hi Joby, the mbed_read as well as mbed_write are included in examples, I run vs.10 and they work automatically. I have perhaps a simple question but can't get through it so please help me somebody. I run this code:

#include "mbed.h"
#include "TextLCD.h"
#include <string> 

//using namespace std;
TextLCD lcd(p5, p6, p7, p8, p9, p10); // rs, e, d0-d3

string a;//float a;

int main() {
     scanf("%s", &a);
     lcd.cls();lcd.locate(0,0);
     wait(1);
      lcd.printf("%s\n",a.c_str());
      wait(0.5);   
}

When I take a number from LabVIEW it works but when I go for a string it doesn't. Do I need to have a library for string? I tried to get help from here: http://mbed.org/forum/helloworld/topic/1235/?page=1#comment-6047 Hope somebody can help. Cheers, Milan

05 Sep 2011

If your input is a float number shouldn't you change:

scanf("%s", &a);

for

scanf("%f", &a);

06 Sep 2011

Thanks Ernesto for reply, you are right when I input a float number I use %f and it works fine, I could even get a character %c but not a string %s. There must be a small detail I believe that I've missed. Milan

06 Sep 2011

Maybe it's because of the termination character. When you scan() for a String the end of line character (\n,0x0A) must be at the end of the string, or maybe return character, maybe that would help!

07 Sep 2011

Unfortunatelly did not help, I have seen the post about \n for strings and tried it even before. Looks like will have to go deeper into strings. Maybe here http://cplusplus.com/ Cheers

13 Sep 2011

Hello, Milan. Printf() and scanf() are from the original C language (not C++), so they are meant to work with C-style strings. Strings in C are not a built-in data type like int or float; they are just arrays of characters, with the last element in the array containing a null character (00h). Actually, C++ doesn't have a built-in string data type either. Strings in C++ are actually classes and are a part of the STL (Standard Template Library), which is why you have to include <string>.

As your code shows, you can extract the internal (private) C-style string from a string object using c_str(). That works in printf(), but I don't know of any workaround for using a string-class object in a scanf().

I've got a simple example using C-style strings to communicate between mbed and LabVIEW if you would like to see it. Let me know.

15 Sep 2011

Here is a program demonstrating serial communication between mbed and LabVIEW using C-style strings:

#include "mbed.h"
#include <cstring>

DigitalOut led1(LED1), led2(LED2), led3(LED3);

int main()
{
    char message[81];
    char first_word[21], second_word[21], third_word[21];

    // Get a line of text from a LabVIEW string control
    gets(message);
    
    //Scan line into three string variables in the mbed program (this program!)
    sscanf(message, "%s%s%s", first_word, second_word, third_word);
    
    // Confirm that the above process worked by sending some strings
    // from the mbed back to a LabVIEW string indicator
    printf("The first word was \"%s\".\r"
           "The second word was \"%s\".\r"
           "The third word was \"%s\".\r\n", first_word, second_word, third_word);
    
    // Use the extracted strings to control three LEDs
    if(first_word[0] == 'y')
        led1 = 1;
    else
        led1 = 0;
        
    if(second_word[0] == 'y')
        led2 = 1;
    else
        led2 = 0;            
        
    if(strcmp(third_word, "yes") == 0)
        led3 = 1;
    else
        led3 = 0;

} //end main()

This is the LabVIEW front panel and block diagram:

/media/uploads/bprier/lv-mbed_serial.gif

Using the string "yes no yes", as shown in the Write to mbed string control, the program will light LED1 and LED3. First, press the mbed reset button, then run the LabVIEW app. There is no looping in either program, so the mbed reset button will have to be pressed each time before running the LabVIEW program.

This mbed program also works with TeraTerm instead of LabVIEW. Just remember to press the mbed reset button before typing anything into TeraTerm.

15 Sep 2011

This is great Bob, thanks I see how easy can strings be used in ur code. Cheers, Milan

It works like a charm I can't thank enough. Now I can see the message from labview on my LCD display, amazing. Thanks for code provided Bob!

18 Sep 2011

hello, interesnting . I have the Labview and VISA installed in my PC, but I dont know how stars. I download the example "mbed Write Hello World", but appears me "Remember to open mbed-vi to configure the serial port!" and I dont know how and where make this.

18 Sep 2011

Lenin, Did you install the driver for the USB port? See Handbook >> Windows serial configuration. Carefully read steps 1 and 2, and the troubleshooting section that follows. You must have the mbed connected to the USB port before running the driver installation.

20 Sep 2011

user Bob Prier wrote:

Lenin, Did you install the driver for the USB port? See Handbook >> Windows serial configuration. Carefully read steps 1 and 2, and the troubleshooting section that follows. You must have the mbed connected to the USB port before running the driver installation.

yes,i did.I installed the driver for the USB port,even i am readindg dates of a accelerometer in tera term, but i want to comunicate with Labview , but i cant it. i am trying to make the "mbed write hello word" and "mbed write hello word", but I have not been successful.

21 Sep 2011

Hello Lenin, first of all you can not run tera term and labView serial port simultaneously only one at the time. All you said "Remember to open mbed-vi to configure the serial port!" problem means that you did not choose COM port on LabVIEW front panel, just click to VISA resouce selector and choose right COM#. That is it.

24 Sep 2011

user Renishaw Renishaw wrote:

Hello Lenin, first of all you can not run tera term and labView serial port simultaneously only one at the time. All you said "Remember to open mbed-vi to configure the serial port!" problem means that you did not choose COM port on LabVIEW front panel, just click to VISA resouce selector and choose right COM#. That is it.

user Renishaw Renishaw wrote:

Hello Lenin, first of all you can not run tera term and labView serial port simultaneously only one at the time. All you said "Remember to open mbed-vi to configure the serial port!" problem means that you did not choose COM port on LabVIEW front panel, just click to VISA resouce selector and choose right COM#. That is it.

How strange. I am running the labview separately, and I am selecting the serial port on the front panel, but nothing happens with the LED.

02 Oct 2011

Hello again Lenin. I was out of town last week. Would you please attach a screenshot of your LabVIEW program? Here is how I inserted the screenshots of my front panel and block diagram (above): First press Alt+PrintScr to capture the screen display of your LabVIEW code, and then paste it into Windows Paint using Ctrl+V (or Paste, on the Edit menu). After any trimming or editing, save it as a gif file. Then click "Insert images or files" (light blue text in the Post a new comment section), and click 'Upload file' (dark background). It will ask you if you want to insert the uploaded file, so say yes. If you say no, the uploaded file will be listed, and you can click the /media/uploads/bprier/select_button.gif button at the far left to select and insert the file. After closing the dialog box, click the 'Show preview' button (located below your comments). If you don't like the file that is inserted, backspace over its name in your comments to erase it and try again.

Also, include your mbed code. See "Editing tips" on how to do this.

02 Oct 2011

One possible way to obtain a copy of Labview to use with Mbed is to obtain a copy of the Student Edition of Labview. Sparkfun sells an Arduino Uno and Labview Student Edition bundle for $49.95. See: http://www.sparkfun.com/products/10812 But Sparkfun says "Note: Shipping to Canada and the USA only. Sorry world" The student edition can only be used for non-commercial applications and surprisingly does not require you to prove you are a student. I have tested the student edition with both Arduino and Mbed and it worked just like the developers planned.

Howard

05 Oct 2011

Ok Bob, this are the screenshots:

/media/uploads/RoboticaUdep01/dibujo1.jpg

/media/uploads/RoboticaUdep01/dibujo2.jpg

I am using LabVIEW 2009. I hope you can help me, thanks

05 Oct 2011

With mbedreadexample.vi i have the same problems.

05 Oct 2011

Hello Lenin,

on screen you can see the string output to mbed : "0,397959,0,397959". The mbed use the scanf function and separate numbers with "," so the mbed expect "0.397959,0.397959". These are two float numbers separated by ONE comma. Your string contain four integer numbers separated by commas. Try to change your adjustment for numbers on your PC. Change from "1,2345" numbers to "1.2345" numbers. Otherwise change software on mbed.

Best regards, Dirck

06 Oct 2011

user Dirck Sowada wrote:

Hello Lenin,

on screen you can see the string output to mbed : "0,397959,0,397959". The mbed use the scanf function and separate numbers with "," so the mbed expect "0.397959,0.397959". These are two float numbers separated by ONE comma. Your string contain four integer numbers separated by commas. Try to change your adjustment for numbers on your PC. Change from "1,2345" numbers to "1.2345" numbers. Otherwise change software on mbed.

Best regards, Dirck

Ehy!! Dirck, thank you very much, now the conection is cool!! XD.

.......... For change the decimal point, go to tool>options, then in Front Panel category deactivate "Use localized decimal point*" and go!

18 Jan 2012

Hi! I have a very serious problem and it took me at least 3 weeks thinking about a possible solution, but I didn´t find it yet. I am developing a HMI (Human Machine Interface) in LabView. The problem is that I need to send data from my MBED to LabView (with a Serial Interface, connecting USBTX and USBRX pins, so routing Serial Port over USB Port) with high speeds, without no successful. I try to run this simple program in my MBED, and read the data in LabView:

main.cpp

#include "mbed.h"

Serial pc(USBTX, USBRX);

int main() {
    
    char letter;
    
    pc.baud(921600);
    
    letter = 0;
        
    while(1) 
    {   
        letter = letter +1;
        pc.printf("%c\n", letter);
    }
}

Talking about the LabView code, I only put the "mbed read VI" (reading the Line String), whose information appears in the next link: http://mbed.org/cookbook/Interfacing-with-LabVIEW (below "Serial Communication").

I test the C++ code, reading what MBED was sending me, with TERA TERM at 921600 bauds, and it worked. So, I think that the problem is in LabView, but I don´t know where.

Could anybody help me ? Best Regards.

18 Jan 2012

It´s me again. In my post above I said that my application didn´t run in LabView. It´s false. It starts running, and after 5 seconds LabView stop receiving data and hang up. What´s the problem ?

In my opinion, I think that the problem is the Baud Rate. I have just probe to decrease this Baud Rate, knowing what´s the maximum speed that LabView can support (because I tested this program in TERATERM and it worked). So, the result was that the maximum speed supported by LabView was 38400bauds, but TeraTerm supported 921600 bauds. Any suggestion or advice ?? Thank you very much.

01 Feb 2012

Is there a proper documentation of the LV Library? The examples are ok to get in touch with the connection between LV and mbed, but where can I read what the VIs of the library are for? Thanks.

15 Feb 2012

I finally succeeded interconnect my IMU RMG146 module with Labview. :D

http://www.youtube.com/watch?v=GHAUbTg3Ksw

24 Feb 2012

For some reason my connection crashes to, for the moment I use the serial one. It works for a while, but after a random time (mostly within 5minutes) it crashes. I have used the 4 mbed-LED's + 2 'external' as outputs and 2 ADC inputs + 2 normal buttons.

Is there a way to 'reset' the connection, or avoid crashes/hang-ups

e/: The RPC-version works just fine :)

29 Mar 2012

user glenn loddewykx wrote:

For some reason my connection crashes to, for the moment I use the serial one. It works for a while, but after a random time (mostly within 5minutes) it crashes. I have used the 4 mbed-LED's + 2 'external' as outputs and 2 ADC inputs + 2 normal buttons.

Is there a way to 'reset' the connection, or avoid crashes/hang-ups

e/: The RPC-version works just fine :)

Hi glenn loddewykx, I dont know what is the problem with your communication, but my program crashed too and now i found the solution for my problem. Maybe it is like yours. Have a look ... http://mbed.org/users/rodmangon/notebook/serial-usb-read-write-baud-rate/

10 May 2012

I just want to be able to configure my mbed with labview using just a simple analog in function how am i able to establish that?

10 May 2012

I have just started looking at LabView, and using MBED as Snensor & I/O,

Some where above here, there is an example, of LabView reciving a string from MBED, and displaying it, but only one channel.

My question is:

How to use HID Interface with LabView,

This should speed up transfers, and make I/O significantly faster.

Has anyong got more experience in LabView to help us all.

Cheers

Ceri

20 Mar 2013

Hello,

I have a big problem and I don´t Know what can be happening. I am working with the IMU 6DOF. The code in the mbed and the Block Diagram in Labview are based in the IMU demo posted before. Everything is working fine, but suddenly a blue screen appears and the computer get turned off. It always happens after a while to be transmitting data. Anyone has any idea about what can be happening or what can I do? ... Sorry for my english... I need some help urgently please...

09 May 2013

Hello I have a problem with sending PWM RPC commands with labview.

PwmOut led4(LED4, "led4");

so far everything goes well i can enter in the browser and i get a led half shining

/rpc/led4/write 0.2

but i dont understand how to connect the different LABVIEW subvi to each other so i can make this work using labview. i have done so far: connecting PwmOut to PwmOutWrite but this doesnt work, a 1 makes led4 high but everything onder 1 gives 0. Anybody has an idea? thnx

12 May 2013

Hello,

With reference to the subtitle named "Closed-Loop Motor Control Example - RPC Version", the block diagram of Labview design below this title shows a special block for PID controller, I installed PID tool kit, but I am not able to find such block! Is this a customizable block? if yes, how it was designed?

Is it possible to provide the .vi file of that design.

Thanks in advance for your feedback. Hakam