LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Joystick LabView Real-Time

Hi, I need to use a joystick within a LabView Real-Time application. Does anybody know how can  I do that? I already tried using the joystick acquisition function provided with LabView but when downloading the .vi on the RT target device I get an error of shared library loading failure.
 
Ann
0 Kudos
Message 1 of 11
(4,426 Views)
Hi ann,
 
unluckily the joystick acquisition function provided with LabView works only on Windows and Linux because it must have DirectX 8.0.
So any target RT is unable to use this function. Instead you could use a serial Joystick so that you can manage the serial data through VISA functions within target RT.
I hope this help you.
 
MarcoC
0 Kudos
Message 2 of 11
(4,413 Views)
If you are using an interface with your real-time target (a directx supporting target such as Windows), you can read the joystick from there and then relay the input data over tcp-ip.
Crazy idea: make a pda application that acts as a joystick and send the data to the target over wireless LAN..fun!
------------------------------------------------------------------------------------
Seriously concerned about the Labview subscription model
0 Kudos
Message 3 of 11
(4,410 Views)

I followed your tip, but the suggested TCP/IP connection still require Labview Real-time which reject the shared library of the Joystick (based on non-deterministic usb),

Other suggestion ?

 

Ann

0 Kudos
Message 4 of 11
(4,382 Views)
That's not quite what I had in mind. My assumption is that you will have your real-time target talk to a Windows computer. I think you were probably running the VI while looking at it's front panel on your Windows computer, but that ill not work: that VI actually runs on your target, which cannot handle the Joystick library.
What you need to do is make a TCP routine inside your real-time VI that listens for incoming data packets. On your windows computer you make a new VI called something like "joystick server.vi." This VI only runs on your Windows computer and will accept client requests for data. Also, this VI reads your joystick data and converts it if neccesary. My silly idea to do this with a pda could work if you use the pda keys as input instead of a joystick.
The good things is that you can use example tcp-ip code from the example finder or from somewhere on this website to implement most of the code.
------------------------------------------------------------------------------------
Seriously concerned about the Labview subscription model
0 Kudos
Message 5 of 11
(4,376 Views)

Thank you, but I still do not see how to solve this problem: the VI "joystick server" should run on LabView Windows, while the VI that uses the information from the joystick runs on LabView RT target; the problem is that it is not possible to run the two different modes at the same time.

Ann

0 Kudos
Message 6 of 11
(4,363 Views)
Ok,
let me straighten this up.
Ann, you need to do the following:
 
1) develop a Windows host VI for your RT application. The host VI will receive inputs from the USB Joystick, translate them into packets and send the over to the RT application through a TCP/IP channel.
 
2) The RT Application needs to implement a TCP/IP communication channel that will receive packets from the Host VI, and translate the packets into the right information for your device that needs to be controlled.
 
There are 2 major drawbacks using this strategy:
- Your RT target needs to be connected to the HOST pc through a ENET cable
- You need to know how the information from the joystick is coded in order to be able to decode it once it is received over tcp by the RT Target.
 
As Castel suggested, the best option you have here is to think about using a serial joystick directly attached to the RT Target. The RT application will have a loop that keeps reading input from the serial port and can send inputs to the device under control.
 
If you have no clue on how to implement the TCP/IP channel for communicating between the Host VI and the RT target, you can take a look at the examples generated by the RT Communication wizard you find under Tools menu in LabVIEW.
Regards,
 
AlessioD
National Instruments
0 Kudos
Message 7 of 11
(4,343 Views)

Hi ,

Any one tell me how to confidure joystick for real time target ?

I am working on servo movement using etherCAT but when i add the vi which included joystick then it will give error that "this vi not supported for current target"

Plz tell me what to do for it

0 Kudos
Message 8 of 11
(3,178 Views)
What suggestions in this thread have you tried?
0 Kudos
Message 9 of 11
(3,165 Views)

Hi,

 

I know it's late, but one more suggestion:

Use a joystick from the Commodore C64 era: it uses just some switches (common ones used 5) internally. You need to use a DI module to read the current state of the joystick.

You will get similar joysticks made for industrial environments!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(3,157 Views)