21
2010 Sample Programs Manual DCU2xxx DCC1x45x Thorlabs Instrumentation High-Resolution USB2.0 CMOS and CCD Cameras

Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

2010

Sample ProgramsManual

DCU2xxxDCC1x45x

Thorlabs Instrumentation

High-Resolution USB2.0 CMOS and CCD Cameras

Page 2: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

Version:Date:

3.5.216-Jul-10

© 2010 Thorlabs

© 2010 Thorlabs

Page 3: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

© 2010 Thorlabs

Table of Contents

Foreword 3

Part I C++ Samples 6

................................................................................................................................... 61 ActiveX Demo

................................................................................................................................... 72 Acquire Demo

................................................................................................................................... 83 Live Demo

Part II C# Samples 10

................................................................................................................................... 101 C# Demo

Part III VB.NET Samples 12

................................................................................................................................... 121 ActiveX Demo

Part IV ActiveX Browser Demo 14

Part V Appendices 16

................................................................................................................................... 161 Thorlabs 'End of Life' Policy (WEEE)

........................................................................................................................................................ 16Waste Treatment on your own Responsibility

........................................................................................................................................................ 16Ecological Background

................................................................................................................................... 172 Copyright

................................................................................................................................... 183 Addresses

Page 4: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional
Page 5: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

We aim to develop and produce the best solution for your applicationin the field of optical measurement technique. To help us to come upto your expectations and develop our products permanently we needyour ideas and suggestions. Therefore, please let us know aboutpossible criticism or ideas. We and our international partners arelooking forward to hearing from you.

Thorlabs GmbH

This part of the instruction manual contains every specific information on howto handle and use the DCx camera. A general description is followed byexplanations of how to operate the unit via USB.

Attention

This manual contains "WARNINGS" and "ATTENTION" label inthis form, to indicate danger for persons or possible damage ofequipment.

Please read these advises carefully!

NOTE

This manual also contains "NOTES" and "HINTS" written in this form.

© 2010 Thorlabs

Page 6: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional
Page 7: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

C++ Samples

DCx camera

Part

I

Page 8: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

6 DCx camera

© 2010 Thorlabs

1 C++ Samples

C++ Samples:

ActiveX Demo

Acquire Demo

Live Demo

1.1 ActiveX Demo

DCx ActiveX Demo

Application

The program uEye ActiveX demo uses the ActiveX interface of the uEye SDK in order todemonstrate the recording of live images or still images as well as the wide adjustmentpossibilities of the uEye cameras. In addition, the images can be stored in the bitmapformat.

Functional range

After a connected camera has been initialized, a live image is displayed. Changingbetween live mode, snap mode, and trigger mode is possible. A still image (snap mode)can be stored as BMP file. With the Properties button a dialog for adjusting the settingsof the connected camera is opened. With the option Use Direct3D, Direct3D functionsare used for the image display.

6

7

8

Page 9: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

7C++ Samples

© 2010 Thorlabs

Code

The camera functions are accessed via the uc480Cam object of the ActiveX wrapper

class Cuc480. (Please note the file names are CDuc480.*)

Source code and project files for environment can be found in

C:\Program Files\Thorlabs\DCx camera\Develop\Source\Demos - ActiveX\VC_Demo

The sample's executable is located in

C:\Program Files\Thorlabs\DCx camera\Samples\uc480ActiveXDemo_VC.exe

1.2 Acquire Demo

Acquire Demo

Application

This simple program illustrates how a single image can be taken from a connected DCxcamera via the SDK functions.

Functional range

On pressing the Acquire button the camera is initialized (only at the first time) and asingle image is taken and displayed. The program uses the DIB display mode.

Page 10: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

8 DCx camera

© 2010 Thorlabs

1.3 Live Demo

Live Demo

Application

This simple program illustrates how a live image can be acquired from a connected DCxcamera with the help of the SDK functions.

Functional range

With the program start a connected uEye camera is initialized. With the Stop Live andStart Live buttons the live image can be stopped and/or restarted. The program runs inDIB mode.

Code

In order to update the display with each new image from the camera the programqueries the uc480 Message IS_FRAME.

Page 11: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

C# Samples

DCx camera

Part

II

Page 12: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

10 DCx camera

© 2010 Thorlabs

2 C# Samples

2.1 C# Demo

C# Demo

Application

This program uses the SDK to demonstrate the capturing of live or still images with aDCx camera.

Functional range

When a connected camera is initialized a live picture and information about the cameraare available. The change between live mode (Live button) and snap mode (Freezebutton) is possible

Code

Accesses to the functions of the camera are accessed over the uc480 object m_hCam.

Source code and project files for environment can be found in

C:\Program Files\Thorlabs\DCx camera\Develop\Source\Demos - AllOthers\uc480_CSharp_Demo

The sample's executable is located in

C:\Program Files\Thorlabs\DCx camera\Samples\uc480_CSharp_Demo.exe

Page 13: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

VB.NET Samples

DCx camera

Part

III

Page 14: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

12 DCx camera

© 2010 Thorlabs

3 VB.NET Samples

3.1 ActiveX Demo

VB.NET ActiveX Demo

Application

The program uc480 ActiveX demo uses the ActiveX interface of the uc480 SDK todemonstrate the acquisition of live images or still images as well as the extensiveadjustment possibilities of the DCx cameras. In addition, pictures can be stored in thebitmap format.

Functional range

After a connected camera was initialized a live image is displayed. The change betweenlive mode and snap mode is possible. A still image (snap mode) can be stored as BMPFile. Via the Properties button a dialog for adjustment of the attributes of the connectedDCx camera is opened. In this dialog the trigger mode can also be activated and userdata can be written to the EEPROM of the camera.

Code

The camera functions are accessed via the uc480Cam object of the ActiveX wrapperclass Cuc480, which can be found in the VB editor over the dialog Components -

>Controls -> uc480Cam ActiveX Control Module.

Source code and project files for environment can be found in

C:\Program Files\Thorlabs\DCx camera\Develop\Source\Demos - ActiveX\Vb_Demo

The sample's executable is

C:\Program Files\Thorlabs\DCx camera\Samples\uc480ActiveXDemo_Vb.exe

Page 15: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

ActiveX Browser Demo

DCx camera

Part

IV

Page 16: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

14 DCx camera

© 2010 Thorlabs

4 ActiveX Browser Demo

ActiveX Browser-Demo

Application

This demo offers the same function as the ActiveX VB6 demo, but it works web browserbased. It needs Internet Explorer version 5.0 or higher and the permission of ActiveXcontent.

Functional range

The functions (see function range ActiveX VB6 demo) can be accessed by a contextmenu (right-click on the picture).

Code

The code is written in JavaScript and is contained in the page source code.

Page 17: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

Appendices

DCx camera

Part

V

Page 18: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

16 DCx camera

© 2010 Thorlabs

5 Appendices

5.1 Thorlabs 'End of Life' Policy (WEEE)As required by the WEEE (Waste Electrical and Electronic Equipment Directive) of the EuropeanCommunity and the corresponding national laws, Thorlabs offers all end users in the EC thepossibility to return "end of life" units without incurring disposal charges.

This offer is valid for Thorlabs electrical and electronic equipment

· sold after August 13th 2005

· marked correspondingly with the crossed out 'wheelie bin' logo

· sold to a company or institute within the EC

· currently owned by a company or institute within the EC

· still complete, not disassembled and not contaminated

As the WEEE directive applies to self contained operational electrical and electronic products, this'end of life' take back service does not refer to other Thorlabs products, such as

· pure OEM products, that means assemblies to be built into a unit by the user (e. g. OEMlaser driver cards)

· components

· mechanics and optics

· left over parts of units disassembled by the user (PCB's, housings etc.).

If you wish to return a Thorlabs unit for waste recovery, please contact Thorlabs or your nearestdealer for further information.

WEEE registration number (Germany): DE97581288

5.1.1 Waste Treatment on your own Responsibility

If you do not return an 'end of life' unit to Thorlabs, you must hand it to a company specialized inwaste recovery. Do not dispose of the unit in a litter bin or at a public waste disposal site.

5.1.2 Ecological Background

It is well known that WEEE pollutes the environment by releasing toxic products duringdecomposition. The aim of the European RoHS directive is to reduce the content of toxic substancesin electronic products in the future.

The intent of the WEEE directive is to enforce the recycling of WEEE. A controlled recycling of endof live products will thereby avoid negative impacts on the environment.

Page 19: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

17Appendices

© 2010 Thorlabs

Crossed out "Wheelie Bin" Symbol

5.2 CopyrightThorlabs GmbH has taken every possible care in preparing this User Manual. We however assumeno liability for the content, completeness or quality of the information contained therein. The contentof this manual is regularly updated and adapted to reflect the current status of the software. Wefurthermore do not guarantee that this product will function without errors, even if the statedspecifications are adhered to.

Under no circumstances can we guarantee that a particular objective can be achieved with thepurchase of this product.

Insofar as permitted under statutory regulations, we assume no liability for direct damage, indirectdamage or damages suffered by third parties resulting from the purchase of this product. In no eventshall any liability exceed the purchase price of the product.

Please note that the content of this User Manual is neither part of any previous or existingagreement, promise, representation or legal relationship, nor an alteration or amendment thereof. Allobligations of Thorlabs GmbH result from the respective contract of sale, which also includes thecomplete and exclusively applicable warranty regulations. These contractual warranty regulations areneither extended nor limited by the information contained in this User Manual. Should you requirefurther information on this product, or encounter specific problems that are not discussed in sufficientdetail in the User Manual, please contact your local Thorlabs dealer or system installer.

All rights reserved. This manual may not be reproduced, transmitted or translated to anotherlanguage, either as a whole or in parts, without the prior written permission of Thorlabs GmbH.

Status: 2010

© Thorlabs GmbH. All rights reserved.

Page 20: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional

18 DCx camera

© 2010 Thorlabs

5.3 AddressesEurope: Thorlabs GmbH

Hans-Boeckler-Str. 6

D-85221 Dachau/Munich

Fed. Rep. of Germany

Phone: +49 8131 5956 0Fax: +49 8131 5956 99Email: [email protected]: http://www.thorlabs.com

US, Canada & Mexico: Thorlabs, Inc.435 Route 206 NorthNewton, NJ 07860USA

Phone: +1 973 579 7227Fax: +1 973 300 3600Email: [email protected]: http://www.thorlabs.com

Japan: Thorlabs Japan, Inc.

Higashi IkebukuroQ Building 1st floor 2-23-2

Toshima-ku, Tokyo 170-0013

Japan

Phone: +81 3 5979 8889Fax: +81 3 5979 7285Email: [email protected]: http://www.thorlabs.jp

China: Thorlabs China

Oasis Middlering Centre

3 Building 712 Room

915 Zhen Bei Road

Shanghai

China

Sales and Support

Phone: +86 21 32513486

Fax: +86 21 32513482

Email: [email protected]

Web: http://www.thorlabs.com

Our company is also represented by several distributors and sales offices throughout the world.Please call our hotline, send an email to ask for your nearest distributor or just visit our homepage http://www.thorlabs.com

Page 21: Sample Programs Manual · 2 C# Samples 2.1 C# Demo C# Demo Application This program uses the SDK to demonstrate the capturing of live or still images with a DCx camera. Functional