ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft Visual Studio 2022 programming environment using C++ with NIDAQmx

Solved!
Go to solution

Hello all,

 

This might be a stupid question, but I cannot find the document where it introduces me how to correctly set the programming environment in Visual Studio 2022. 

 

I have tried to manually include NIDAQmx.h in the additional include of my project. I have also added NIDAQmx.lib into additional library dependencies. However, my VS still showed me a LNK 2019 error when I try to include NIDAQmx.h. Currently, I can only find the NIDAQmx.h and NIDAQmx.lib in "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev", and these are the only two files there. Can someone point me to the section that I can find how to set up the programming environment, or to tell me what and where are all dependencies and includes I need to add to the VS project.

 

Thanks for the help in advance.

0 Kudos
Message 1 of 4
(2,387 Views)

BTW, in case you need to know, I have a USB6210 Multifunction I/O, and NI-DAQmx version 2023 Q3 installed

0 Kudos
Message 2 of 4
(2,384 Views)
Solution
Accepted by topic author bh4dkc

There are shipping examples with vsproj that you can refer to:

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C

 

You need to include libraries from these directories as well:

$(ProgramFiles)\National Instruments\Shared\ExternalCompilerSupport\C\include

$(ProgramFiles)\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
Message 3 of 4
(2,379 Views)

Thanks for your help. I have to change to directory location to Program Files(x86), other than that, it seems to be working correctly.

0 Kudos
Message 4 of 4
(2,355 Views)