10-19-2017 08:37 AM
I would like to use the NI USB-8452 with Microsoft C# and Visual Studios 2013.
I found the NI Knowledge Base paper: "How Can I Access USB-845x API Function from a C/C++ Program?"
http://digital.ni.com/public.nsf/allkb/F997E364CFAA63F6862573540064C028
Although This was very helpful, I am still having trouble converting it to C#.
Does anyone have any examples, specific to C#, that they can share with me?
Thanks,
Ken
10-20-2017 01:46 PM
Hey,
That document describes the location of ni845x.dll, which contains the functions. I believe you can access them using C#.
02-09-2022 04:23 PM
NI Package Manager indicates NI-845x v21.3.0 is installed.
Ni845x.dll is in C:\Windows\System32.
Visual Studio 2019 does NOT offer anything with NI845x as a Reference for adding to a C# project.
Attempts to browse and install either ni845x.dll or ni845x.lib result in "A reference [...] could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.".
Examples and instructions for use instruct to "add to project"... as if it were actually possible, with no explanation (including what name to look for).
Please advise known reasons for not finding a Reference, when installation software indicates the driver was installed successfully.
Thank you!
10-18-2022 08:32 AM
Hello, I am having the same problem. Did you solved the problem.
Sincerely
10-19-2022 03:23 PM
I did figure it out.
I used NI's link:
Using the USB-845x API Functions in a C/C++ Program - NI
National Instruments supplies a DLL, Ni845x.dll, as part of their USB-8452 driver.
You must install NI's driver to use this C# file.
They supply a header file, ni845x.h to use their DLL with C/C++
All we need to do is figure out how to call these functions from C#
The attached file is based on ni845x.h.
The function prototypes are commented out and replaced with DLLImport functions.
This file may not be complete, or even correct, but it worked for me.
Good Luck