LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview with Arduino Mega 2560

Hey Guys,

I hope this is not a repition of things that have been already inquired by others before.

So I started using LV with Arduino Uno few months ago (with the help of LIFA arduino files and LV package) and have had no notable problems as of such.

But now I have shifted to Arduino Mega 2560  and have changed the necessary inputs in my .vi file (that is from Uno to Mega) but there seems to be an error in establishing communication . It would be great if someone who has already tried it with Mega advice me on this matter.

Cheers!

0 Kudos
Message 1 of 9
(10,702 Views)

It really depends on the error.  If I had to guess, you forgot to change the baud rate to match the baudrate that is default in the firmware for the Arduino Mega 2560.  You have to set the baud rate to 9600.

However, I highly recommend that you switch to LINX since LIFA is no longer officially supported and has been officially replaced by LINX:  LIFA Replacement - LINX Officially Released

0 Kudos
Message 2 of 9
(7,594 Views)

Hey Nathan,

thanks for the prompt reply.

I checked the baud rate and it was 9600.So there is no error in it.

There is always an error in establishing the communication and it eventually times out.

I think LINX would eventually be the long term fix , however I am not  tempted to make the leap yet because all my code for the experiments have already been written and I have just changed the board.I had hoped that the changing of the boards would not be so problematic.

0 Kudos
Message 3 of 9
(7,594 Views)

So, did you get it fixed?  If not, what is the error that you are receiving?  Could you post your VI (this often helps tremendously)?

0 Kudos
Message 4 of 9
(7,594 Views)

Hey,

I have attached the image of the .vi file.

Its a very basic .vi which i use to read randomly generated float values to test the boards/my arduino codes.

The error is always in th initialisation so the "init" block.The error code is the classical 5002 .

Hope things are clearer now.

Cheers

labview_trial.jpg

0 Kudos
Message 5 of 9
(7,594 Views)

You have to set the baudrate to 9600 on the Init VI.  It will always default to the 115200 because the Uno is the default board.

Are you using the default firmware?  If yes then the command that you are addressing is the flush serial buffer command which does not send any data back.

0 Kudos
Message 6 of 9
(7,594 Views)

I had changed the board to Mega which has baudrate setting of 9600 and overwrites the 115200 for Uno.Just to be safe,I also put 9600 in the baudrate input.But still, the problem persists.

Yes, I am using the default firmware but I have altered it to send some random values besides syncing LV & Arduino.

0 Kudos
Message 7 of 9
(7,594 Views)

Choosing the Mega as the board type does NOT change the baudrate (unfortunately) and therefore you are required to manually set it to 9600, FYI.

You should try to test it using the default firmware (unmodified).  Otherwise, I can't help you further without seeing the modifications that you've made (since you are not using the default firmware).

0 Kudos
Message 8 of 9
(7,594 Views)

Thanks for your advice.Let me just try it with the default firmware and get back to you.

Cheers

0 Kudos
Message 9 of 9
(7,594 Views)