LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read data on the Arduino Mega communication ports ?

Hi all,

I am using an Arduino MEGA board, and am trying to read data coming on the Serial ports.

Datas are coming on the Serial 3 port of the board, since I know the RX and TX pins are used for communication between LV and the board.

The datas are saved into a binary file.

I use the "Serial Port Read" function, but I don't think that it is doing the function I want.

Please find attached my VI.

Do you have any advice for me ?

Best Regards,

Oscar

0 Kudos
Message 1 of 7
(5,629 Views)

You need to add custom functions in LIFA (both firmware and LabVIEW) to use the serial communication functions.  I'm not sure how efficient it would be but I believe that it is possible.

Also, there is no function called "Serial Port Read".  There are "Anolog Read Port" and "Digital Read Port" but those just read 8 pins of the specified type simultaneously.

P.S.  When posting files here, please save it for LV2009 so that more people can attempt to help you.

0 Kudos
Message 2 of 7
(3,891 Views)

Hi,

Well actually it loiks quute complicated so i'm currently trying another method to communicate my datas between arduinos..

I'm trying to use the SPI bus. A first arduino (working with the arduino software) is sending datas through the SPI bus (it is the master), and a second one (working with labview)is supposed to collect the datas on the bus. To do that, i'm using the function "arduino spi read write" from the LIFA but it doesn't serm to work. I thik the problem is that the "arduino SPI init" function initialises the board as a master by default... Am I right ?

So do you have any advice for me, trying to transfer datas between arduinos ? The finality of this transmission is to save these datas into a binary fine..

Waiting for your answer,

Best regards,

Oscar

0 Kudos
Message 3 of 7
(3,891 Views)

Arduino will be the master to everything connected to it (except for LabVIEW) when using LIFA.  You have yet to explain what you are trying to do other than communicate between the Arduino and something connected to it.

0 Kudos
Message 4 of 7
(3,891 Views)

Ok, so let me explain what we are trying to do here.

A first arduino (working with the arduino environment) is supposed to pick up a photo (.jpg) (or any file) on a MicroSD card connected to the arduino through a shield. The access to the SD card and the files is not a problem, we can handle it easily. This same arduino has to transfer it to the second arduino with a wired connexion(for the moment we're trying with SPI). The second arduino, connected to labview, has to save the datas recieved (the photo for instance) into a file on the computer's HDD.

I hope it will be a bit more clear.

Once again, thank you for your help,

BRs

Oscar

0 Kudos
Message 5 of 7
(3,891 Views)

To do what you want to do don't use LIFa.  Instead use the serial interface capabilities of LAbview to connect to your second Arduino.  You could have Labview ask the second Arduino for the photo, the second Arduino would then retrieve the photo from the first Arduino and then the second Arduino would forward the photo to Labview.  Adding some complication to this task is the need to transmit binary data to Laviw. 

hrh1818

0 Kudos
Message 6 of 7
(3,891 Views)

Hi hrh1818 and thank you for your answer,

It looks an interesting point of view, but serms a bit complicated to me since I'm a newbie using LV... Actually, I've already thought about this option, and tried to have a look at the function "arduino lnit" for example, in order to see what was in there.. It seemed quite complicated to me..

I may try to use this method next week since it looks to allow more "freedom" to the user than using the LIFA, right ?

Anyway, thank you for your help

Oscar

0 Kudos
Message 7 of 7
(3,891 Views)