DirectInput with LabWindows/CVI

Hello

I'm trying to use DirectInput to obtain data on the position of a USB joystick in LabWindows/CVI. CVI 2013 comes with headers and libs for direct entry into its subfolder of the sdk and the DirectX SDK comes with a very simple example.

However, already the first step in opening creating a directinput handle fails to compile - it is essentially copied verbatim from directInput documentation or the joystick sample provided with the DirectX SDK.

#include
#define DIRECTINPUT_VERSION 0x0800
#include 'dinput.h.

int main (int argc, char * argv [])
{
LPDIRECTINPUT8 di;
HRESULT hr;

HR = hr = DirectInput8Create (GetModuleHandle (NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID *) & di, NULL);

return 0;
}

60, 42 error: from 'const GUID' (aka "const struct _GUID") to the inconsistent type parameter ' const IID *' (aka ' const struct _GUID *')

18, 1 in file included from c:\Users\tpaprotta\Documents\National Instruments\CVI\Command-line Application.c:18:

"dinput.h" (2682,83) c:\program files (x 86) \national instruments\cvi2013\sdk\include\dinput.h:2682:83: Note: passing argument to the parameter "riidltf" here ".

The same code compiles without problem under Visual Studio 2012.

Therefore, it is / was a number of questions. Yes, the example in question is C++, so instead of the call

DirectInput8Create (GetModuleHandle (NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID *) & di, NULL);

To call

DirectInput8Create (GetModuleHandle (NULL), DIRECTINPUT_VERSION, & IID_IDirectInput8, (VOID *) & di, NULL);

(IID_IDirectInput8 is defined differently depending on if C or C++ calls).

However, if we make this change, the _IID_IDirectInput8 symbol is not found. The symbol is not in dinput8.lib (which is included with CVI), but rather in the dxguid.lib (which I couldn't find in the records of OR). It is distributed with the DirectX SDK - so I'm now a link against it. I'm curious, however, why NOT distribute dinput8.lib / dll and not other required libraries, which seem to be necessary to use.

Tags: NI Software

Similar Questions

  • NEITHER USB-6501-24-line digital i/o (OR-DAQ) with LabWindows/CVI 7.0?

    Hello

    Can I use a recent NI USB-6501-24-line e/s digital (OR-DAQ) with LabWindows/CVI 7.0, although Labwindows/CVI 8.x is required?

    Thank you

    Dayne

    Hello.

    In DAQmx Readme, you can see which version of the CVI are supported by the version of current DAQmx. For a map of 6501, 8.7.2 or DAQmx 8.9.5 versions work.

    Concerning

  • uninstaller application, created with Labwindows CVI, work of doesn´t after the upgrade to version 2010

    Hello

    I worked with Labwindows CVI 2009 without problem, but after the upgrade to the 2010 version, I have the following problem:

    When I m going to run the unistaller, Panel configuration Windows or directly from the icon uninst.exe, it doesn´t work. The PC thought for a few seconds and does nothing, and it happens with all applications that I build with Labwindows CVi 2010.

    Thank you

    Asier

    Hello-

    You install these distributions on a non-English system?  If so, the first thing to try is the workaround solution listed on this known issue.

    The known problem lists only the Italian OSs because inconvenient BONE, but in fact, it can happen on of many different non - English OSs. I will update the text accordingly the next time I update the list of known issues.

    NickB

    National Instruments

  • Where are the models of 'New project' when you use Visual Studio with labwindows/cvi 2013 2012?

    Background:

    Platform: windows 7 X 64

    Visual Studio 2012

    LabWindows/cvi 2013

    First install Visual Studio 2012.  Then follow this installation Labwindows 2013.  In the installation options, I check 'visual studio 2010' (there is no option for VS2012).

    Question: After the installation of Labwindows, I expect to see patterns added to the "New project" dialog box in Visual Studio.   For several years I used labwindows.  Changed the method for using Labwindows with visual studio?

    Thanks in advance for any help.

    Hello jsut64,

    Unfortunately, there is no option to integrate with Visual Studio 2012 yet LabWindows/CVI. We plan to add in a future release.

    Best regards

    = Nelu F. | National Instruments.

  • problem with LabWindows CVI

    Hello I m trying to create a Setup program for an application created in a previous version of Labwindows CVI which one don't know locks I get just the file sources, I m working with the 2010 version, the problem is that the application is running in debug mode but when I run in release mode the application does not work only the icon in the taskbar is indicated but the GUI never appears, someone can help me with this

    Thanks for your help, the problem was not with the code and was not with the RT engine version, was a misconfiguration in the compilation release configuration, I myself do not add external sources dll´s and lib´s in the plug-ins option in the settings of the target

  • Using a DLL built with LabWindows/CVI

    Hello world

    I'm pretty new in the environment, LabWindows/CVI, until present excuses for any silly question. I have a real-time application running in a PXI, but I want to "complete" by adding new features, I have in the C Code generated from Dymola. I thought about creating a DLL of this code (using LabWindows) and then insert it in the .vi (the one I have running in the PXI) using the library function call so that I could have the new .vi running in PXI.

    Will it work?

    Thank you

    Hi all

    I S is true, you can find this knowledge base and really useful related links. This tutorial looks also interesting. However, take into account that the code runs on a real-time platform (such as the functions will work with the same priority as the appellant threadand, many other issues). Remember to FTP the file *.dll for PXI.

    Hope this helps,

  • How to write in MS Word with LabWindows/CVI

    Hi all

    is there a toolkit available to write in MS Word in LabWindows/CVI. as the report generation toolkit in Labview is there any option in CVI.

    concerning

    Hello

    There is an instrument (toolslib\activex\word\wordreport.fp) driver and several examples are provided with CVI, i.e. word2000demo.cws

  • Adding a new user with Labwindows/CVI

    Hello

    I really need help I'm strugggling to find a solution.

    I want to add a new user and view the list of users using CVI?

    When adding the user, I would like to add the name and the password as well.

    I don't want to use this TS_EngineDisplayNewUserDialog I want to be done with the user input from all this information that I receive information from Active Directory.

    Is this possible?

    Kind regards

    Shakeel

    HI RaviShrigiri

    Thanks for the reply.

    I found what I needed. http://forums.NI.com/T5/NI-TestStand/can-I-use-Active-Directory-to-validate-users/TD-p/3299366

    I added the creation of a new user and add to a group in the aforementioned project.

    Kind regards

    Shako

  • Time clock real function communication RS-232 with Labwindows CVI 2009

    Salvation OR,.

    1st quarter > we at KPIT try to build a timer based LabWindows project as a system 'real time' that transmits a packet of 80 RS-232 bytes to an ecu each 10msec. With our current PC RS-232 communication port configuration (115200bps, 1Stop, no parity, 8 Data Bits, no flow control) we are facing difficulties when trying to send this package with consistency. The timer to 10msec mechanism does not always follow a call to 10msec timer callback function. Is it possible, as part of the 2009 ICB, we can get close to 10msec periodicity (more less more than 1msec)? (some times the periodicity is scary and my clock works at 100msec instead of 10msec however it is observed intermittently, not continuously). My machine configuration is CPU 2 GHz, 1 GB Ram, Windows XP. Please adivse.

    Q2 > in the future, we would like to update 4 stripcharts (with the answer of the ecu which is a 12-byte packet), a table that lists the 12 a bytes in each column and also write the package received in a file on the disk in the rest of the time between pitches to 10msec. Is this possible at all?

    Kind regards

    -Mowgli

    Salvation OR,.

    We at KPIT are grateful for the quick and accurate response. We have revised our project based on your inputs. We are pleased to announce that the timer is very well behaved for steps up to 10msec (more less jitter msec). We will now try to introduce a frequency appropriate for our GUI elements. Our project for your reference and final excel is attached. We hope that this data will help other users should they encounter a similar problem.

    Kind regards

    -Ashish

  • How can a separator or the second column in the combobox with Labwindows/CVI?

    How can I make custom editable as attached file (Example.jpg) using the ICB library?

    The ComboBox to the figure of capture via MS tool.

    I am a novice in programming as well as the CVI. Please explain in detail if anyone knows.

    You can do this, but it will shows. You can add columns in the control ring menu, so you'll have to create your own popup with a tree control that replaces the menu ring. I have attached a sample program as proof of concept and you get started.

    Hope this helps,

    -jared

  • ND_BUFFERED_POSTION_MSR with Labwindows/cvi 8.5 pci6602

    Hello

    I have a problem with the BufferedPositionMsr with my pci6602.

    The while loop does not stop because there is still no value in the buffers.

    My questions are:

    Is it possible to use the internal clock as a door?

    Is it possible to use the ND_PFI_32 PIN as a trigger or any other pin code?

    Or are there other problems or suspended?

    Thank you very much for your answers!

    my source code:

    GPCTR_Control (1 / * BoardNumber * /, ND_COUNTER_0, ND_RESET);
    GPCTR_Control (1 / * BoardNumber * /, ND_COUNTER_1, ND_RESET);

    GPCTR_Set_Application (1 / * BoardNumber * /, ND_COUNTER_0, ND_BUFFERED_POSITION_MSR);
    GPCTR_Set_Application (1 / * BoardNumber * /, ND_COUNTER_1, ND_BUFFERED_POSITION_MSR);
    GPCTR_Change_Parameter (1, ND_COUNTER_0, ND_ENCODER_TYPE, ND_QUADRATURE_ENCODER_X1);
    GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_ENCODER_TYPE, ND_QUADRATURE_ENCODER_X1);
    GPCTR_Change_Parameter (1 / * BoardNumber * /, ND_COUNTER_0, ND_BUFFER_MODE, ND_DOUBLE / * ND_SINGLE * /);
    GPCTR_Change_Parameter (1 / * BoardNumber * /, ND_COUNTER_1, ND_BUFFER_MODE, ND_DOUBLE / * ND_SINGLE * /);
    Set_DAQ_Device_Info (1 / * BoardNumber * /, ND_DATA_XFER_MODE_GPCTR0, ND_UP_TO_1_DMA_CHANNEL);
    Set_DAQ_Device_Info (1 / * BoardNumber * /, ND_DATA_XFER_MODE_GPCTR1, ND_UP_TO_1_DMA_CHANNEL);
    GPCTR_Change_Parameter (1 / * BoardNumber * /, ND_COUNTER_0, ND_GATE, ND_INTERNAL_20_MHZ);
    GPCTR_Change_Parameter (1 / * BoardNumber * /, ND_COUNTER_1, ND_GATE, ND_INTERNAL_20_MHZ);
    GPCTR_Change_Parameter (1 / * BoardNumer * /, ND_COUNTER_0, ND_INITIAL_COUNT, 0);
    GPCTR_Change_Parameter (1 / * BoardNumer * /, ND_COUNTER_1, ND_INITIAL_COUNT, 0);
    Select_Signal (0 / * BoardNumber * /, ND_START_TRIGGER, ND_PFI_32, ND_LOW_TO_HIGH);
    GPCTR_Change_Parameter (1 / * BoardNumber * /, ND_COUNTER_0, ND_START_TRIGGER, ND_ENABLED);
    GPCTR_Change_Parameter (1 / * BoardNumber * /, ND_COUNTER_1, ND_START_TRIGGER, ND_ENABLED);
    GPCTR_Control (1 / * BoardNumber * /, ND_COUNTER_0, ND_PROGRAM);
    GPCTR_Control (1 / * BoardNumber * /, ND_COUNTER_1, ND_PROGRAM);

    unsigned long lges1, lges2;

    While ((lges1<>
    {
    sprintf (Message, "1% 2% ld ld", lges1, lges2);
    MessagePopup ("Points", Message);
    GPCTR_Watch (1, ND_COUNTER_0, ND_AVAILABLE_POINTS, &lges1);)
    GPCTR_Watch (1, ND_COUNTER_1, ND_AVAILABLE_POINTS, &lges2);)
                   
                   
    }

    GPCTR_Read_Buffer (1 / * BoardNumber * /, ND_COUNTER_0, ND_BUFFER_START, 0, lges1 / * Nsamp1 * /, 10.0, & County, Tags1);
    GPCTR_Read_Buffer (1 / * BoardNumber * /, ND_COUNTER_1, ND_BUFFER_START, 0, lges2 / * Nsamp2 * /, 10.0, & County, Tags2);

    Hello

    This source code is traditional daq.

    But I solved the problem by myself. It is not possible to deliver the internal clock of the door of the counters.

    (Link: http://digital.ni.com/public.nsf/allkb/63AE9149A2AEF85A86256F2B005D0E7D)

    I have here a workaround:

    GPCTR_Control(1,ND_COUNTER_X,ND_RESET); X meter number

    GPCTR_Set_Application(1,ND_COUNTER_X,ND_PULSE_TRAIN_GNR);

    GPCTR_Change_Parameter(1,ND_COUNTER_X,ND_COUNT_1,2);

    GPCTR_Change_Parameter(1,ND_COUNTER_X,ND_COUNT_2,2); Generate 5 Mhz clock

    Select_Signal(1,ND_COUNTERX_OUTPUT,ND_COUNTERX_OUTPUT,ND_LOW_TO_HIGH); Or send it to the door

    GPCTR_Control(1,ND_COUNTERX,ND_PROGRAM);

    PS: I wouldn't use DAQmx because I'm just broadening an old project, and I think that this is not a good idea to mix DAQmx and data acquisition.

  • PC104 direct access to i/o with Labwindows/CVI real-time



  • 6632A HP - tension - Labwindows CVI

    Hi all

    I'm trying to settle the tension of HP 6632 A with Labwindows CVI. The initialization succeeds (1) If no application ID and no reset command is sent and fails (2) if the two is sent (error occurred during the transfer of Bus) (see update below). Then when I try to set up/set the output by using the function below, I get an error BFFF0038 code - Bus error occurred during the transfer (1) or BFFF000E - invalid session handle (2).

    I checked tha MAX and match the GPIB address there with what is represented on the food. It also responds to the request to id it.  I use the driver of instruments provided by OR to talk to the device by the USB-GPIB converter of NOR.

    Am I missing a step here? I set up the device in a certain way before use?

    Thank you!

    Initialization (send request Id and reset the order)
    int error_int = hpe363xa_init ("GPIB::0 (', VI_ON, VI_ON, & g_instrumentHandle1);
    char chaine_erreur [100];
    FMT (chaine_erreur, "%x", error_int);

    MessagePopup ("Return Value Init", chaine_erreur); <- error="" bfff0038="" bus="" error="" occurred="" during="">

    Config to activate the output
    error_int = hpe363xa_configOutput3632 (g_instrumentHandle1, VI_OFF);

    FMT (chaine_erreur, "%x", error_int);
    MessagePopup ('Return value Config', chaine_erreur); <- error="" bfff000e="" invalid="" session="">

    Set the voltage to 12 V
    error_int = hpe363xa_outputSetOperate3632 (g_instrumentHandle1, VI_OFF, 12.0, 1.0, VI_ON);

    FMT (chaine_erreur, "%x", error_int);
    MessagePopup ('Return Value Set', chaine_erreur); <- error="" bfff000e="" invalid="" session="">

    Device: HP 6632 has DC power supply by Labwindows CVI.

    Connection: NI GPIB-USB connection Cable

    Pilot: Labwindows Plug & Play

    Language: Labwindows 2013

    OS: Windows 7

    Edit1:

    I just realized that I'm not sends a request id and a reset command during initialization of the device. I've updated the code above. Unfortunately, I get an error code if I do and the devicehandle is not set! The game features following fail later.

    You also use the bad for a HP6632A instrument driver. The hpe363xa driver is for models E3631A, E3632A and E3634A.

    You must instead use the driver available to ... http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E929C659CE034080020E748 .

  • Opal kelly builders and LabWindows/CVI

    Hello, all.

    I try to get a Council Opal Kelly XEM3005 running with LabWindows/CVI 8.5.

    I have been in touch with Tech Suppt of OK and overthrew the original questions of type 'bool '.  After (at the recommendation of OK) with "char" types, I can now include the headers without errors.

    There are, however, a new problem:

    When I call the constructor function, which should return a pointer to a type of "okFrontPanel_HANDLE", I get an error for a prototype missing for initialization.

    Dredged in the .c (pp) file I found the following:

    //----------------------------

    Hi tomii,.

    Looks like you posted another very similar thread on the compilation of mistakes with the DLL of your Opal Kelly here. I follow upward in this thread to help get traction with those questions.

  • Control the Arduino with LabWindows

    To the right:

    I've seen a lot of way of communicating with the microcontroller Arduino using Labview. But I'm having a lot of trouble to find ways and examples with LabWindows CVI, can someone help me with the file #include that I need to use in order to communicate with the microcontroller?

    Concerning

    Francisco

    Hi Francisco,.

    Arduino connects to a virtual COM port. The library of RS-232 of LabWindows is able to communicate with the Arduino.

    See using the instrument for the RS-232 (serial) library.

    There are also fine examples on the use of this library. They are installed with the CVI environment.

    See if you can find and post if you need help.

    Kind regards

Maybe you are looking for