09-03-2013 07:06 AM
Reposting this in the software section:
I am trying to use the .dll supplied with the 8451 to communicate via SPI, and I have most functions (seemingly) working. When I try to send a message, however, I get an error (-301710 - invalid configuration reference). Some of the documentation for the dll is... lacking, but I tried passing the configuration handle by reference and value, both giving the same error.
My code flow is as follows:
1. Find device with ni845xFindDevice
2. Open device with ni845xOpen
3. Open device configuration with ni845xSpiConfigurationOpen
4. Set all configuration parameters with their functions
5. Attempt to write data with ni845xSpiWriteRead
6. Close configuration with ni845xSpiConfigurationClose
It fails at step 5. I've tried the method of passing variables, swtiched steps 2 and 3, switched steps 5 and 6, all to no avail. As a side note, I pass the configuration handle (by reference) to a subfunction that performs all of parts 3 and 4. I am storing the device handles as ULong (which I grabbed from the .h file that was included) and this works for the other functions that require handles.
Does anyone have advice on what to try next?
09-04-2013 05:00 PM
Hello rwortman,
Could you please show us the configuration that you are using for this task?
09-09-2013 02:44 PM
I'm using visual basic 2010:
Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel
Installed Version: Professional
Microsoft Visual Basic 2010 01018-532-2002181-70210
And I installed the 8451 driver from ni.com:
NI-845x 2.1.2