LabView

20 Jul 2010

Hi,

Do we have any LabView users around? We're putting together some building blocks to help mbed and LabView work together, and would be interested in some testers/feedback. Please shout here, or send me a personal message via my profile if you'd rather talk direct.

Thanks!

Simon

20 Jul 2010

I am interested in helping you test your Labview Mbed interface.  Yes I do have access to Labview.

 

Howard

21 Jul 2010

I use Labview and would be willing to test.   I am interested to know what exactly you had in mind in terms of an interface.

21 Jul 2010

I also use LabView and could run a few tests, what did you have in mind?

27 Jul 2010

I would definatly be interested.. please keep us updated on this endevor.

29 Jul 2010

Thanks for the interest!

OK, here is the start of a writeup with a first example with data going from mbed to LabVIEW:

It'd be great if you could have a play and see if it works for you. If you can feedback whether it works for you, plus any comments/suggestions, we'll aim to update further with transfers from LabVIEW to mbed.

Have fun!

Simon

08 Aug 2010

Hello Simon

The Labview Hello World Read and Write programs were very easy to use and worked just like you intended.

However, I have a questiion about the Labview Hello World PID program.  When using this program did you intend to have the user connect a motor and encodder to mbed?  If so what motor, encoder and motor driver would you recommend?  If not what were your intentions?

 

Thank you for all your hard work in creating the examples and making it look so easy.

Howard

 

23 Aug 2010

My application is actually centered around using the mbed with LabView, so these programs are actually somewhat helpful although I found them a bit late.   It's a nice start, but here's some recommendations if you want to make it a bit more robust.

The program runs, however it will throw an error if you attempt to read from the serial port when no message is available yet. This occurs in mbed.vi and mbed-read.vi .  I would prefer if the VI had a boolean "timeout occured" output or simply raised a flag to indicate whether a message is initially available.     If you use the Bytes at Port VI first to check how many bytes are available to read you can avoid this timeout error.

I like that you are creating self-contained read and write programs.    For good conventions, put the inputs on the left side of the VI icon and outputs on the right.   Document the suckers - the context help is really helpful in Labview so include information for that.

In mbed-write.vi you really ought to check for a number with "Equal to Zero" instead of "Not Equal to Zero" or better yet use some "Not"s on the other checks for empty inputs to make it consistant and easier for people to read.

You never close the serial VISA, which means that other applications will not be able to access the serial port.   It might make sense for you to create seperate initialization and closing programs if you don't want to open and close the port between every read and write.

The mbed itself communicates via serial by using putc and printf.   It would make a certain amount of sense to include LabVIEW functions that match these, like a getc and scanf function.   At the very least, you should probably allow the user to specify the termination character for the read function.

If you need any more help I can be of assistance.

Jimmy

 

24 Aug 2010

Hi Jimmy,

Take a look at some of the newer stuff appearing on http://mbed.org/cookbook/Interfacing-with-LabVIEW; hopefully this is getting much more comprehensive so would be great if you can have a play.

Simon

04 Sep 2010

Simon,

The RPC looks very cool.   First impressions: On loading it Labview immediately shows an error or warning that the dependencies have changed, shown at right.   Labview has difficulty finding the files necessary to run the VI.   I'm not quite sure how to resolve this, but maybe saving it as a project would help.    I tried booting up Demo.vi and immediately got an error because I hadn't selected my COM port.   You might want to add some error handling to the mbedSerial VI to produce a useful error message for beginners helping them to configure the COM port correctly.   The Flash LED and SineDemo VIs work well for me, but the Demo.vi program gets stuck.  I don't have anything connected to pins 13 and 14, and so the program locks up whenever Serial_gets is called.   I'm not sure why serial_readable outputs true in this case.

I haven't played around with it much to see if I can make programs of my own yet, but it looks well thought out.   I don't know a lot about RPC, but in terms of implementing it into other projects, it seems like a VI that can read or modify the value of an int or other variable stored in the memory of the mbed would be very useful.   Not sure if that's plausible or not.dependencies error

04 Sep 2010 . Edited: 04 Sep 2010

Hi Jimmy,

Thanks for the feedback of how you've found the LabVIEW RPC. Adding some error handling to make it more robust is a good idea.  In terms of the method of distribution for VIs we experimented with a few options and I'll have another look at alternatives.

I think the demo program might be locking up because for serial the standard idle state is high, as your rx pin will be low the mbed may be detecting data to read, though there will then be no end of line so it won’t return (I should perhaps add a note about this to the demo program or make it so that you can disable the serial port if you haven’t connected anything).

I've certainly found that a VI which allows you to read and modify the value of a variable in mbed using RPC would be useful, as would a VI which allows you to call functions that you've written on the mbed without having to make that function RPCable. I've done quite a bit work recently on this and hope to have some code for mbed and accompanying VIs which give this functionality ready soon.  

If you have any other ideas about things which would be useful for people using mbed and Labview or thoughts on the current set up then it would be great if you could post them up here

Thanks

Michael


13 Nov 2010

Hate to ask that ...

is there a chance of having a version supporting older versions of Labview?

I'm using 8.2 ...

I don't suppose You're actually using methods that are newly introduced. So this should be pretty easy ...

 

Christoph

20 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:

#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.

I don´t want to say 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 ?? Could anybody help me ? Thank you very much. Best Regards.

21 Jan 2012

Never been a big fan of tethering the mbed to the computer..

How about some automatic code generation of block diagrams :D