LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect bluetooth module with arduino (LIFA BASE) and LabVIEW

Hi; I have a little problem.. could you tell me how can I connect BT module, arduino with LIFA BASE and Labview?  I'm trying to establish a communication (android app) with arduino that can control a relay module and this can be made between labview and arduino. I know that is impossible establish a communication with the same COM port. am I wrong?

thank you.

Message 1 of 10
(9,217 Views)

You can't connect to the Arduino via LIFA and Bluetooth at the same time using LIFA.  LIFA is only designed for a single control method (LabVIEW).  It would probably be possible to control it from both the computer and the smartphone but it would need to be entirely custom code (in the Arduino and in LabVIEW).

What exactly is your scenario?  If you explain how you need your system to work (why do you need the PC and LabVIEW?, etc.), it will probably be easier to suggest a possible solution.

0 Kudos
Message 2 of 10
(5,058 Views)

I'm going to control the on/off wirelessly of two valves using a relay module using xbee point to point connection, one xbee is connected the pc with labview and the other xbee to arduino module so the control can be done using a app through bluetooth only if the person is near to the tank and far to the control center.   

0 Kudos
Message 3 of 10
(5,058 Views)

I understood all of that from your diagram that you originally posted.  I was asking questions to find out what you were using LabVIEW for.  Are you doing closed-loop control?  OR Are you just receiving data?  OR Are you simply just sending commands to open and close your relays?  OR Are you sending commands and reading data?

It sounds like you might just be sending commands.  But, if you are sending and receiving commands or doing closed-loop control, that would make things more complicated.

So, if you still wanted to use LIFA or LINX, you would need to add all of the bluetooth code to the firmware in such a way that does not interfere with the operation of LIFA/LINX.

I've not worked with something like that before so if you have Arduino code that works with the Bluetooth, that might be helpful.

0 Kudos
Message 4 of 10
(5,058 Views)

I'm just sending commands through LabVIEW.. I'm using a VI that you've posted time ago to control differents ultrasonic sensors (i'm using HC-04) all operations is done by VI.. but in the moment that app send a command to BT module labview will receive data? am I correct?.

I'm going to modify my VI for now use LINX.. so the arduino code for bluetooth I modified LIFA BASE and works fine without the VI is connected..   

0 Kudos
Message 5 of 10
(5,058 Views)

You can't use both LIFA/LINX and the bluetooth because they both use the same serial communication lines.  They would need to be on different Serial ports.

The Arduino Uno only has a single hardware Serial port but the Arduino Mega 2560 as four.  IIRC.  I've read that there exists a software serial port but I'm not sure how reliable that will be in this case (but would be your only option if using an Arduino Uno).  If you have the Mega 2560, you can simply hook your bluetooth upto one of the other serial ports (and changing the code likewise).

mdperez_ec wrote:

but in the moment that app send a command to BT module labview will receive data? am I correct?.

I don't understand the question.

0 Kudos
Message 6 of 10
(5,058 Views)

Thanks for your answer! I'm working with a mega board, how can read the other serial portsince labview? the VI suffer a change? I initialize the init.vi (of arduino package with COM3 that appears in device manager in my SO) should I need to create a routime in VI to read the data from bluetooth?

0 Kudos
Message 7 of 10
(5,058 Views)

LabVIEW would need to use the default serial port.

In the configuration that you have described, you cannot access the bluetooth from LabVIEW.

I've not used it but have you looked into the LabVIEW Data Dashboard for Android/iPhone?

0 Kudos
Message 8 of 10
(5,058 Views)

thanks for your anwer!! No, but it seems a viable solution, I'm going to see examples about LabVIEW dashboard.. if I could control two buttons and see the volumen that would be perfect!!

0 Kudos
Message 9 of 10
(5,058 Views)

Earlier Nathan said "LabVIEW would need to use the default serial port.".  But on the Arduino Leonardo the default serial port does not use physical pins 0 and 1.  An excerpt shown below from the following link describes the difference.

<http://arduino.cc/en/Guide/ArduinoLeonardoMicro?from=Guide.ArduinoLeonardo>

On the Leonardo and Micro, the main Serial class refers to the virtual serial driver on the board for connection to your computer over USB. It's not connected to the physical pins 0 and 1 as it is on the Uno and earlier boards. To use the hardware serial port (pins 0 and 1, RX and TX), use Serial1. (See the Serial reference pages for more information.)

Hence the Arduino Leonardo is good candidate for control from two different sources. And yes a sketch needs to be written to enable two sources to control the Arduno Leonardo.

hrh1818

0 Kudos
Message 10 of 10
(5,058 Views)