Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-8451 and Visual Basic 6

Hi everyone!

Is there any possibility to use the NI-8451 (USB-I2C/SPI Interface) with Visual Basic 6? Are there some Code examples?
According to the product-site only LabVIEW, LabWindows™/CVI, and Microsoft Visual C/C++ 6.0 are supported....

I hope, someone can help me.

Best regards

Simon Keller
Switzerland

 
0 Kudos
Message 1 of 4
(4,644 Views)
Hi Simon,

The NI 8451(USB-I2C/SPI Interface) drivers support LabVIEW, LabWindows/CVI, and Microsoft Visual C/C++ 6.0

You could potentially create a wrapper in VB to interface the drivers.

If you download the drivers from the following link, you can look into some examples.

http://digital.ni.com/softlib.nsf/websearch/E5B9314D4DB9D43F86257295006C2A4B

Please let me know if you require any additional information.

Kind regards

Benjamin
0 Kudos
Message 2 of 4
(4,631 Views)

I can't see the contents of the website,Provide you with web sites

0 Kudos
Message 3 of 4
(3,439 Views)

I use the VBA interface in Excel to control the USB 8451 device.  Excel acts as a very good user interface for the type of automation, testing, and post-processing I need to do as an engineer.  Originally I started trying to create functions in Visual Basic that would call the C functions.  Calling the functions directly would allow me to control the USB 8451 directly using the Visual Basic code.  Unfortunately my lack of knowledge about how to properly call pointers in Visual Basic ended this effort.  Even if I knew how to call functions, It would have probably been too large an effort to justify my usage.  So I went off into another direction... 

 

I started with the C language examples and created executable files that could be passed command line arguments to setup all of the options I need (I think I ended up using around 20 arguments).  I only deal in small sets of data that control digital attenuators and DACs, for example, so I only needed to send a few bytes of data - which I also passed to the executable file as options.  I then used Excel VBA to create a user interface where I could select the parameters in Excel, create a batch file with these options, and call up a command window to execute the batch file.  This worked great!

 

Hope this helps someone else that might be wanting to do something similar.  I looked everywhere for a Visual Basic wrapper or something similar that would allow me to code something directly.  Unfortunately I work under a tight schedule, so I had to go in a different direction quickly to get results faster.

0 Kudos
Message 4 of 4
(3,267 Views)