LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Connection to MyRIO1900

I'm connecting to a myRIO via tcp connections (1 sending values to the myrio, 1 reading sensor values back to host pc), currently I cannot form the connections.

 

The myrio code controls one servo attached to the myrio, and reads a value from a modified version of the FPGA code on the myRIO. Highlight execution has shown error 56 previously when using open and listen tcp commands. The code has been taken out of my larger section of code hence the extra info in the command string sent to the myrio.

 

Have I setup the tcp connections correctly? I am connecting through the USB to the myrio currently hence the 172 ip address.

Download All
0 Kudos
Message 1 of 2
(3,036 Views)

I'm not at my PC with LV, but I'll do my best to help.

 

Try creating a simple project (without your code involved for the moment).  Open up Help->Find Examples and search for TCP.  Create the listener/server on the myRIO.  You can copy/paste the VI from the example.  Run the Client on your host.  See if this simple example works.  If not, you've got to figure out what's going on with your connection.

 

Are you planning to always run by USB?  If so, the 172.22.11.2 solution is fine.  If not, you probably want to look at another way to handle the IP.  You can try using the name of your myRIO.local as a DNS entry instead of a specific IP address.

 

You can also take a look at other communication options.  TCP should work.  But, depending on what you're sending across there are already things in place to send data back and forth taht are more common to the RIOs.  Streaming data back from the RIO is often done with FIFOs.  Sending values to the RIO are often done with Shared Variables (if you only care about the most recent value and don't care to make a one write, one read connection) and Network Streams if you want to create the one way communication with every write being read exactly once.

Message 2 of 2
(2,996 Views)