05-02-2008 10:31 AM
05-22-2008 12:11 AM
I have problems with the Thorlabs LC1-USB camera.
I am using NI VISA and do make contact through VISA in vb.not. I can read the USB descriptor of the camera. So, that seems to work.
This is where I am stuck. How do I configure the camera and how do I read the CCD values out?
Is there a list of commands available anywhere?
Since Thorlabs wrote the interface I suppose they should have a manual but could not find anything like it.
Any help is much appreciated
Robert
05-22-2008 03:14 AM
05-22-2008 10:13 AM
05-22-2008 10:32 AM
hi
there is no active x or external controls to allow you to program this device in visual studio.
however, you can build a dll in labview that you can read then in V.S.
so you make a VI that reads the data off the LC1, then you compile it to a dll
Then from your other appliclication, you call the dll and read get the data.
The one i made wouldnt be specific for most users so i didnt upload it.
It only reads about 50 of the line elements, the postion varying to where a the peak is.
I can try to find some code next time im at that comptuer if your intrested, but in general, looking up how to build the dll is the way to go.
05-22-2008 11:10 AM
05-22-2008 11:39 AM
the LC is a great piece of hardare, 3000 elements and usb interface.
But only offering labview as a driver is crazy, I was not happy with thor labs about this
I personally just dont like having labivew on any of my PCs, its hard enough knowing one language well.
buidling the dll turned out to be the best solution for me.
i can link in some example files later for how to read a dll in whatever language and also the one on how to build the Dlls
You can probalby do it in about 4 hrs id say.
But then you still have to have the labview engine on any machine that runs the app.
05-22-2008 12:15 PM
05-23-2008
08:01 PM
- last edited on
04-01-2025
09:41 AM
by
Content Cleaner
Thank you all who answered to my plea for help. After spending two days on it I figured it out - to some degree at least.
This is NOT yet the perfect solution because I do not have any answers from Thorlabs.
Preface:
Thorlabs sells a line camera Model LC1-USB. It comes with a user interface software allowing the user to operate the camera and look at scans.
We needed to implement the camera into a product. The Thorlabs manual says they provide drivers for MS C++ and Borland C++. Well they do not and they also do not have any information how to do this. Customer service did provide some samples for CVI and even that was incomplete.
Their application runs on the National Instruments VISA driver and is probably written in CVI. Our need is to integrate the line camera into an existing vb.net software program. We use Visual Studio 2008. Fortunately National Instruments does provide VISA drivers for the Visual Studio 2005 and will probably soon have an upgrade for VS2008.
Problem:
Thorlabs does not provide any information on the message protocol for the LC1-USB camera. I used the NI VISA Spy application to find out what code is being sent back and forth when using their application.
Partial Solution:
@jimmyinCT wrote:
Hello,Ive always been a big fan of labview, one of the big reasons is that I can get a good head start on any applicatino using the example programs.For this new device, a lc1-usb from thor labs, i just have had a hard time getting started.Ive read the instructions and see in need to import the labwindows drivers into labview.I see the device is in measurement and automation under usb heading and appears to be working.When i try to initialize the device, I am getting errors in debug mode saying the "device cannot be locked".Ive tried resetting it, and just havent had luck.I can upload the .vi later if it is recommended, dont have it infront of me right now.I really would just like to see an example program which is reading the input of this device.It really would help me get started in debugging if i could actually had soemthing that worked to start with.Many thanks
To get data out of the LC1 Camera proceed as follows:
Start a Windows project in VS2008.
Add the National Instruments VisaNS.DLL driver to your project references.
Since I have Measurement Studio installed it was available but I think it can be downloaded from National Instruments web site.
The NationalInstruments.VisaNS namespace exposes functions and properties to make contact with the camera.
The sample that I will post later looks first for the device named “LC1-USB” if available it will be initialized and is ready to read data from it.
ftp://micronor/transfer/
Look for the PDF
file "How to use the LC1-USB Camera"
The subroutine ReadTrace goes out reads the trace data which come in a byte array of 6136 elements.
The routine byte2WordArray converts the bytes to a 16 bit short value.
The camera has a 12 bit resolution and thus numbers will not exceed 4095.
Looking at the data it seems that the actual pixel data is inverted relative to the A/D resolution. Light levels of 0 come across as values of 4000 while high intensity values come across as numbers close to 0. This is rather strange but may explain why Thorlabs is so reluctant to provide any interface information.
National Instruments Instructions for VISA are helpful: https://www.ni.com/docs/en-US/bundle/ni-visa/page/user-manual-welcome.html
I still do not know how to set the integration time.???
The camera is useable but I could still not use it in my product because in order to setup the camera I need to launch the Thorlabs application first. Not good!!!
I only hope Thorlabs comes forward with the message description for the unit.
05-23-2008 08:05 PM