Reading Joystick Data into Another Program

Hey all,

I have a joystick connected to my Windows Vista box and I'm trying to read some data about its current position into another program (specifically, the coordinates of its 8 axes). I can see the values of all axes in the Game Controllers feature of the Control Panel. Any suggestions as to how I could go about reading this data into another app, or where it might be stored in the PC's memory? The "joystick" that I am referring to is a USB Plug-And-Play device (namely, #-Link-Snipped-#). That being said, I'm using a custom driver that allows the device to appear as a joystick, keyboard, and mouse to Windows. I'm trying to read the joystick's axis data into another Windows program (not one I wrote or a game, it's actually the software for a Human Machine Interface (HMI) called VersaView made by Rockwell Automation/Allen-Bradley). I don't believe there is an API available for the device that I could use.

Any suggestions 😀?

Thanks 😁!

Replies

  • sookie
    sookie
    Hi skyfx ,

    Looks like it was you only who posted your query here also #-Link-Snipped-# but not answered yet.

    Well, I am not clear about where and what event of joystick you want to read the data? If you are asking about writing any program that can simply read the coordinates of joystick then Event Handling mechanism can be used. You will have to write an appropriate Listener class that will listen to your joystick events and then capture the event and write stuff for what you want to do with the data retrieved through the event. Event Handling mechanism varies depending on the language you want to use.

    Hope I have answered something of use.
  • skyfx
    skyfx
    sookie
    Hi skyfx ,

    Looks like it was you only who posted your query here also #-Link-Snipped-# but not answered yet.

    Well, I am not clear about where and what event of joystick you want to read the data? If you are asking about writing any program that can simply read the coordinates of joystick then Event Handling mechanism can be used. You will have to write an appropriate Listener class that will listen to your joystick events and then capture the event and write stuff for what you want to do with the data retrieved through the event. Event Handling mechanism varies depending on the language you want to use.

    Hope I have answered something of use.
    Haha you caught me, that was indeed me in the XNA forums. My problem is that it's such a peculiar question that I don't really know where to ask it. What I'm trying to do is access the joystick's axis data (e.g., how far forward it is leaning in degrees or by how much it is being rotated in degrees) into the software used to program a Human Machine Interface (HMI), the end goal being to control a robot which is also interfaced to the HMI via a Programmable Logic Controller (PLC). That may be more information than you need to know, but I feel like I need to set the stage for what I'm trying to do here.

    In terms of programming languages, I'm fairly proficient at using VB and C++. I have asked this same question on the Micro$oft Developer's Network forum as well and somebody suggested I need to use a DirectX Developer's Kit and Direct Input (DI8?!). Unfortunately my skills don't reach that far and that still won't pull the data into the HMI application as far as I can see. Somebody else I know suggested I need to use a UNION REGs structure, which is similar to what you see in this thread I believe: #-Link-Snipped-#. But again, how do I use that to pull data into my HMI program. As you can see, I don't really know where to start with this...and any help would be much appreciated!

You are reading an archived discussion.

Related Posts

Search giants Google and Microsoft are both looking to sign a deal with Twitter. The deal would allow the search engines to update their webpage in real time on what...
With the rapid growth of high technology, computer , telephone and other communication tools have become more and more important in our daily life, so what people have gradually ignored...
Do you think technology has made the world a better place to live and our lives easier? Is technology a boon or a bane? Let's discuss.
Hello This is Rony Dsouza from USA Thanks
I'm wondering what software can startups use to keep the costs minimum and get the work done. The basic minimum requirement can start with - OS: Ubuntu / Windows Office...