data sharing from host to cRio

4 posts / 0 new
Last post
Offline
Last seen: 2 years 11 months ago
Joined: 03/12/2021
Posts: 10
data sharing from host to cRio

Another "just getting started" question

The "hello world" examples on youtube show how to share data between vis running on the same computer

The DDS cRio example that is installed with the toolkit shows how to share data between two vis running on a cRio (which is pretty much the same)

Both of those situations run fine for me

What would be useful is to share data between a host computer and one or more cRios.  So I put a Simple Writer on a cRio, and a Simple Reader on a host computer, but that's not working. No errors on either, data is just not shared. 

Is there an example out there of how to do this?  Am I just missing a step?

 


Thanks

Keywords:
Ismael Mendez's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 07/03/2017
Posts: 74

Hi jwebster8,

That is happening because the different devices can't discover each other. There are different scenarios where this can happen:

- cRIOS and the PC are not in the same network.

- Network has multicast disabled.

- cRIOs are connected to the PC through Ethernet via USB. In this case, devices are not in the same network.

- Windows Firewall (or a different firewall) is blocking communication.

Connext DDS uses multicast to discover other devices in the same network by default. But it is also possible to set a list of initial peers that Connextdds will use for sending discovery data (method recommended especially if using Ethernet via USB). Can you try setting the cRIO as an initial peer in the PC by using an environment variable? To do it you can set the environment variable NDDS_DISCOVERY_PEERS=<cRIO ip> and then run LabVIEW. If you don't know how to do it do the following:

- Open a cmd

- Write "set NDDS_DISCOVERY_PEERS=< your cRIO ip>"

- Launch LabVIEW from the same cmd

- Try if there is communication.

You can also set environment variables permanently in the Windows control panel. There are different ways of setting the initial peers. You can see them in section 14.2 "Configuring the Peers List Used in Discovery" of this manual.

If it works and all the devices are in the same network, most likely is a multicast or firewall issue.

 

Offline
Last seen: 2 years 11 months ago
Joined: 03/12/2021
Posts: 10

Thanks. Setting the environment variable didn't work, but turning off the firewall did.

This is a company computer though and i can't leave the firewall off.  Are there firewall settings that will allow this to work?

 

 

 

 

Ismael Mendez's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 07/03/2017
Posts: 74

You can add exceptions to the firewall. If the firewall that blocks you is the Windows firewall, you can follow the steps listed here for adding exceptions. Note that you may need admin permissions for doing it.