Have the NI USB8452 DIO/SPI/I2C box. Example code in labview and C
My app is C sharp 8.0 winforms
Unmanaged C will not run in C# since its a managed environment. The workaround is to use DLLImport
Find Device? works
try
{
int x = ni845xFindDevice(FirstDevice, out device, out numdevices);
..
..
..
[DllImport("Ni845x.dll", CallingConvention = CallingConvention.StdCall)]
public static extern Int32 ni845xFindDevice(
[MarshalAs(UnmanagedType.LPArray)] byte[] firstDevice,
out NiHandle findDeviceHandle,
out UInt32 numberFound
);
most other calls do not work, it does not send anything out. Taking a script that runs and putting the statements into this C# app there is no output from the NI 845x unit.
Someone must have made this dll wrapper for C# at some point?