10-09-2014 07:34 AM
I am using a C-Rio to control a planar robotic joystick. The goal is to use the joystick as a force feedback controller for a computer game running on a pc.
My program as is for now runs a program on the fpga to read the encoder values and run the pwm for the motors. An RT program reads those values and performs the control as well as it calculates the fwd and inverse kinematics of the robot.
What I would like to do now is to pass the x-y values of the joystick on a third program (computer game) that runs on a PC.Currently the game runs on LabVIEW but I would the system to be combatible with other programs written in different programming languages. I have been told that the best way of doing this is to setup a server. Is this the only/best way of doing this?
I would like to know what is the best way to communicate between a program running on a pc and a program running on the fpga for this type of application. What is the best way to pass along information from fpga to third party app running on pc and vice versa?
I am sorry if this has been asked before but I couldn't find a relevant thread. Thank you for reading this!
Ares
10-09-2014 08:17 AM - edited 10-09-2014 08:18 AM
Hi alex,
as cRIOs usually run headless (without monitor/UI) one better option is to use any kind of network data transfer.
I usually prefer UDP messages to send data and commands as it requires little effort on both ends of the LAN connection. You still need your RT host to handle network traffic and to forward your data to the FPGA…
10-09-2014 12:07 PM
Hi GerdW,
Thank you very much for your reply! Network data transfer seems like a good option!
Unfortunately UDP wont do in this case as I need to communicate data with the highest accurracy possible as I the robot is tracking and responding to arm movement.
I ve done some reading and from that I understant that I should probably be using network streams for my application. Is there a better way of doing this? Should I consider TCP instead?
Is there a different way of doing this?
Regards,
Ares
10-09-2014 01:34 PM
If you need every command to make it, then you should use TCP. I would recommend taking a look at the STM library that is floating around somewhere on the LabVIEW Tools Network.
10-12-2014 10:02 AM
Thank you crossrulz. I will give tcp a go. Hopefuly this will do the trick.