LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Yun tcp/ip with Labview

Hi. Are you able to use labview to control an arduino yun using tcp/ip wirelessly?(For example turning on and off a relay) Has anyone done it before?

0 Kudos
Message 1 of 18
(6,256 Views)

Hi diver,

 

yes, LabVIEW can send messages using the TCP/IP protocol…

Is your YUN able to receive them?

Which message format is expected? Which commands are expected?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(6,247 Views)

Honestly I am totally new to TCP/IP . I have no clue what I have to do. Are there any basic examples on the arduino IDE and labview? 

0 Kudos
Message 3 of 18
(6,241 Views)

Hi diver,

 

you already have been pointed to an arduino forum - which answers have you got there?

 

For LabVIEW TCP/IP example VIs you only need to start the example finder…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 18
(6,233 Views)

I went to the arduino forum but nobody replied to me. So I came here to seek for help.

0 Kudos
Message 5 of 18
(6,217 Views)

How can I send a message over to my arduino yun? I went online to check but I could not find anything.

0 Kudos
Message 6 of 18
(6,211 Views)

OK, so you'll need to write two bits of software - your Arduino Sketch and the LabVIEW code. You'll need to think about which piece of software will be your 'server' (listens for a connection on a specific port) and which one will be your 'client' (establishes the connection). Once you've established the connection, either the server or client can send/receive data at any time. 

 

You will also need to define a communications protocol - this is the series of commands you send/receive to make things happen. For simplicity, I'd recommend a simple ASCII string protocol (for example: RELAY ON). You'll also need to determine the termination of the TCP/IP commands - this is commonly done using the CRLF character sequence or by prepending the TCP packet length to the data before sending and when you receive you read the 'length' bytes first and then the data.

 

For the Arduino side - I'm sure you'll find lots of example sketches of how to do TCP/IP communications.

 

For the LabVIEW side - look in the LabVIEW examples and you'll find a simple client/server example which shows LabVIEW acting as both a TCP server and TCP client.

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 18
(6,196 Views)

ok but how can I get started? Do I have to use an ethernet cable for my arduino yun? Or just the power source will do? How do I determine which tcp port to use? I am so confuse right now.

0 Kudos
Message 8 of 18
(6,184 Views)

Well the Arduino Yun does have Wifi interface on board, so strictly speaking you won't need an Ethernet cable if the Wifi connection is properly setup and working and connected to the same subnet as your computer. Personally I find these embedded devices always to work better through a wired connection, at least during development.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 18
(6,164 Views)

Is there another way which I could control my arduino yun with Labview GUI wirelessly?

0 Kudos
Message 10 of 18
(6,132 Views)