10-27-2008 07:34 AM
Hello all,
A beginner's question: i have a wavelengthmeter (something that detects and reads out the wavelength of laser) that uses USB 2.0 for communication (and power actualy). It came with a program that works perfectly fine..i can measure successfully. it also came with LabVIEW demo VI...but it doesn't work. It's a simple library function calling of this dll file the wavelengthmeter came with.
The result is -5 which is an error code for "Wavelength Meter Missing"...but it's not since the default program can detect and run perfectly fine.
What would be the problem? Do i need to initialize certain things like serial instruments? I've attached the VI and the DLL file...hope it will be any help
Thank you all!
10-27-2008 08:46 AM
Hi,
Thanks for the post!
Here is a great tutorail:
USB Instrument Control Tutorial
http://zone.ni.com/devzone/cda/tut/p/id/4478
Im afraid your error is very specific to this wavelength meter.
I would check you have the correct setup and software install in the documentation/readme you should have got with your labVIEW demo.
Let me know how you get on,
Kind Regards,
10-27-2008 09:11 AM
Hello HIllman
i tried the measurement and automation program, but cannot detect any usb device. But device is connected and wrok on the program it came with
i'l keep reading the tutorial and hopefully more hints can come.
10-27-2008 09:15 AM
Hi,
Where did you look, it will be seen by MAX as an usb raw device - I would take a look in the Windows device manager to see what the name of the device is?
I would also recommend looking through the knowledge base articles,
Here is a good starter:
Can VISA Read be used to read USB Interrupt Data?
http://digital.ni.com/public.nsf/allkb/D38E5A65DA54C9A2862571E900810FEA?OpenDocument
Please let me know how you get on,
Kind Regards,
10-27-2008 09:25 AM
10-27-2008 12:01 PM
so from what you are saying, is that I cannot simply plug a instrument to the usb port and expect it to work in labview? like serial rs232 instrument i can simply connect to com port and go visa read visa write blablabla and it works..so for usb i cannot just plug it, and call the dll function and hope for some number out ?
somehow i need to set up the visa driver myself?
10-27-2008 01:01 PM
It depends on the USB device. Some of them will actually emulate a serial port after the installation of the driver provided by the vendor. Some vendors will choose to use a different USB class and write a driver for that class. For example, a vendor could choose to use the HID (Human Interface Device) class. A common class for certain types of instruments is TMC (Test & Measurement Class). Since you got software from the vendor and that is working, part of the installation was a .inf file that tells windows about the device. You can read this file and get the information yourself. Whatever class this is and whatever driver it is using as shown in windows device manager, is probably what the Call Library Function Node in the example is using. The error message is being returned by their dll and their code. They should have an idea of what might be wrong. In theory, it should be just as easy as you describe.
The only time you would set up a VISA driver yourself is if you wanted to create a driver from scratch yourself and forget about whatever code you got from the vendor.
10-28-2008 10:29 AM