the null reference exception was fixed by Dim logdataout(4) as single, thanks

.. however I still can't get this to work, I don't get any error messages or crashes but the dll returns with a value of zero and the data isn't written to the database as it should be.. I can't be sure wether this is because I am calling the DLL incorrectly or there is a problem within the DLL itself though

I tried passing ByRef logdata As Single in the DllImport but that made no difference (except that i then had to call it with logdataout(0) for the program to compile)