05-11-2015 02:57 AM
i have to get data from two joysticks and display it , unfortunatle till now i am unable to make any progress, i have read about VISA , calling .dll and stuff but till now i dont have any idea what to do. i have found good labview example but my target is to use labwindows , kindly help me in this regard i shall be really thankful to you , your help will be highly appriciated , please give me some direction that how to read data from joystick and display it or send it on serial port ,
thanks in advance
ahsan
05-11-2015 05:42 AM
Hello,
a quick search in the forum showed this thread that could of some help. Unfortunately I cannot help more that this since I don't use joysticks in my activity (actually I not even have any such device available to test!)
05-12-2015 02:28 AM
this thread is not useful , i have tried my best to understand the concept and have a starting point but still i am unable to communicate with this device can you tell me that if i have a usb interface device attached then how can i get and set values to it , in my case i have to get coordinates of joystick.
05-12-2015 04:22 AM - edited 05-12-2015 04:23 AM
Unfortunately I have no great experience on USB input devices and I have no device to test.
Nevertheless, if your joystick appears in Device Manager then you should be able to query its position at any time with joyGetPos function: call the function passing 0 as the device ID and the pointer to a variable of type JOYINFO. Do you get any result? Do you get any error?
If this test is succesfull next you may experiment with that command or go further experimenting with joySetCapture which should give you a more efficent way of getting values.
Note: you need to include windows.h in your source file and add Winmm.lib to your project in order to execute the code.
05-12-2015 04:40 AM
Hello, looking into CodeProject I have found this example that could be of help: it shows how to use raw input to receive values from a joystick
Using the Raw Input API to Process Joystick Input
05-14-2015 02:51 PM
great sharing sir all i can say is that i respect you and thanks alot sir
05-14-2015 04:58 PM
You're welcome!