LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send and recive data from serial port 1 ,2 o 3 and USB (virtual Comm) for PC MEGA 2560

Hello People,

I already connected the arduino and LabView, I just want to send data from LabView to MEGA 2560 by USB (that is OK) and send that data to another serial port i.e. Tx1 Rx1 for exchange data from two 2560 and one of them connected to LABVIEW by USB.

RichardHG2016

0 Kudos
Message 1 of 10
(4,348 Views)

Hi Richard,

 

which COM ports are you talking about?

When these are ports on your Windows PC: just use their VISA alias!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,340 Views)

They should talk much the same way that your Arduino does.  You just have to know the command/data protocol for the instruments you are trying to talk with.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 10
(4,310 Views)

Hi GerdW,

I send you two pictures, The link labview Mega 2560 A is OK, but from LabView I want to send data to another Mega 2560 B, in the picture you can see, I do not know how to map other serial port to send and recive data from MEGA 2560 B.

 

Best regards

Richard

Download All
0 Kudos
Message 4 of 10
(4,283 Views)

Hi Gerd,

 

Looks like youre trying to send data from labview to Mega A and then Mega A and B will be communicating with eachother over seial.  If youre using the labview add on to write the code for both Megas youll need a second USB for the mega B to labview.   Correct me if im wrong, but you cant upload code to the arduino as a real time target if running the labview add on?

 

Matt



-Matt
0 Kudos
Message 5 of 10
(4,276 Views)

Hi Matt,

LabView only knows about Mega_2560_A, the Mega_2560_B has a firmware that if any digital input change send that change by serial to the other 2560_A, and that Mega reports that change to the LabView, because labView is linked by USB for the Arduino Mega that is Serial Tx0 and Rx0, the 2560_A recived information in the serial  Tx2Rx2, and that is what I want to see, also from LabView push a light,  2560_A send that information to the 2560_B by serial Tx2Rx2 (I just want to turn on a light connected to 2560_B)

, the firmware in the Mega_2560_B to do that is very easy. I was thinking to change the firmware we have to load to the Mega_2560_A but I am not sure if that the best option for do this.

 

Best Regards.

 

Richard.

 

0 Kudos
Message 6 of 10
(4,273 Views)
Richard,

I'm a little curious why you need two arduinos. Is there an application running on B that you don't want to rewrite with labview? It sounds like you're having trouble having setting up the communications between A and B in labview correct?


-Matt
0 Kudos
Message 7 of 10
(4,268 Views)

Matt,

In my house there are two main areas, so I want to implement the control system but I need the two Mega 2560 interchange information between them.

The 2560_A with LabView is the master and the other is the slave, I do not want to connect another laptot to 2560_B.

 

you're having trouble having setting up the communications between A and B in labview correct? that´s right.

 

Thankyou in advance

 

Richard.

0 Kudos
Message 8 of 10
(4,257 Views)

Richard,

 

Well for one make sure you cross the RX and TX for each board, didnt see that in your diagram, then youre going to have to know the data you want to send, then build the packets and send it out over the correct digital pin.  You can research how to build those packets, but could be a lot of work. One thing you could do instead is create a server for mega B and control the tasks with the digital IO between the boards.



-Matt
0 Kudos
Message 9 of 10
(4,240 Views)
Hi Richard, You need some firmware changes to be done in MEGA 2560 A. i.e you write Mega 2560 B data to A when A receives it compare data whether it is A OR B if the Data is for A process it over there,If the data is for B simply Send that data over Max 232 serial port to B i thought this was your requirement judge me if i am wrong
Venugopal
0 Kudos
Message 10 of 10
(4,210 Views)