Newport SMC100PP, SMC100CC User Manual

Single-Axis Motion Controller/Driver
for DC or Stepper Motor
LabVIEW Driver Manual
in NSTRUCT Environment
Version 1.0.x
For Motion, Think Newport
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 ii
Preface
Confidentiality & Proprietary Rights
Reservation of Title
The Newport Programs and all materials furnished or produced in connection with them ("Related Materials") contain trade secrets of Newport and are for use only in the manner expressly permitted. Newport claims and reserves all rights and benefits afforded under law in the Programs provided by Newport Corporation.
Newport shall retain full ownership of Intellectual Property Rights in and to all development, process, align or assembly technologies developed and other derivative work that may be developed by Newport. Customer shall not challenge, or cause any third party to challenge, the rights of Newport.
Preservation of Secrecy and Confidentiality and Restrictions to Access
Customer shall protect the Newport Programs and Related Materials as trade secrets of Newport, and shall devote its best efforts to ensure that all its personnel protect the Newport Programs as trade secrets of Newport Corporation. Customer shall not at any time disclose Newport's trade secrets to any other person, firm, organization, or employee that does not need (consistent with Customer's right of use hereunder) to obtain access to the Newport Programs and Related Materials. These restrictions shall not apply to information (1) generally known to the public or obtainable from public sources; (2) readily apparent from the keyboard operations, visual display, or output reports of the Programs; (3) previously in the possession of Customer or subsequently developed or acquired without reliance on the Newport Programs; or (4) approved by Newport for release without restriction.
©2011 Newport Corporation 1791 Deere Ave. Irvine, CA 92606, USA (949) 863-3144
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
iii EDH0312En1010 – 10/11
Table of Contents
Preface ....................................................................................................................................ii
Confidentiality & Proprietary Rights..................................................................ii
1.0 Introduction............................................................................................... 1
1.1 Purpose...........................................................................................................................................1
1.2 Overview........................................................................................................................................1
1.3 LabVIEW project: Communication DLL location......................................................................1
1.4 LabVIEW application (EXE): Communication DLL Distribution............................................1
2.0 Prerequisites.............................................................................................. 2
2.1 Install LabVIEW 2010..................................................................................................................2
2.2 Download and install Newport NSTRUCT .................................................................................2
2.3 Newport NSTRUCT Server..........................................................................................................2
2.4 Connect your Newport instrument ...............................................................................................2
3.0 LabVIEW drivers used in the NSTRUCT environment.......................... 3
3.1 Finding the Newport instrument LabVIEW driver .....................................................................3
3.2 Adding Newport Instrument menu to LabVIEW ........................................................................4
3.3 Menu contents for Newport instrument.......................................................................................5
4.0 LabVIEW Example with SMC100 instrument ........................................ 7
4.1 LabVIEW project creation ............................................................................................................7
4.2 First step: instrument connection..................................................................................................7
4.3 Second step: Invoking an instrument command ..........................................................................8
4.4 Last step: Instrument disconnection ...........................................................................................10
4.5 Functional example .....................................................................................................................11
4.5.1 Project......................................................................................................................11
4.5.2 Diagram...................................................................................................................11
4.5.3 Associated Front Panel...........................................................................................11
5.0 Knowledges from National Instruments ................................................ 12
5.1 Loading .NET Assemblies in LabVIEW ...................................................................................12
5.2 Loading VIs with an Updated Assembly ...................................................................................12
Service Form.................................................................................................... 15
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 iv
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 1
SMC100
Single-Axis Motion Controller
1.0 Introduction
1.1 Purpose
The purpose of this document is to provide instructions on how to use the SMC100 LabVIEW driver.
This document shows:
How to connect with a selected instrument How to use a function from the Command Interface library How to disconnect the connected instrument.
1.2 Overview
The SMC100 LabVIEW driver allows developing a LabVIEW program for a SMC100 controller in the NSTRUCT environment.
The Newport LabVIEW driver for SMC100 uses the .NET assembly named Newport.SMC100.CommandInterface.DLL.
The current Newport LabVIEW driver structure has been implemented following the National Instruments instructions on “Loading .NET …” as reported in §4.5.1.
The LabVIEW drivers are presents in the “Labview” directory from the selected instrument directory. Its subfolder named “Dll” contains the needed assemblies’ .NET.
1.3 LabVIEW project: Communication DLL location
Refer you to the National Instrument manuals to know how to create a LabVIEW project.
Copy the “Dll” subfolder in the directory of your LabVIEW project. This is required
step to work.
NOTE
The .NET assemblies contained in the “dll” subfolder must be presents in your labVIEW project directory to work.
1.4 LabVIEW application (EXE): Communication DLL Distribution
Refer you to the National Instrument manuals to know how to create an executable from a LabVIEW project.
After the executable building, copy ALL files from “Dll” subfolder to the “data” subfolder of your EXE directory. This is required step to make your EXEs run.
NOTE
The .NET assemblies contained in the “dll” subfolder must be presents in your EXE application directory to work.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 2
2.0 Prerequisites
2.1 Install LabVIEW 2010
The LabVIEW 2010 from National Instruments must be installed on your computer.
2.2 Download and install Newport NSTRUCT
If the Newport NSTRUCT application is not installed on your computer then download it from the Newport web site: http://www.newport.com/NSTRUCT
Alternatively, the software may be downloaded using Menus as follows:
SALES & SUPPORTS > Softwares & Download > NSTRUCT Software & Applets
2.3 Newport NSTRUCT Server
The Newport NSTRUCT server must be running to communicate with your device.
2.4 Connect your Newport instrument
Before to connect your Newport instrument, read the manual to install its communication driver. The best way is to follow this manual to install the communication driver of your Newport instrument.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
3 EDH0312En1010 – 10/11
3.0 LabVIEW drivers used in the NSTRUCT environment
3.1 Finding the Newport instrument LabVIEW driver
With NSTRUCT, a folder is created from “Program files” for each instrument in \NSTRUCT\Instruments folder. From the selected instrument directory, a “Labview directory is present.
Its subfolder named “Dll” contains the assemblies’ .NET is mandatory. It must be
present in your LabVIEW project directory.
For the SMC100, refer you to the following path:
C:\Program Files\Newport\Instrument Manager\NSTRUCT\Instruments\SMC100\LabView
The “Dll” subfolder contains the assemblies necessary for the LabVIEW project:
A labview project will be provided with two important VIs: “Connect” and “Disconnect”.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 4
3.2 Adding Newport Instrument menu to LabVIEW
A menu file (.mnu) for LabVIEW is provided for each instrument. The menu file is availalable in the following path: C:\Program Files\Newport\Instrument Manager\NSTRUCT\Instruments\...\LabVIEW
NOTE
This menu must be copied in the directory “user.lib” of your LabVIEW.
This menu allows you to access to each instrument driver when the “User libraries” is selected from the LabVIEW functions panel.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
5 EDH0312En1010 – 10/11
3.3 Menu contents for Newport instrument
LW SMC100_Connect
This VI creates an instance of the selected instrument. The instrument is registered to the NSTRUCT server and the communication is ready.
Inputs
Instrument Key: represents the instrument key from the NSTRUCT server. If it’s empty, a dialog box is displayed to purpose a device list. Then the user can selected one instrument from this list.
error in: describes LabVIEW error conditions that occur before this node runs.
Outputs
ConexPSD Reference: represents the instrument instance.
Component ID: the identifier of the instrument from the NSTRUCT server.
Instrument Key: represents the instrument key from the NSTRUCT server.
error out: contains LabVIEW error information.
LWSMC100_Disconnect
This VI is used to remove the instance of the selected instrument. The instrument is unregistered from the NSTRUCT server and the communication is closed.
Inputs
SMC100 Reference: represents the instrument instance.
Component ID: the identifier of the instrument from the NSTRUCT server.
error in: describes LabVIEW error conditions that occur before this node runs.
Outputs
error out: contains LabVIEW error information.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 6
Invoke Node (from the .NET library provided by LabVIEW)
This dynamic VI allows to access to all commands of the selected instrument from the CommandInterface DLL. The user can select one function from a list.
The command syntax is “AA”. The command name is the beginning of the function name. That allows the user to refer to the controller’s manual to get the description of the command to select.
Inputs
reference is the refnum associated with the instrument object on which you want to invoke a method or perform an action.
error in describes LabVIEW error conditions that occur before this node runs.
input 1..n are example input parameters of a method.
Outputs
reference out returns reference unchanged.
error out contains LabVIEW error information.
return value is an example return value of a method.
output 1..n are example output parameters of a method.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
7 EDH0312En1010 – 10/11
4.0 LabVIEW Example with SMC100 instrument
4.1 LabVIEW project creation
Create a labVIEW project (refer you to the National Instrument manuals to know how to create a LabVIEW project) in the NSTRUCT “Labview” directory of the selected instrument. It’s a necessary step to develop with the Newport LabVIEW driver. The labVIEW development must be done from this opened project.
NOTE: Project must be opened when you do the LabVIEW coding work.
4.2 First step: instrument connection
In your labVIEW project, open a new Labview diagram, right click to open the “functions” panel and choose the “User libraries” menu. Next, select the “Instrument for NSTRUCT” menu to open the panel of functions. For SMC100, the “SMC100 for NSTRUCT” menu is selected to open the panel of functions for SMC100.
Select the VI LWInstrument_Connect.vi from the panel of the selected instrument. For SMC100, the selected VI will be LWSMC100_Connect.vi as the selected instrument is a SMC100.
It is the first step to be able to communicate with your instrument. At this step, an instance of your instrument is created.
The “LWInstrument_Connect” VI returns a “ComponentID” that refers to the NSTRUCT server. This “ComponentID” must be used with each subsequent function from the instrument instance.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 8
4.3 Second step: Invoking an instrument command
Select the “Invoke Node” from the function panel:
User libraries > Instrument for NSTRUCT > Invoke Node
For SMC100: User libraries > SMC100 for STRUCT > Invoke Node
NOTE
It’s possible to select the “Invoke Node” from Connectivity > .NET menu.
Link the ‘Instrument Reference’ output from LWInstrument_Connect to the ‘reference’ input from the Invoke Node.
For SMC100: ‘SMC100 Reference’. After the link, the Invoke Node header becomes “SMC100”.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
9 EDH0312En1010 – 10/11
Now, a list of functions for the selected instrument is accessible. Right click on the Invoke Node and select the menu “select a method”: a list of functions is displayed. This list contains all the functions of the instrument.
In our example, the selected function is “VE” to get the version of the selected instrument.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 10
4.4 Last step: Instrument disconnection
At the end of the LabVIEW program, the instrument is disconnected and its instance must be closed.
So, right click to open the “functions” panel and choose the “User libraries” menu. Next, go to the “Instrument for NSTRUCT” menu and select the
LWInstrument_Disconnect.vi. For SMC100, the selected VI will be LWSMC100_Disconnect.vi from the “SMC100
for NSTRUCT” panel.
It is the last step of your program. At the end of your program, the instance of your selected instrument will be deleted properly.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
11 EDH0312En1010 – 10/11
4.5 Functional example
4.5.1 Project
4.5.2 Diagram
4.5.3 Associated Front Panel
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 12
5.0 Knowledges from National Instruments
From LabVIEW 2010 Help Edition Date: June 2010 Part Number: 371361G-01
http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/loading_assemblies/
5.1 Loading .NET Assemblies in LabVIEW
If you reference a .NET object from the front panel or block diagram of a VI, ensure that LabVIEW can load the .NET assembly for that object. The Common Language Runtime (CLR) is responsible for locating .NET assemblies that you call. Refer to the
Microsoft Developer Network (MSDN) Web site for more information about how the
CLR locates assemblies. If the CLR cannot find the assembly, LabVIEW then searches for the assembly in the same manner it searches for missing VIs. LabVIEW searches for missing VIs in the directories you specify on the Paths page of the Options dialog box. If LabVIEW cannot find the .NET assembly for a .NET object referenced directly on the front panel or block diagram, LabVIEW generates a load-time error. If LabVIEW cannot load a dependent assembly needed during run-time, LabVIEW generates a run­time error.
The CLR uses the directory of the running executable as the default search path when it loads private .NET assemblies. If you reference a .NET object from a VI that does not belong to a LabVIEW project, the CLR considers LabVIEW.exe to be the running executable. The CLR therefore searches for private assemblies in the directory in which the LabVIEW.exe file is located. If you reference a .NET object from a VI that does
belong to a LabVIEW project, the CLR considers the project to be the running executable. The CLR therefore searches for private assemblies in the project directory. If you reference a .NET assembly from a VI and the assembly does not
belong to the .NET Framework, National Instruments strongly recommends that you store the VI in a project to avoid having to place files in the directory in which the LabVIEW.exe file is located.
If you call a .NET assembly from a VI that does not belong to a project, you technically can save the assembly in the same directory as its calling VI. LabVIEW searches certain VI directories, including the calling VI directory, for assemblies that the CLR cannot load by default. However, calling assemblies stored in this location can result in name conflicts and other unexpected .NET behavior. Therefore, National Instruments does not recommend that you save assemblies in this location.
5.2 Loading VIs with an Updated Assembly
Microsoft Visual Studio .NET and other development tools provided in the .NET Framework SDK can assign strong names to an assembly. Assemblies with the same strong name are expected to be identical.
When you load a VI with a change in the path of a .NET assembly or with a change in the version number or culture string of a strong-named assembly, LabVIEW launches a warning dialog box informing you of the change. Once loaded, the VI includes an asterisk in its title bar and in the list of open VIs displayed in the Window menu. When you save the VI, the asterisk disappears until you make a new change.
When you load a VI with a change in the time stamp of a .NET assembly, LabVIEW does not launch a warning dialog box but does display an asterisk in the title bar of the VI.
Refer to the KnowledgeBase at ni.com for more information about how to select and load specific versions of .NET Assemblies.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
13 EDH0312En1010 – 10/11
.
SMC100CC & SMC100PP Single-Axis Motion Controller/Driver for DC or Stepper Motor
EDH0312En1010 – 10/11 15
Service Form
Your Local Representative
Tel.: ___________________
Fax: ___________________
Name: __________________________________________________ Return authorization #: _____________________________________
Company: _______________________________________________
(Please obtain prior to return of item)
Address: ________________________________________________ Date: ___________________________________________________
Country: ________________________________________________ Phone Number:___________________________________________
P.O. Number: ____________________________________________ Fax Number:_____________________________________________
Item(s) Being Returned: ____________________________________
Model#:_________________________________________________ Serial #:_________________________________________________
Description:_________________________________________________________________________________________________________
Reasons of return of goods (please list any specific problems): _________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
North America & Asia
Newport Corporation 1791 Deere Ave. Irvine, CA 92606, USA
Sales
Tel.: (800) 222-6440 e-mail: sales@newport.com
Technical Support
Tel.: (800) 222-6440 e-mail: tech@newport.com
Service, RMAs & Returns
Tel.: (800) 222-6440 e-mail: rma.service@newport.com
Europe
MICRO-CONTROLE Spectra-Physics S.A.S 1, rue Jules Guesde – Bât. B ZI Bois de l’Épine – BP189 91006 Evry Cedex France
Sales
Tel.: +33 (0)1.60.91.68.68 e-mail: france@newport-fr.com
Technical Support
e-mail: tech_europe@newport.com
Service & Returns
Tel.: +33 (0)2.38.40.51.55
Visit Newport Online at:
www.newport.com
Loading...