Hello! I need to receive data from a device with an SPI interface through the NI-8451.
I am writing a program in c# (visual studio 2015) for reading data.
First question: which *.dll is responsible for working with the NI8451 and where to get it. I have used ni845x.dll located in C:\Windows\SysWOW64. This is it?
Second is: to find ni845x.dll I use the type construct
using System;
using System.Runtime.InteropServices;
namespace Merge_data_files
{
[StructLayout(LayoutKind.Sequential)]
struct NiHandle
{
//////
}
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
[DllImport(@"Properties\Ni845x.dll", CharSet = CharSet.Unicode)]
internal static extern int32 ni845xFindDevice(char* pFirstDevice, NiHandle* pFindDeviceHandle, uInt32* pNumberFound);
}
} but Studio gives me errors about data types and structures unknown to c# (int32, char*, NiHandle)
How to fix the program or maybe there are some examples to work with NI8451 in c#?