From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

problems communicating using 845x .dll in vb.net

I am trying to use the .dll supplied with the 8451 to communicate via SPI, and I have most things (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

 

It fails at step 5.  In addition to changing how the variables are called, I switched steps 2 and 3 to no avail as well.  I also pass the configuration handle as a 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?

0 Kudos
Message 1 of 1
(5,433 Views)