LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga: Communicating between fpga and third party program running on pc

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

0 Kudos
Message 1 of 5
(2,722 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,716 Views)

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

0 Kudos
Message 3 of 5
(2,698 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(2,694 Views)

Thank you crossrulz. I will give tcp a go. Hopefuly this will do  the trick.

0 Kudos
Message 5 of 5
(2,648 Views)