Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Ethernet to transfer data using cRIO

Hi, I want to transfer data from cRIO to another device using the Ethernet port. The CompactRIO model I have is NI cRIO-9063, which does not have the PoE ports. 

For example, I want to send data from cRIO to another cRIO using Ethernet port. Is it possible I could do so using TCP protocol? Are there any example VIs? 

Thank you.

0 Kudos
Message 1 of 12
(4,512 Views)

You can try using web services. But this won't work for streaming data. Here's a description:

https://www.ni.com/docs/en-US/bundle/labview/page/overview-web-based-communication-with-a-labview-ap...

https://forums.ni.com/t5/LabVIEW-Web-Development/Getting-Started-Series-Hosting-Web-Service-on-a-Rea...

 

Also, if you add both devices to one project, you can use network shared variables:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2CMCAY&l=ru-RU

 

 

0 Kudos
Message 2 of 12
(4,503 Views)
0 Kudos
Message 3 of 12
(4,454 Views)

Hi. So I was able to send data from one computer to the other via Ethernet using UDP Example VI (not TCP).

However, the only way I could send the data was if I set the address in "UDP Write Block" from the Sender VI to 255.255.255.255.

If I set the Ethernet IPv4 Address that I set on the other computer, it would not work.

I have attached an image where it seems I'm getting the problem in acquiring the right address.

Please advise. Thank you!

0 Kudos
Message 4 of 12
(4,439 Views)

UPDATE:

I was also able to send UDP data via Ethernet by auto-configuring its IP Address and using that IP Address. However, the same approach was not possible through TCP. 

0 Kudos
Message 5 of 12
(4,432 Views)

Launched examples for UDP. On one device, I send messages via UDP. On another device, I receive these messages. In my case, a similar example works.

 

UDP_SND.PNGUDP_RCV.PNG


Have you tried pinging between your devices?
Run->Cmd-> ping <IP_your_device>  

Do you find the device you need when you enter the command "arp -a"? (Run->Cmd-> arp -a)

Are your devices on a shared subnet?

0 Kudos
Message 6 of 12
(4,428 Views)

Can you send and receive data over UDP using a terminal? For example Hercules:

 

UDP_Hercules.PNG

 

 

0 Kudos
Message 7 of 12
(4,426 Views)

Hi karlin.

I was able to use UDP. And yes, I tested it with Hercules and it worked there as well, however, when I tried to replicate the same process via TCP, I was unable to send data. However, I believe this would work fine for my project. i.e sending data from cRIO to another device.

I will test that soon. Thank you for your help!

0 Kudos
Message 8 of 12
(4,422 Views)

Hmm. When I make a remote device (in my case TPC2230) a server everything works.

 

TCP_TST.PNG

 

But when I make my PC a server, it becomes impossible to establish a connection.

Perhaps this is the fault of the firewall settings. All ports on my PC are closed for incoming connections.

 

P.S. Please call me "Egor"

0 Kudos
Message 9 of 12
(4,418 Views)

Hi Egor, 

Same here. I even disabled the firewalls at both ends, the problem persisted.

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