03-15-2011 01:41 PM
I was just wondering how to hook up a USB joystick to the CompactRIO 9074. I can get it to run in LabVIEW when not connected to the RIO, but as soon as I do, it says the device doesn't support all of the sub VIs such as "Initiliaze Joystick" and "Close Joystick" and "Joystick Aquire".
03-16-2011 11:24 AM
Hi RomeBoy,
This is most likely caused by the *.dll file that these functions are using is not supported in Real-Time. You can check if a *.dll file is supported by using the DLL checker that can be found in the following KnowledgeBase: How Can I Verify that My DLL is Executable in LabVIEW Real-Time?
You could implement a Host vi on your PC that will read the joystick commands and then relay that info to the cRIO as a workaround.
<Brian A | Applications Engineering | National Instruments>
03-29-2011 08:31 PM
How would you implement a workaround? Simply have the VI running under the PC and the RIO at the same time?
03-31-2011 11:28 AM
You would have two separate applications.
A host vi that runs on the PC and a Real Time vi that runs on the RIO
The host vi will get the information from the joy stick and relay that information to the the Real Time vi on running on the RIO. You can use shared variables to relay the info to the cRIO.
<Brian A | Applications Engineering | National Instruments>
03-31-2011 04:00 PM
I tried to send this as a message, but it didn't work so here it is anyway..
Hey Brian,
Myself along with Daniel S. are both in a senior design group building a autonomous ground vehicle that implements a joystick. We are in need of some help creating the work around between the PC VI and the VI running on the RealTime module of the RIO. We are both very new to LabVIEW. Thanks a lot.
Roman Tillman
850-685-3758
04-04-2011 11:00 AM
Since the *.dll file that the Joystick vi uses is not compatible with Real Time you will connect the Joystick to a PC running a host vi. The host vi would gather the user input from the Joystick using the Joystick vi, then you would take that information and send it to the Real Time controller via some communication method.
Shared Variables are the easiest communication method to setup, but are not Ideal in all situations like high data throughput.
You will need to determine if shared variables will be adequate for your application or if some other communication method would be more ideal.
Here is a simple Example that shows you how to use a shared variable to send information between a Real Time application and a Host vi Running on a PC.
You should also review this KnowledgeBase article that goes over communication methods between Real Time and Host vi.
<Brian A | Applications Engineering | National Instruments>