LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send data from Labview to Arduino with Ethernet shield using TCP

Solved!
Go to solution

Hi everybody !

 

I have to realize a communication (TCP IP) between an Arduino with an Ethernet shield and Labview WITHOUT LIFA 

I realized the transfer from arduino to Labview without problem but I can't do the opposite. 

So I need help, please.

I use Labview 2016 and an Arduino Uno with the Ethernet shield W5100

 

Here are the different documents (Labview 8.0).

 

Thanks a lot !

Download All
0 Kudos
Message 1 of 12
(10,592 Views)

I don't see you trying to read with the Arduino.


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 2 of 12
(10,565 Views)

I read with the serial monitor. 

I use Serial.println  in order to see the data with the serial monitor on the arduino but I have always the same data (here -1) even by changing the data from Labview.

0 Kudos
Message 3 of 12
(10,547 Views)

Your VI is doing a TCP Write.  Your Arduino code is doing a TCP Write.

 

I don't see either one of those doing a TCP Read.  Both are talking, neither one is listening.

0 Kudos
Message 4 of 12
(10,524 Views)

Hmm... If Arduino is client, then it should be connecting to server. Then LabVIEW (server) should wait till Arduino connects to it.

If Arduino is server and LabVIEW connects to it (works as you said), then Arduino server should read what Labview is sending to it. Should not ArduinoTCP.read(...) return what LV is sending it?

 

0 Kudos
Message 5 of 12
(10,509 Views)
Solution
Accepted by topic author chessgollum

Hello,

 

I solved my problem. The problem was the port number and the activation of the TCP for the VI (open tools/options/VIServer and active and use the port 3363 with the arduino).

 

Here are my VI and Arduino code for read and write and activation of a led (when the data is 1 in Labview). 

 

Have a nice day !

Download All
0 Kudos
Message 6 of 12
(10,464 Views)

Hello - I am not sure if this thread is still active, if it is...

 

I am trying to do the same type of thing, however, when I ran both the labview code and the arduino code I am stuck on the LabVIEW side with Error56, a TCP Read Error. Any fixes for this? I know the ports and IP addresses are correct, as well as the same information on the Arduino side, any help would be much appreciated! If this does not work, are there any other examples that could perform the same task?

 

Thank you! 

0 Kudos
Message 7 of 12
(8,980 Views)

Hello BenKnht,

 

I don't work on this project anymore and my license for Labview expired. However I can try to help you if you show your code or a picture. I think I have an other project using the TCP communication but I have to find it 😛
I'll make some researches for it this weekend.

 

Have a nice day !

0 Kudos
Message 8 of 12
(8,972 Views)

Thank you, I will do that soon. Just a few questions first,

 

Labview will act as a client and the arduino as the server, therefore the IP address on labview needs to be the address of the Ethernet Shield? I am running these through a switch box, not a router, I was using the IP address from my desktop into the switch in the labview part of the code. Perhaps this is my error? I do not have much code as I have been trying everything I could find arduino side, but should I go ahead and use a chatserver example for the arduino IDE code? 

Thank you so much! 

0 Kudos
Message 9 of 12
(8,956 Views)

Hey i am currently trying to use an arduino mega over tcp to labview. Did you ever find the code you wrote for it?

0 Kudos
Message 10 of 12
(7,360 Views)