11-21-2023 03:49 AM
Hi all,
I have made a C#.NET application which drive NI8452 board.
The app is working perfectly in 32 bits mode.
When I switch to 64 bits, the app loads the 64 bits DLL and the first functions are working : ni845xFindDevice, ni845xOpen.
But the next function like "ni845xI2cSetPullupEnable" raise an error code -301706, in french "La référence de périphérique n'est pas valide. Vérifiez que la référence de périphérique fournie contient un nom de périphérique valide."
I tried to make a sample app in C++ (native) in 64 bits. But I don't find ni845x.lib in 64 bits version.
So I suspect that this board is not fully compatible 64 bits, or I made in pistake.
Thanks in advance for your help
11-21-2023 07:45 AM
Check if there is any ni845x.lib under
C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64
11-21-2023 10:37 AM
I already checked, there is no lib for 64 bits
11-23-2023 01:30 AM
Hi all,
I would like to know if I made a mistake or if this board is not fully supported in 64 bits.
How can I get support from NI?
Thanks for your help
11-23-2023 08:02 AM
Open a Service Request Case Using the NI Service Request Manager (SRM)
12-01-2023 07:58 AM
OK, but I don't have service ID so I don't think that I can benefit some support.
12-05-2023 09:31 AM
Hi all,
I have build by myself ni845x.lib in 64 bits from ni845x.dll.
I try a C/C++ sample provided by NI (in 64 bits) and I get the same error.
So I'm pretty sure that this board is not running with 64 bits application.
I'm quite disappointed from a compagny like NI and by seeing the price of the board.
12-05-2023 11:06 AM
Can you share the NIPM package list image to see if you installed it correctly?
12-08-2023 12:51 AM
04-03-2024 03:01 AM - edited 04-03-2024 03:03 AM
The conclusion that 64-bit is not supported would seem to be wrong, otherwise you could never successfully invoke ni845xFindDevice() or ni845xOpen(). What is most likely the problem is that in your C# interop file (you do not link in lib files in a C# application but instead interface to the DLL through an interop file which imports the different functions dynamically) the declaration for all the functions taking an NiHandle are wrong. The NiHandle is a handle, which is almost always a pointer sized variable type and that means you need to declare the functions to use a pointer sized integer type for this parameter. Otherwise when calling the function in 64-bit the actual 64-bit value returned from the DLL is coerced into the 32-bit integer that your interop interface uses and that will loose 32-bits of the value. On the next call the 32-bit value is passed to the function but the higher significant 32-bits are undefined, and that of course is not a valid handle.