06-01-2011 12:36 PM
Hi,
This is my first attempt at USB communications using CVI. Is there a CVI example program that illustrates the basic steps at connecting, read/write and closing USB communications?
Thanks,
06-02-2011 02:48 PM
Hi AML1138,
You can use the CVI Example Finder to find examples using for your NI USB 9162. This USB device uses our DAQmx drivers. What type of application are you working with? What device do you have in your USB 9162? This will effect what sort of examples will be best for you to look at. To find examples using DAQmx in CVI, you can go to Help in CVI and select Find Examples...Next, go to the Hardawre Input and Output » DAQmx. What you select next will depend on your application. We have examples for analog inputs, analog outputs, and digital inputs and outputs just to name a few.
In addition to the examples you can find in the CVI example finder, here is a link to a tutalial for using DAQmx in text-based environments:
http://zone.ni.com/devzone/cda/tut/p/id/5409
The examples included in the CVI examples finders aren't the only examples availible. There are a wide range of community examples posted by CVI users and National Instruments employees posted in the Development Zone part of NI's webpage. If you go to http://www.ni.com/examples/ it will take you straight to the examples examples page where you can search for additional examples if you aren't able to find what you are looking for in the Example Finder. Hope this helps!
06-03-2011 09:37 AM
What I originally wanted to do was change a CVI RS-232 instrument driver I wrote for a thickness guage to USB. I couldn’t find a USB example so I started to look at NI USB instruments. I found a NI 9221 and carrier laying around here and figured I would copy the coding for that. I would get the 9221 working and port the communication part to convert my RS-232 driver.
Are you saying that I should use DAQmx to write a driver for my USB communications?
06-03-2011 11:08 AM
Searching for USB 9162 doesn't bring up anything.
Going to NI Example Finder -> Hardware Input and Output ->DAQmx only brings up Counter Measurments.
Do I have to load examples from the DVDs?
06-06-2011 03:31 PM
Hi aml1138,
I was unaware that you are planning to use a 3rd party USB device. Our NI USB instruments use the DAQmx driver, however 3rd party USB devices use the NI-VISA driver. You can find examples for NI-VISA in the same way that I mentioned above. To address your other question, the examples should be installed at the same time the driver is installed. There is an option that can be selected to not install the examples. If you reinstall the driver, the examples will install as well.
Here's a link to our NI VISA programmer reference manual that describes the attributes, events, and operations that comprise the VISA API.
http://www.ni.com/pdf/manuals/370132c.pdf
For NI-VISA, we also have a utility called the NI-VISA Driver Development Wizard. Here's a link to a step by step tutorial for using the wizard.
http://zone.ni.com/devzone/cda/tut/p/id/4713
The example is for PXI/PCI, but the document has a lot of good information about using the wizard and the VISA API. The wizard also has a USB option that should work for your application based on my understanding of it. Hope this helps!