Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run code and communicate between computer and myRIO?

Solved!
Go to solution
Hi,

I am trying to create a colortracker using the myRIO. The system is pan tilt servo with a webcam. The project runs fine and is able to track and move with the desired color. However, to further the project, I want to make this system with another camera for depth perception and would like to use the host computer for webcam and image processing , and the myrio for getting signals for the servos. The idea is to connect both webcams directly to the computer usb ports and keep the myRIO connected at all times i.e. No wifi. Can someone guide me as to how I would go about sending signals constantly between the myRIO, and host computer?
0 Kudos
Message 1 of 5
(6,348 Views)
Solution
Accepted by topic author ndp63

I would recommend using Network-Published Shared Variables or Network Streams. 

 

You can read about both in the cRIO developer's guide: http://www.ni.com/pdf/products/us/fullcriodevguide.pdf

 

There are also examples for both in the LabVIEW Example Finder.

Message 2 of 5
(6,313 Views)

Hi,

    I would recommend you to connect both the camera in myrio and transfer the image through Wifi so that you need to connect your camera or the myrio to your PC all the time. if you do in this manner then you can make it into a stand alone project.

 

hope this helps you....

 

kudos are welcome 

 

 

 

 

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
Message 3 of 5
(6,156 Views)

To elaborate on what the others have said:

 

- You can connect certain USB cameras directly to the myRIO, you may be able to use a USB hub and connect both cameras to the USB port on the myRIO and use the NI Vision toolkit to do your acquisition and image processing. It's not something I've ever done so I'm not sure if the myRIO is sufficiently powerful or not...but you could try it. If you went this route, you'd be able to run your image processing and servo control without a connection to the computer (or only to view the images/control the pan/tilt servo) by creating and deploying a Real Time Executable (rtexe) to your myRIO.

- If you want to connect the cameras to your PC, you could then run your image processing (i.e. the CPU intensive stuff) on the computer, and have it send the required information to the code running on your myRIO (for controlling the servos). You can use any sort of network communication for this - Network Streams (for losslessly streaming data), Network Variables (for reading the latest value), or you could do something with TCP/IP or UDP.

 

It doesn't matter if your myRIO is connected via USB (which is basically a usb to ethernet adapter) or WiFi - the process is exactly the same.

 

The cRIO developer's guide is an excellent resource for learning how to communicate between a Host PC and RT target (like the myRIO).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 5
(6,150 Views)

Thank you everyone for the idea and help. I learned how to do network stream with network-published variables. Took some time getting used to it, but I got it down. Sadly, I can't do Wifi since my school has restrictions with their Wifi (really unnecessary and really inconvenient).

0 Kudos
Message 5 of 5
(6,135 Views)