You are on page 1of 2

Interfacing to LabVIEW

Interfacing DataRay Camera and Scanning Slit Profilers to LabVIEW


Start in the standard software:

As Administrator, install the DataRay software which came with your product.
Open and close the software to install the drivers.
Attach the profiler product. Allow the drivers to install.
Open the DataRay software and select your profiler in the Device pull-down menu.
Learn to use your product in the DataRay software. Then close the software.

Add LabVIEW: We do not claim to be LabVIEW experts. [ we dont know what we dont know]. Install LabVIEW Ver. 8.5 or
higher on your computer (earlier versions are not supported). Download the appropriate LabVIEW example from the
DataRay website:

Cameras: Download & unzip: http://www.dataray.com/assets/software/WinCam_Example_LV8.5.zip


BeamMap2, BeamR2, ColliMate: Download & unzip: http://www.dataray.com/assets/software/BeamR2_Example_LV8.5.zip
Reading WCF files: Download & unzip:
http://www.dataray.com/assets/software/WinCam_ReadWCF_ExportToExcelVI_Example_LV8.5.zip
BeamScope-P8: TBA

Run LabVIEW: To start the LabVIEW example, open LabView. Open the appropriate DataRay LabVIEW example. Click on
the Ready button. Running? great. The buttons which you see work just as they do within the normal DataRay GUI.
Not running? Check the earlier steps.
Camera example:

Shown left is the working downloadable


LabVIEW example from the website.
Note: All the settings from the last DataRay.exe
software session are recalled and used unless
expressly changed in LabVIEW. You can recall a
Job file of your choice from within LabVIEW.

Still not running?


Email support@dataray.com or call +1 530 472 1716 with:

Device name and serial number


DataRay, Windows & LabView versions which you are using.

www.dataray.com | 1-866-WinCamD (946-2263) | sales@dataray.com


Interfacing to LabVIEW Rev. 031814

DataRay OCX: LabVIEW communicates with DataRay products through the DataRay OCX. The OCX is automatically generated and registered with the Windows operating system upon installing the DataRay software. Once initialized in a VI,
the OCX is always running. This means that the camera is still running, even while editing the VI. Do not be alarmed if
DataRay OCX GUI elements are active while your VI is not running. This is the expected behavior.
To add results in LabVIEW: To add results not in the LabView example:
Close the LabVIEW example. Open the DataRay software.
Right click on any result, to see the dialog right:
Note current Name and ID# for this result at the top of the dialog.
Repeat for all the results of interest. Close the DataRay software.
Open example VIs Block Diagram. Right-click on an existing GetData
Method or Property. From the pull-down menu select
Create-> Method for ->GetOCXResult. The floating box shown below will appear.

You will need to connect this where you want it in the block
diagram, either serially or in parallel. Create an integer constant,
give it the ID# value noted earlier, and connect it to the left side
of IndexToValue.
A complete list of indexes can be found here:
http://www.dataray.com/assets/pdf/IndexToTestParametersEnum.pdf

Create a double indicator and connect it to GetOcxResult.


Now, when run, the VI will produce the same value the DataRay
software would have produced for that result.
Add Methods in LabVIEW: To add Methods not in the LabView example:
Follow the above steps, but substitute the GetOCXResult with the
method of choice.
Additional Classes: The previous example showed you how to
implement methods from the GetData class of the DataRay OCX.
This class provides the majority of what most of our customers need. However, the DataRay OCX contains several other
classes:
Button Control displays buttons from DataRay GUI. See list of Button IDs at:
http://www.dataray.com/assets/pdf/IndexToTestParametersEnum.pdf
CCDimage Control Displays and controls the main image from our cameras
PaletteBar Control Displays palette bar for images
Profiles Control Displays and controls profile views. See list of Profile IDs:
http://www.dataray.com/assets/pdf/ProfilesEnum.pdf
ThreeDview Control Displays and controls 3D view of data
TwoD Control Displays and controls 2D view of data
Inserting Additional Classes:
On the Front Panel, right-click, navigate to the .NET and ActiveX menu and select ActiveX Container.
Right click on the ActiveX Container and select Insert ActiveX Object
Select desired class from the list (this list will contain all available ActiveX Objects, not just DataRays)
Right clicking on the ActiveX Object in the Block Diagram will expose that classs properties and methods.
Problems/Questions? As above, contact us with the information listed above, plus your code.

www.dataray.com | 1-866-WinCamD (946-2263) | sales@dataray.com


Interfacing to LabVIEW Rev. 031814

You might also like