MPMS MultiVu EDC Manual A0
MPMS MultiVu EDC Manual A0
Measurement System
External Device Control Language
User’s Manual
For the MPMS MultiVu Software Application
Trademarks
Product and company names appearing in this manual are trademarks or registered trademarks of their respective holders.
U.S. Patents
5,053,834 High Symmetry DC Squid System
5,139,192 Superconducting Bonds for Thin Film Devices
5,311,125 Magnetic Property Characterization System Employing a Single Sensing Coil Arrangement to Measure AC
Susceptibility and DC Moment of a Sample (patent licensed from Lakeshore)
5,319,307 Geometrically and Electrically Balanced DC Squid System Having a Pair of Intersecting Slits
5,647,228 Apparatus and Method for Regulating Temperature in Cryogenic Test Chamber
Foreign Patents
U.K. 9713380.5 Apparatus and Method for Regulating Temperature in Cryogenic Test Chamber
Canada 2,089,181 High Symmetry DC Squid System
Japan 2,533,428 High Symmetry DC Squid System
C O N T E N T S
Table of Contents
PREFACE
Contents and Conventions ...............................................................................................................................vii
P.1 Introduction .......................................................................................................................................................vii
P.2 Scope of the Manual..........................................................................................................................................vii
P.3 Contents of the Manual .....................................................................................................................................vii
P.4 Conventions in the Manual...............................................................................................................................viii
CHAPTER 1
Introduction and Installation........................................................................................................................ 1-1
1.1 Introduction ..................................................................................................................................................... 1-1
1.2 Overview of the EDC Language ..................................................................................................................... 1-1
1.2.1 Function of Borland Delphi...................................................................................................................... 1-2
1.3 Comparison between MPMS MultiVu EDC and MPMSR2 EDC .................................................................. 1-2
1.4 Installing the EDC Option ............................................................................................................................... 1-5
CHAPTER 2
EDC Operation ................................................................................................................................................... 2-1
2.1 Introduction ..................................................................................................................................................... 2-1
2.2 EDC Programs................................................................................................................................................. 2-1
2.2.1 Components of the EDC Program ............................................................................................................ 2-2
2.2.1.1 Library Declaration............................................................................................................................ 2-2
2.2.1.2 Uses Block......................................................................................................................................... 2-2
2.2.1.3 Var Block........................................................................................................................................... 2-3
2.2.1.4 Function Blocks................................................................................................................................. 2-3
2.2.1.5 Exports Block .................................................................................................................................... 2-3
2.2.1.6 EDCExitProc Procedure .................................................................................................................... 2-4
2.2.2 Variables................................................................................................................................................... 2-5
2.3 EDC Functions ................................................................................................................................................ 2-6
2.3.1 Initialize Function..................................................................................................................................... 2-7
2.3.2 Execute Function ...................................................................................................................................... 2-8
2.3.3 Finish Function......................................................................................................................................... 2-9
2.4 EDC Sequence Commands............................................................................................................................ 2-10
2.4.1 Initialize EDC ......................................................................................................................................... 2-10
2.4.2 Execute EDC .......................................................................................................................................... 2-11
2.4.3 End EDC................................................................................................................................................. 2-11
2.5 Working with EDC........................................................................................................................................ 2-12
2.5.1 Writing an EDC Program ....................................................................................................................... 2-12
2.5.2 Running an EDC Program...................................................................................................................... 2-13
2.5.3 Aborting an EDC Sequence.................................................................................................................... 2-13
2.5.4 Running an EDC Program in the Delphi Debugger ............................................................................... 2-15
CHAPTER 3
EDC Commands ................................................................................................................................................ 3-1
3.1 Introduction ..................................................................................................................................................... 3-1
3.2 Overview of EDC Commands ......................................................................................................................... 3-1
3.2.1 Command Syntax ..................................................................................................................................... 3-2
3.2.2 Guide to Location of Commands in the Chapter ...................................................................................... 3-3
3.2.2.1 System Environment Commands....................................................................................................... 3-3
3.2.2.2 System Measurement Commands...................................................................................................... 3-3
3.2.2.3 GPIB Communication Commands .................................................................................................... 3-3
3.2.2.4 Data File Commands ......................................................................................................................... 3-4
3.2.2.5 Utility Commands.............................................................................................................................. 3-4
3.3 System Environment Commands..................................................................................................................... 3-5
3.3.1 Wait .......................................................................................................................................................... 3-5
3.3.2 SetField..................................................................................................................................................... 3-6
3.3.3 GetField .................................................................................................................................................... 3-7
3.3.4 UpdateField .............................................................................................................................................. 3-7
3.3.5 SetTemp.................................................................................................................................................... 3-8
3.3.6 GetSystemTemp ....................................................................................................................................... 3-8
3.3.7 GetBridgeTemp ........................................................................................................................................ 3-9
3.4 System Measurement Commands.................................................................................................................. 3-10
3.4.1 SetDCMeasParams ................................................................................................................................. 3-10
3.4.2 MeasureDC............................................................................................................................................. 3-11
3.4.3 GetDCMoment ....................................................................................................................................... 3-12
3.4.4 GetDCStdDev......................................................................................................................................... 3-12
3.4.5 SetRSOMeasParams ............................................................................................................................... 3-13
3.4.6 MeasureRSO........................................................................................................................................... 3-14
3.4.7 GetRSOMoment ..................................................................................................................................... 3-15
3.4.8 GetRSOStdDev....................................................................................................................................... 3-15
3.4.9 SetACMeasParams ................................................................................................................................. 3-16
3.4.10 MeasureAC........................................................................................................................................... 3-17
3.4.11 GetACFrequency .................................................................................................................................. 3-18
3.4.12 GetACmPrime ...................................................................................................................................... 3-18
3.4.13 GetACmDblPrime ................................................................................................................................ 3-19
3.4.14 GetACMeasAmp .................................................................................................................................. 3-19
3.4.15 GetACMeasPhase................................................................................................................................. 3-20
3.4.16 GetACmPrimeStdDev .......................................................................................................................... 3-20
3.4.17 GetACmDblPrimeStdDev .................................................................................................................... 3-21
3.4.18 GetACMeasAmpStdDev ...................................................................................................................... 3-21
3.4.19 GetACMeasPhaseStdDev ..................................................................................................................... 3-22
3.5 GPIB Communication Commands ................................................................................................................ 3-23
3.5.1 SendRead................................................................................................................................................ 3-23
3.5.2 SendReadNumber................................................................................................................................... 3-24
3.5.3 Send ........................................................................................................................................................ 3-25
3.5.4 Read........................................................................................................................................................ 3-26
3.5.5 ReadNumber........................................................................................................................................... 3-27
References ..............................................................................................................................................References-1
Figures
Figure 2-1. Select an EDC File to Initialize Dialog Box ........................................................................................ 2-10
Figure 2-2. Execute EDC Program Dialog Box ..................................................................................................... 2-11
Figure 2-3. Abort EDC Program Dialog Box......................................................................................................... 2-14
Figure 2-4. Warning Message in Abort EDC Program Dialog Box....................................................................... 2-14
Figure 2-5. Run Parameters Dialog Box ................................................................................................................ 2-15
Figure 2-6. Add Source Breakpoint Dialog Box .................................................................................................... 2-15
Tables
Table 1-1. EDC Command Compatibility Chart ...................................................................................................... 1-3
Table 2-1. MPMS MultiVu Units Required to Run EDC Program.......................................................................... 2-2
P.1 Introduction
This preface contains the following information:
• Section P.2 discusses the overall scope • Section P.4 illustrates and describes
of the manual. conventions that appear in the manual.
• Section P.3 briefly summarizes the
contents of the manual.
This manual assumes you are familiar with the Windows operating system.
File¾Open The ¾ symbol indicates that you select multiple, nested software options.
.dat The Courier font distinguishes code and the names of files and directories.
<Enter> Angle brackets distinguish the names of keys located on the PC keyboard.
<Alt+Enter> A plus sign connecting the names of two or more keys distinguishes keys you
press simultaneously.
1.1 Introduction
This chapter contains the following information:
• Section 1.2 presents an overview of the • Section 1.4 explains how to install the
EDC language. EDC option.
• Section 1.3 compares the MPMS MultiVu
EDC language and the MPMSR2 EDC
language.
EDC provides the ability to trigger devices, send data, receive data, and wait until a condition is met
or a specified length of time elapses. EDC allows control of the system temperature and magnetic
field and of measurement and plotting functions. EDC supports real and string variables, and it
allows mathematical operations as well as real-time user input. Standard programming functions,
such as loops, conditionals, and subroutines, make EDC programs flexible and easy to read. Program
comments, which are enclosed in curly brackets, can be included in an EDC file and are ignored by
the Delphi compiler.
The new EDC language requires only a short learning curve while providing enhanced capabilities.
However, the user is responsible for implementing EDC correctly. Poorly written code can lock up
the system and create infinite loops. This manual includes guidelines and sample code that should be
reviewed before the EDC language is used.
The EDC option includes a predefined project template file that is already set up to start writing EDC
programs. This predefined project file includes commented sections indicating where code to control
the program is written. The EDC option project is linked to several precompiled Delphi unit files that
provide access to an Mpms object variable that encapsulates a long list of functions for accessing the
MPMS system, executing measurements, and writing MPMS MultiVu data files.
MPMS MultiVu and the new EDC option utilize the National Instruments GPIB interface instead
of the Hewlett-Packard HPIB interface, which was used by the MPMSR2 DOS software. The GPIB
commands do not require that the 70 prefix be added to the device number. In MPMS MultiVu EDC,
just ‘6’ instead of ‘706’ is used in order to address device 6. In addition, the HPIB interface for
MPMSR2 EDC terminated all commands with a linefeed character (hex value 0A). MPMS MultiVu
EDC adds no terminating character to commands sent down the GPIB bus. However, the GPIB
interface raises the EOI line at the end of a command. If a specific device requires terminating
characters, you must append them to the command string. The Model 1802 Digital R/G Bridge
(device 8) and Model 1822 MPMS Controller (device 6) require either a linefeed or a semicolon
character to terminate their commands. Refer to the following example:
Mpms.Send(22,'R4x'#13#10);
This example appends a carriage return and linefeed characters to the command string.
The MPMS MultiVu EDC program is a fully functional Windows DLL, so the user has full access to
the Windows 32-bit API. Because the EDC option was not designed to run as a separate application,
it does not work efficiently with its own windows and dialogs. However, simple message boxes as
well as input dialogs for collecting user input are available.
MPMS MultiVu EDC is controlled by sequence commands in an MPMS MultiVu sequence. The
Execute EDC command allows the user to specify a string to pass to the EDC program so he or she
can program varying functionality into an EDC program in order to allow one program to perform
numerous tasks.
(table continues)
EDC Operation
2.1 Introduction
This chapter contains the following information:
• Section 2.2 presents an overview of • Section 2.5 explains how to write and
EDC programs and discusses program run an EDC program.
components.
• Section 2.3 discusses EDC functions. • Section 2.6 discusses EDC data files.
• Section 2.4 discusses the MPMS MultiVu • Section 2.7 describes EDC program
EDC sequence commands. operation.
The EDC project contains three export functions⎯Initialize, ExecuteEDC, and Finish⎯which are the
functions the MPMS MultiVu software accesses from a running sequence. To build an EDC program,
you only need to add code to the Initialize, ExecuteEDC and Finish functions. The Initialize EDC,
Execute EDC, and End EDC MPMS MultiVu sequence commands call the EDC functions in the
EDC DLL. Initialize EDC calls the Initialize function, Execute EDC calls the ExecuteEDC function,
and End EDC calls the Finish function in whichever EDC DLL was initialized.
The library declaration at the beginning of the EDC project file tells Delphi to build a DLL with
whatever name is specified by the declaration. The specified name is the name of the project file.
When you use the Delphi File¾Save Project As menu command to save the project file with a new
name, the name in the library declaration and the name of the DLL file are automatically changed.
uses
SysUtils,
Classes,
Windows,
Dialogs,
{MultiVu units required to run EDC program}
MpmsUnit, MpmsExports, MpmsOleDll, MpmsDefinitions;
The uses block in the EDC project file defines which Delphi and MPMS units each EDC program
must include. The Delphi-supplied units included in the uses block provide a wide variety of
Delphi functionality. The MPMS units provide access to the MPMS system and to constants and
enumerations used in the Mpms object member functions. You must not remove any unit name
appearing in the uses block.
If you write your own Delphi units, add their file names to the uses block in order to include them in
the project build. You may also need to include some of these units in the uses block of your units.
For more information about either the uses block or Delphi units, refer to the Delphi on-line
documentation.
var
ExitProcSave : Pointer; {Default Exit procedure pointer, Do Not
Remove.}
{------------------- Start of User Code ------------------------}
{User defined types go here}
The var block that follows the uses block is used to declare global variables for the DLL program.
Refer to section 2.2.2 and to the Delphi on-line documentation for a more detailed explanation of
global variables and how they are used.
{do not modify these export declarations unless you add more}
exports
Initialize,
ExecuteEDC,
Finish;
The exports block lists the names of the functions exported by the DLL. Exported functions can
be accessed by other applications that use the DLL. The exported functions are the functions that
MPMS MultiVu accesses through the EDC sequence commands. The Initialize, ExecuteEDC, and
Finish functions must always appear in the exports block. Do not delete these three functions.
If MPMS MultiVu does not find the Initialize, ExecuteEDC, and Finish functions, the EDC program
cannot be executed.
procedure EDCExitProc;
begin
{------------------- Start of User Code ------------------------}
{Users DLL exit code goes here.}
//////////////////////////////////////////////////////////////////
begin
{------------------- Start of User Code ------------------------}
{Users DLL initialization code goes here.}
end.
The EDCExitProc procedure appearing near the end of a project file is called when the DLL is
removed from memory by the calling application. MPMS MultiVu removes all EDC programs that
were used by a sequence when the sequence ends or is terminated. Use of this procedure is optional
and, in most cases, unnecessary. The last begin ... end block is the DLL initialization block that
is called when the DLL is first loaded into memory by the calling application. Although this section
can be used, it is not necessary given the Initialize function and its intended purpose.
2.2.2 Variables
The Delphi language supports the use of local and global variables in your program. Local variables
are declared in the var section of each function. Global variables are declared in the var block of the
project file or in the unit file if you are writing a Delphi unit.
Local variables are valid only during the execution of the function in which they are declared. When
the function ends, the variable’s contents are lost.
Global variables are valid for the life of the DLL; that is, they are valid while the DLL remains loaded
in memory by the calling application. MPMS MultiVu loads the EDC program DLL when it is first
executed through either the Initialize EDC or Execute EDC sequence command.
The first time any function is called in an EDC program, MPMS MultiVu loads the EDC program
DLL into memory, and the DLL then remains in the MPMS MultiVu process space for the duration
of the running sequence. When the sequence terminates normally or is aborted, the DLL is freed by
MPMS MultiVu so that the Windows operating system can remove it from memory.
Each function in the EDC program returns an integer to the MPMS MultiVu sequence command.
The integer can be used to indicate the success or failure of the function. A return value of 0 indicates
no errors occur during execution, and because no errors occur, MPMS MultiVu continues to the next
sequence command. A return value of -1 (FATAL_ERROR) indicates a fatal error occurs and causes
MPMS MultiVu to display an error message and abort the running sequence. Any other return value
displays an error message and logs the value returned to the present event log file.
Every function block includes three keywords: try, except, and end. You enter code between the
try and except keywords. Any code you enter following the except keyword is executed only in
an exception. Refer to the Delphi on-line documentation for more information about exceptions.
It is advisable to use the EDC functions to perform generic operations. Keeping the EDC program
generic makes it versatile and reusable, so you can perform another operation by just making quick
changes to the sequence. You can, of course, write EDC programs to perform many functions to
collect measurement data all within the confines of a single function. However, this can make it
difficult for you to gauge the progress of the program while it is running. If you use the MPMS
MultiVu sequence commands to perform a portion of the functionality of a program, the progress
of the program is more visible in the Sequence Status dialog box.
The Initialize function is intended to initialize an external device so that the device is prepared for
subsequent calls. For instance, the Initialize function can be used to send a series of commands to
a device to set specific ranges for upcoming measurements. The Initialize function should also be
used to initialize global variables or to allocate dynamic variables and data structures.
The Initialize EDC sequence command calls the Initialize function in the EDC program. Typically,
Initialize EDC is called once in any sequence and is used to initialize an EDC program and to block
sequence commands together that address the identical EDC program. Section 2.4.1 discusses
Initialize EDC in more detail.
The ExecuteEDC function is intended to perform the actual EDC measurement. ExecuteEDC can
access any global variables and the values of those variables will be maintained during subsequent
calls from the sequence command. ExecuteEDC can be called repeatedly by the MPMS MultiVu
sequence.
The Execute EDC sequence command calls the ExecuteEDC function in the EDC program. Section
2.4.2 discusses Execute EDC in more detail.
The ExecuteEDC function has one parameter. This parameter is a pChar type parameter containing a
null-terminated string value that was specified in the Execute EDC sequence command. This param-
eter allows you to pass, at your discretion, a run-time value to the EDC program.
In a sequence, you typically call the Initialize and ExecuteEDC functions for the same EDC program.
You can, however, call just the ExecuteEDC function, or you can call Initialize and ExecuteEDC
functions for different program DLL files.
The Finish function can send commands to initialized external devices in order to restore any original
state of the devices, and the Finish function can de-allocate any Windows resources, like memory, that
were allocated with the Initialize function. Finish thus ensures that the EDC program exits cleanly.
The End EDC sequence command calls the Finish function in the EDC program. End EDC is
automatically added to a sequence whenever Initialize EDC is added to a sequence. End EDC
is inserted below Initialize EDC and marks the conclusion of the EDC block.
Within a sequence, Initialize EDC creates a command block, which functions like the control loop
created by a scan sequence command. When Initialize EDC is added to a sequence, the End EDC
sequence command is automatically inserted immediately below Initialize EDC to mark the
conclusion of the Initialize EDC command block. Any number of sequence commands, including
any number of Execute EDC commands, can be inserted in the Initialize EDC block. Commands
inserted in the block are indented like commands in the control loop created by a scan sequence
command.
To add the Initialize EDC command to a sequence, you double-click on Initialize EDC in the MPMS
MultiVu sequence command bar. The Select an EDC File to Initialize dialog box opens. You use
this dialog box to select a DLL to run. As soon as you select a DLL, the name of the Initialize EDC
command and the name and location of the DLL all appear on a single line in the sequence editor. The
End EDC command is automatically inserted immediately below the Initialize EDC command line.
Execute EDC includes two parameters. The first specifies the EDC program you want to execute.
The second specifies an optional text string that is passed to the Execute EDC function in the EDC
program.
To add the Execute EDC command to a sequence, you double-click on Execute EDC in the MPMS
MultiVu sequence command bar. The Execute EDC Program dialog box opens. You use this dialog
box to select a DLL to run.
If the sequence includes the Initialize EDC command, you generally use Execute
EDC to call the same EDC program specified in the initialization block. However,
NOTE Initialize EDC and Execute EDC do not have to call the identical program.
You can use the Supplemental Command String text box in the Execute EDC Program dialog box
to type any text that you want to pass to the EDC program. As soon as you select OK in the dialog
box, the name of the Execute EDC command, the name and location of the DLL, and any
supplemental text you entered all appear on a single line in the sequence editor.
Once the EDCPrgm.dpr project file is open, you can add code as necessary to the Initialize,
ExecuteEDC, and/or Finish functions. The provided comments are a guide that indicate where
you should insert code. Refer to chapter 3 for a list of the Mpms object commands and examples
of their use. Refer to section 2.3 for a description of the EDC project functions and their use.
While you work on the project file, periodically select Project¾Syntax check in order to use the
Delphi integrated environment to check your code syntax. Save the project under a different name
to preserve the EDCPrgm.dpr file as a template for further use. Use the File¾Save Project As
command and specify a new name for your project. File¾Save Project As automatically changes
the name of the library (as shown in the library declaration at the top of the project file). You
can use this same technique to create new programs from existing project files.
To create an EDC program you must first build the project file. Select Project¾Build to build the
project file and create the DLL file that you will execute from an MPMS MultiVu sequence. Delphi
tells you if your code has any errors and directs you to the specific lines causing the error. A project
built with errors cannot create a DLL; you must correct all errors before the DLL can be created.
Delphi may also issue warnings and hints about the code you have written. While warnings and hints
do not prevent the DLL from being created, they can identify errors in program flow that may cause
problems when the program runs. Try to correct all code associated with warnings in order to prevent
any further unforeseen complications.
When you use control statements to create loops in your program, be sure you
safeguard your code against infinite execution loops, and be sure you add code
NOTE that will allow the program to be aborted from the MPMS MultiVu sequence
controller. See section 2.5.3 for a discussion about aborting an MPMS MultiVu
sequence that is running an EDC program.
You can conveniently test and change your program if both Delphi and MPMS MultiVu are running
simultaneously on the system computer. If Delphi and MPMS MultiVu are already running on the
system computer, you can leave Delphi running while you execute your program. If MPMS MultiVu
is running on a computer that is not hooked up to the MPMS, you can select the MPMS MultiVu
Simulation icon on the desktop in order to run MPMS MultiVu in simulation mode on your Delphi
development computer. Having Delphi and MPMS MultiVu running simultaneously makes it
convenient to switch back and forth between the two applications.
To run an EDC program, use the Windows task bar or the <Alt+Tab> key combination to switch to
MPMS MultiVu. Create or edit an existing sequence in MPMS MultiVu and insert Initialize EDC
and/or Execute EDC commands as desired, specifying the DLL you just created in Delphi. When
you run the sequence, your program DLL is loaded into the MPMS MultiVu application’s memory
space and the appropriate functions are executed.
You can edit an EDC program after you run it in MPMS MultiVu. After the sequence terminates
normally or is aborted, use the Windows task bar to switch tasks to Delphi. Your EDC program
should still be loaded in Delphi. Edit the code as necessary and build the program again. Notice that
if MPMS MultiVu is still running the sequence calling your EDC program, you can edit the program’s
code, but you cannot build the project because MPMS MultiVu has locked the DLL file. MPMS
MultiVu does not release the DLL until the sequence terminates. After editing the program and
building the DLL again, you can switch back to MPMS MultiVu and rerun the same sequence to test
your changes.
All EDC functions include an exception handler block at the end of their try ... except block.
The exception handler block is designed to catch an EAbort exception. If you tell MPMS MultiVu to
abort the running sequence while MPMS MultiVu is executing an EDC sequence command, MPMS
MultiVu calls a special exported function in the DLL that sets the abortFlag member variable of the
Mpms object to True. You can test this member variable in your program by using the IsAborting
EDC command (see section 3.7.1). All EDC commands check for this flag at the beginning of their
execution. If the flag is true, an EDC command raises an EAbort exception using the Abort procedure.
When this exception is raised, execution of a program immediately diverts to the exception handler
code in the appropriate function. Refer to the Delphi on-line documentation for more information
about the EAbort exception and the Abort procedure.
except {Do not modify code in this exception handler}
on EAbort do
begin
Result := Bad;
end;
end;
Even with this built-in check, it is still possible to write a control loop in Delphi by using the repeat
statement, while statement, or for statement. If the program execution cannot exit from these types
of loops, the EDC program cannot terminate cleanly. To ensure that your program is able to abort
a control loop, include the following statement inside the loop:
This statement forces the program execution to jump to the exception handler if MPMS MultiVu sets
the abortFlag in the Mpms object to True. After the exception block is executed, the EDC function
returns to the MPMS MultiVu sequence and the sequence is allowed to abort cleanly.
MPMS MultiVu does include built-in safeguards that try to protect EDC programs from sudden
termination. If you try to abort a sequence that calls an infinite control loop and that loop does not
include a check for the abort flag, MPMS MultiVu automatically delays termination 20 seconds in
order to allow the EDC program to complete its current task. You can, however, override the
automatic delay by selecting the Terminate EDC Program Now button in the Abort EDC Program
dialog box.
When you abort a sequence, the system does not check for a return value.
Use the Browse button to select the MPMS MultiVu executable file (MpmsMVu.exe) as the host
application. The MpmsMVu.exe executable file is usually in the C:\QdMpms\MultiVu directory.
If you are using the computer attached to the MPMS hardware, you do not need to enter any command
line parameters. However, if you are developing your EDC program on a separate computer, you can
enter the following parameters to use MPMS MultiVu in simulation mode.
-gpibsim –commsim
These parameters force MPMS MultiVu to simulate the GPIB and comm port communications.
If your computer is not connected to the MPMS hardware but you do have the proper GPIB board
installed, you can use EDC to talk to an external device while simulating the remainder of the MPMS
hardware. To do this, replace the –gpibsim parameter with the following two parameters.
These two parameters force MPMS MultiVu to simulate GPIB devices 6 and 8.
Now you can run the EDC program by selecting Run¾Run or by pressing <F9>. Delphi starts
MPMS MultiVu. Edit or run an existing sequence that calls the program you are debugging. When
the appropriate function is called, the Windows focus shifts to Delphi when the breakpoint in your
code is reached. You can now step through your source code by using Delphi’s debugging features.
The Delphi on-line documentation discusses in more detail how you debug projects.
Caution should be used when debugging an EDC program on an MPMS MultiVu system that is
controlling⎯not simulating⎯the hardware. While the program is stopped on a line of code, MPMS
MultiVu is not running and can loose control of what it is doing. Many timers that run inside of
MPMS MultiVu keep track of the running hardware. There are also timers that expect GPIB
communications to complete in reasonable amounts of time. Any or all of these timers can run out or
get out of synchronization, thus resulting in GPIB errors. Try not to stop on a breakpoint for extended
periods of time. It is also advisable not to stop on a breakpoint while the magnet is charging or in
hysteresis mode. Common sense should be exercised while developing EDC programs on a live
system and while using the Delphi debugger to stop MPMS MultiVu.
When at all possible, allow the sequence you are running to test your program to terminate normally.
If you must terminate MPMS MultiVu as quickly as possible, you can use the Delphi Run¾Program
Reset command to terminate the application immediately. Be careful. This technique does not allow
MPMS MultiVu to save its running state configuration, and when MPMS MultiVu starts again it might
report errors because the hardware was not in the last expected condition.
The WriteData and OpenDataFile commands force the specified data file to be created if the
file does not already exist. When you issue the WriteData or OpenDataFile command, the file
is created with all the information specified in the SetPlotAppearance, SetDataFileTitle,
SetPlotItems, SetAxisLimits, and SetDataFileLabels formatting commands. If none
of the formatting commands has been issued, a default header section is written. If the data file exists,
WriteData always appends to the data file.
The EDC program is loaded only once and the connection to MPMS MultiVu is made only once.
Subsequent sequence commands referencing the same EDC program DLL do not have to load the
DLL or establish any OLE connections to MPMS MultiVu. When the sequence terminates, all
EDC DLLs that have been loaded by the sequence are unloaded by MPMS MultiVu. (Actually, the
DLLs are marked as unused by MPMS MultiVu and the operating system unloads them when it is
able to do so.)
The MPMS system hardware uses the GPIB Service Request Line (SRQ) to inform MPMS MultiVu
of various conditions, including the completion of command execution, during operations. A raised
SRQ line causes MPMS MultiVu to perform a GPIB serial poll of all its devices until the device
that raised the SRQ line is identified. EDC devices are serial polled as long as the SRQ line is raised.
Therefore, if an external device raises the SRQ line, MPMS MultiVu can identify it as the device that
caused the line to be raised. Any external device that holds the SRQ line high can cause the MPMS
MultiVu GPIB communications to become locked up if that device does not lower the SRQ line when
it is serial polled by MPMS MultiVu.
EDC Commands
3.1 Introduction
This chapter contains the following information:
• Section 3.2 describes the EDC command • Section 3.6 describes the data file
syntax and includes a guide listing page commands.
numbers for the commands in this chapter.
• Section 3.3 describes the system • Section 3.7 describes the utility
environment commands. commands.
• Section 3.4 describes the system • Section 3.8 contains a quick reference
measurement commands. guide for all EDC commands.
• Section 3.5 describes the GPIB
communication commands.
The sections in this chapter define the syntax, parameters, and return type of the Mpms object method
and provide examples of each method.
where
result is an option variable of the specified type that will be assigned the return value of the
function.
parameter list is the optional function parameters as specified in this chapter. Function
parameters preceded by the keyword var are passed by reference to the function or procedure.
Optional parameters and their default values are shown in brackets [ ]. When you call a routine
that uses default parameter values, all actual parameters following the first accepted default must
also use the default values; calls of the form SomeFunction(,,X) are not legal.
Refer to the Delphi on-line documentation for more information on var and for more information on
calling procedures and functions.
3.3.1 Wait
Syntax Wait(event);
Description This command pauses operation until the temperature or magnetic field is stable.
If an integer, instead of an emWAIT_TYPE, is specified, the command pauses
operation for the specified number of seconds.
(2) Mpms.Wait(WAIT_MAG);
This command pauses operation until the magnetic field setting is stable.
(3) Mpms.Wait(20.0);
This command pauses operation for 20 seconds.
3.3.2 SetField
Syntax SetField(field,
[approach mode = OSCILLATE],
[resolution = HI_RES]) : Boolean;
Description This command uses the specified approach mode and resolution to set the magnetic
field in the MPMS. The field is set even if the current field is not stable. The limits
for the field are the present limits in the MPMS.
Return Type Boolean. True is returned if the field is set successfully. False is returned if the
field is not set successfully.
3.3.3 GetField
Syntax GetField() : Single;
Description This command returns the current field in the MPMS. If the magnet is charging,
the returned value is the value of the field before the magnet started to charge.
Return Type Single-precision, floating-point number. The number is the MPMS field in oersted.
3.3.4 UpdateField
Syntax UpdateField(field) : Boolean;
Description This command corrects the field-intensity data stored in MPMS MultiVu and in the
Model 1822 MPMS Controller. UpdateField does not set the magnet current.
Return Type Boolean. True is returned if the specified field is valid and the field value is updated
successfully. False is returned if the specified field is not valid or the field value is
not updated.
3.3.5 SetTemp
Syntax SetTemp(target temperature,
[sweep rate = 10.0]) : Boolean;
Description This command uses the specified rate to set the temperature in the MPMS. The
temperature range is the present MPMS temperature range.
Return Type Boolean. True is returned if the temperature is set successfully. False is returned
if the temperature is not set successfully.
3.3.6 GetSystemTemp
Syntax GetSystemTemp() : Single;
Return Type Single-precision, floating-point number. The number is the system temperature in K.
3.3.7 GetBridgeTemp
Syntax GetBridgeTemp(chan) : Single;
Description This command reads the reported temperature from the specified bridge channel.
Bridge channels 1 through 6 are available.
3.4.1 SetDCMeasParams
Syntax SetDCMeasParams(squidAxis,
scanLength,
numScans,
numPoints,
[algorithm = ITERATIVE],
[autoTracking = True],
[autoRange = True],
[squidRange = 1.25]) : Boolean;
Description This command sets the parameters for a DC measurement. The Magnetic Property
Measurement System: MPMS MultiVu Application User’s Manual (Quantum Design
1998) discusses the DC measurement parameters in detail.
Return Type Boolean. True is returned if all parameters are set successfully. False is returned
if any parameter is not set successfully.
3.4.2 MeasureDC
Syntax MeasureDC() : Boolean;
Description This command uses the current DC measurement parameters to perform a standard
DC measurement. The measurement runs even if the temperature is not stable. The
SetDCMeasParams command can be used to set the measurement parameters.
Return Type Boolean. True is returned if the measurement runs. False is returned if the
measurement does not run.
3.4.3 GetDCMoment
Syntax GetDCMoment() : Single;
Description This command returns the moment value from the last DC measurement.
Return Type Single-precision, floating-point number. The number is the moment value in EMU.
3.4.4 GetDCStdDev
Syntax GetDCStdDev() : Single;
Description This command returns the standard deviation from the last DC measurement.
Return Type Single-precision, floating-point number. The number is the standard deviation
in EMU.
3.4.5 SetRSOMeasParams
The RSO commands are operable only if the RSO option is installed on the
MPMS unit. If you try to use an RSO command when the RSO option is not
NOTE installed, either an error message or a False value is returned.
Syntax SetRSOMeasParams(squidAxis,
amplitude,
frequency,
numCycles,
measToAvg,
position,
[algorithm = ITERATIVE],
[autoTracking = True],
[autoRange = True],
[squidRange = 1.25]) : Boolean;
Description This command sets the parameters for an RSO measurement. The Magnetic Property
Measurement System: Reciprocating Sample Option User’s Manual (Quantum
Design 1998) discusses the RSO measurement parameters in detail.
Return Type Boolean. True is returned if all parameters are set successfully. False is returned
if any parameter is not set successfully.
3.4.6 MeasureRSO
Syntax MeasureRSO() : Boolean
Description This command uses the current RSO measurement parameters to perform a standard
RSO measurement. The measurement runs even if the temperature is not stable. The
SetRSOMeasParams command can be used to set the measurement parameters.
Return Type Boolean. True is returned if the measurement runs. False is returned if the
measurement does not run.
3.4.7 GetRSOMoment
Syntax GetRSOMoment() : Single;
Description This command returns the moment value from the last RSO measurement.
Return Type Single-precision, floating-point number. The number is the moment value in EMU.
3.4.8 GetRSOStdDev
Syntax GetRSOStdDev() : Single;
Description This command returns the standard deviation from the last RSO measurement.
Return Type Single-precision, floating-point number. The number is the standard deviation
in EMU.
3.4.9 SetACMeasParams
Syntax SetACMeasParams(amplitude,
frequency,
blocksToAvg,
measToAvg,
[settleTime = 0],
[ampGain = AC_GAIN10],
[nullAmp = 1.0e-6],
[autoTracking = True],
[autoRange = True],
[squidRange = 1.25]) : Boolean;
Description This command sets the parameters for an AC measurement. The Magnetic Property
Measurement System: AC Option User’s Manual (Quantum Design 1998) discusses
the AC measurement parameters in detail.
Return Type Boolean. True is returned if all parameters are set successfully. False is returned
if any parameter is not set successfully.
3.4.10 MeasureAC
Syntax MeasureAC() : Boolean
Description This command uses the current AC measurement parameters to perform a standard
AC measurement. The measurement runs even if the temperature is not stable. The
SetACMeasParams command can be used to set the measurement parameters.
Return Type Boolean. True is returned if the measurement runs. False is returned if the
measurement does not run.
3.4.11 GetACFrequency
Syntax GetACFrequency() : Single
Description This command returns the actual AC frequency used for the last AC measurement.
Return Type Single-precision, floating-point number. The number is the AC frequency in Hz.
3.4.12 GetACmPrime
Syntax GetACmPrime() : Single;
Description This command returns the m′ value from the last AC measurement.
Return Type Single-precision, floating-point number. The number is the m′ value in EMU.
3.4.13 GetACmDblPrime
Syntax GetACmDblPrime() : Single;
Description This command returns the m′′ value from the last AC measurement.
Return Type Single-precision, floating-point number. The number is the m′′ value in EMU.
3.4.14 GetACMeasAmp
Syntax GetACMeasAmp() : Single;
Description This command returns the amplitude from the last AC measurement. The amplitude
is defined by the equation
Amp = m ′ 2 + m ′′ 2 .
Return Type Single-precision, floating-point number. The number is the amplitude in EMU.
3.4.15 GetACMeasPhase
Syntax GetACMeasPhase() : Single;
Description This command returns the phase angle from the last AC measurement. The phase
angle is defined by the equation
( )
Phase = arctan m ′′ m ′ .
Return Type Single-precision, floating-point number. The number is the phase angle in degrees.
3.4.16 GetACmPrimeStdDev
Syntax GetACmPrimeStdDev() : Single;
Description This command returns the standard deviation of the m′ value from the last AC
measurement.
Return Type Single-precision, floating-point number. The number is the m′ standard deviation
in EMU.
3.4.17 GetACmDblPrimeStdDev
Syntax GetACmDblPrimeStdDev() : Single;
Description This command returns the standard deviation of the m′′ value from the last AC
measurement.
Return Type Single-precision, floating-point number. The number is the m′′ standard deviation
in EMU.
3.4.18 GetACMeasAmpStdDev
Syntax GetACMeasAmpStdDev() : Single;
Description This command returns the standard deviation of the amplitude from the last AC
measurement.
Return Type Single-precision, floating-point number. The number is the standard deviation
of the amplitude in EMU.
3.4.19 GetACMeasPhaseStdDev
Syntax GetACMeasPhaseStdDev() : Single;
Description This command returns the standard deviation of the phase angle from the last AC
measurement.
Return Type Single-precision, floating-point number. The number is the standard deviation
of the phase angle in degrees.
3.5.1 SendRead
Syntax SendRead(device,
command,
var response,
[response size = 255]) : Integer;
Description This command sends a text string to the specified device and immediately reads the
response from the device. To ensure that the entire response is received, you must
either supply a response string variable that is large enough to accept the response or
specify the length of the response. If you do neither, the maximum response length
is defaulted to 255 characters.
Return Type Integer indicating the number of bytes read from the device.
3.5.2 SendReadNumber
Syntax SendReadNumber(device,
command,
var response,
[response size = 255]) : Boolean;
Description This command sends a text string to the specified device, immediately reads the
response from the device, and uses the ExtractNumStr command to extract
the first numerical value in the response. The response may be (1) a text string;
(2) a double-precision, floating-point number; or (3) an integer. To ensure that
the entire response is received, you must either supply a response string variable
that is large enough to accept the response or specify the length of the response.
If you do neither, the maximum response length is defaulted to 255 characters.
Return Type Boolean. True is returned if the command is sent and a response is read
successfully. False is returned if the command is not sent or a response is not read.
(3) respInt := 0;
success := Mpms.SendReadNumber(8, 'RBT 2',
respInt);
This command performs the same function as the command in example 1 except that
the response value is assigned to the integer variable respInt.
3.5.3 Send
Syntax Send(device,
command) : Boolean;
If the Send command is called immediately after the Read command, MPMS
MultiVu could interrupt communication with the device before the next EDC
command can be read from the device. The SendRead command, however,
makes interruption impossible by reading the bus immediately following a send.
Section 3.5.1 discusses the SendRead command.
Return Type Boolean. True is returned if the text string is sent to the device. False is returned
if an error is associated with the GPIB communications.
3.5.4 Read
Syntax Read(device,
var response,
[response size = 255]) : Integer;
Description This command reads a response from the specified device. To ensure that the entire
response is received, you must either supply a response string variable that is large
enough to accept the response or specify the length of the response. If you do neither,
the maximum response length is defaulted to 255 characters.
Return Type Integer indicating the number of bytes read from the device.
3.5.5 ReadNumber
Syntax ReadNumber(device,
var response,
[response size = 255]) : Boolean;
Description This command reads a response from the specified device and uses the
ExtractNumStr command to extract the first numerical value in the response.
The response may be (1) a text string; (2) a double-precision, floating-point number;
or (3) an integer. To ensure that the entire response is received, you must either
supply a response string variable that is large enough to accept the response or
specify the length of the response. If you do neither, the maximum response length
is defaulted to 255 characters.
Section 3.7.2 discusses the ExtractNumStr command.
Return Type Boolean. True is returned if a string of characters is returned by the device and
a number is found in the string. False is returned if a string of characters is not
returned by the device or a number is not found in the string.
(3) respInt := 0;
success := Mpms.SendReadNumber(8, respInt);
This command performs the same function as the command in example 1 except that
the response value is assigned to the respInt integer variable.
3.5.6 Trigger
Syntax Trigger(device) : Boolean;
Description This command sends a GPIB Group Execute Trigger (GET) command to the specified
device. Only the specified device is triggered by the bus.
Return Type Boolean. True is returned if the GET command is sent successfully. False is
returned if GET is not sent successfully.
3.5.7 InitDevice
Syntax InitDevice(device) : Boolean;
Description This command sends the IEEE standard *CLS; command to the specified device.
Return Type Boolean. True is returned if the *CLS; command is sent successfully. False is
returned if an error is associated with the GPIB communications.
3.6.1 SetDataFile
Syntax SetDataFile(filename,
[diagnostic file = False],
[raw file = False]) : Boolean;
Description This command creates the base name of a new EDC measurement data file. MPMS
MultiVu automatically appends the extension .edc.dat to the base name.
Return Type Boolean. True is returned if the file name is accepted. False is returned if the file
name is rejected.
3.6.2 SetPlotAppearance
Syntax SetPlotAppearance(plot number,
horzGrid, vertGrid,
markers) : Boolean;
Description This command defines the appearance of the specified plot in the graph view of the
EDC measurement data file. Graph plots are numbered 1 through 4, with plot 1 at
the top of the Graph View window.
Return Type Boolean. True is returned if the plot appearance is accepted. False is returned
if the plot appearance is rejected.
3.6.3 SetPlotItems
Syntax SetPlotItems(item mask) : Boolean;
Description This command selects the MPMS MultiVu data item or items that will be added to
every data line in the EDC measurement data file.
Return Type Boolean. True is returned if the data item or items are added to the data file.
False is returned if the data item or items are not added.
3.6.4 SetAxisLimits
Syntax SetAxisLimits(plotNum,
axis,
itemIndex,
scale,
autoScale,
min = 0.0,
max = 0.0) : Boolean;
Description This command sets the axis limits in each plot in the graph view of the EDC
measurement data file.
Return Type Boolean. True is returned if all axis limits are accepted. False is returned if any
axis limit is rejected.
3.6.5 SetDataFileLabels
Syntax SetDataFileLabels(label) : Boolean;
Description This command sets the text labels that describe the data items stored in the EDC
measurement data file. The labels are separated by commas.
Return Type Boolean. True is returned if the text labels are accepted. False is returned if
the text labels are rejected.
3.6.6 OpenDataFile
Syntax OpenDataFile() : Boolean;
Description This command opens the graph view of the current EDC measurement data file.
If no EDC measurement data file exists, OpenDataFile uses the file header
information specified in the SetDataFile, SetPlotAppearance,
SetPlotItems, SetAxisLimits, and SetDataFileLabels commands
to create a file. OpenDataFile then opens the graph view of this new file.
Return Type Boolean. True is returned if the data file is opened. False is returned if the
file is not opened.
3.6.7 SetDataFileTitle
Syntax SetDataFileTitle(title) : Boolean;
Description This command specifies the title of the graph view of the EDC measurement
data file. The title appears near the top of the Graph View window.
Return Type Boolean. True is returned if the title is accepted. False is returned if the title
is rejected.
3.6.8 SetDataFileTime
Syntax SetDataFileTime(time) : Boolean;
Description This command sets the timestamp that is recorded for the next line of data in the EDC
measurement data file. SetDataFileTime should be used if data is collected at
one time and then sent to a data file at another time. SetDataFileTime must be
called before the WriteData command is called.
Return Type Boolean. True is returned if the timestamp is accepted. False is returned if
the timestamp is rejected.
3.6.9 WriteData
Syntax WriteData(data) : Boolean;
Description This command writes a data line to the EDC measurement data file whose base name
is created by the SetDataFile command. The data lines are separated by commas.
The number of items delimited in the data line must equal the number of labels
delimited in the SetDataFileLabels command.
Section 3.6.1 discusses the SetDataFile command. Section 3.6.5 discusses the
SetDataFileLabels command.
Return Type Boolean. True is returned if the data line is accepted. False is returned if the data
line is rejected.
3.7.1 IsAborting
Syntax IsAborting() : Boolean;
Description This command checks to see whether you are attempting to abort the sequence.
Return Type Boolean. True is returned if you are attempting to abort the sequence. False is
returned if you are not attempting to abort the sequence.
3.7.2 ExtractNumStr
Syntax ExtractNumStr(input string,
number string) : Boolean;
Description This command searches the input string for a numerical value and then places that
numerical value in the string variable.
Return Type Boolean. True is returned if a number is found. False is returned if a number is
not found.
3.7.3 GetTimeStamp
Syntax GetTimeStamp() : Double;
Description This command returns the present time in a double-precision format that represents
the number of seconds since midnight (00:00:00) 1 January 1970, coordinated
universal time (UTC).
3.7.4 GetTimeStampStr
Syntax GetTimeStampStr() : string;
Description This command returns the present time in a string format that represents the number
of seconds since midnight (00:00:00) 1 January 1970, coordinated universal time
(UTC).
Quantum Design. 1998. Magnetic Property Measurement System: AC Option User’s Manual.
⎯⎯⎯. 1998. Magnetic Property Measurement System: MPMS MultiVu Application User’s Manual.
⎯⎯⎯. 1998. Magnetic Property Measurement System: Reciprocating Sample Option User’s Manual.
Finish function
export functions required to run, 2-3, 2-6 de-allocating Windows resources, 2-9
as export function in EDC project template file, 2-1 MPMS MultiVu sequence. See Sequence
restoring original state of initialized devices, 2-9 Mpms object variable, 1-2, 3-1, 3-2
return value, 2-6 MpmsOleDll, 2-2
MPMSR2 EDC language, compared with MPMS MultiVu
GetACFrequency command, 3-18, 3-41 EDC language, 1-2−1-3
GetACmDblPrime command, 3-19, 3-41 command compatibility chart, 1-3−1-4
GetACmDblPrimeStdDev command, 3-21, 3-41 MpmsUnit.dcu, 2-2, 3-1
GetACMeasAmp command, 3-19, 3-41
GetACMeasAmpStdDev command, 3-21, 3-41 OpenDataFile command
GetACMeasPhase command, 3-20, 3-41 and creating data file, 2-17
GetACMeasPhaseStdDev command, 3-22, 3-41 function of, 3-35, 3-41
GetACmPrime command, 3-18, 3-41
GetACmPrimeStdDev command, 3-20, 3-41 Raw data files, creating. See SetDataFile command
GetBridgeTemp command, 3-9, 3-41 Read command, 3-26, 3-41. See also Send command;
GetDCMoment command, 3-12, 3-41 SendRead command
GetDCStdDev command, 3-12, 3-41 ReadNumber command, 3-27, 3-41
GetField command, 3-7, 3-41
GetRSOMoment command, 3-15, 3-41 Send command, 3-25, 3-42. See also SendRead command
GetRSOStdDev command, 3-15, 3-41 SendRead command, 3-23−3-24, 3-42. See also Send
GetSystemTemp command, 3-8, 3-41 command
GetTimeStamp command, 2-17, 3-40, 3-41 SendReadNumber command, 3-24−3-25, 3-42
GetTimeStampStr command, 2-17, 3-40, 3-41 Sequence
Global variables aborting. See EDC program: Aborting sequence
accessing with ExecuteEDC function, 2-8 running
declaring, 2-3 commands. See End EDC sequence command; Execute
initializing with Initialize function, 2-7 EDC sequence command; Initialize EDC sequence
validity of, 2-5 command
GPIB communication commands, 3-23−3-29 running. See EDC program: Running within sequence
SetACMeasParams command, 3-16−3-17, 3-42
InitDevice, 3-29, 3-41 SetAxisLimits command
Initialize EDC sequence command and defining data file header, 2-17
adding to sequence, 2-10 function of, 3-33−3-34, 3-42
calling Initialize function, 2-1, 2-7, 2-10 SetDataFile command, 3-30, 3-42
creating command block, 2-10 SetDataFileLabels command. See also WriteData
and End EDC sequence command, 2-9, 2-10, 2-11 command
frequency of usage, 2-7, 2-10 and defining data file header, 2-17
using to initialize EDC program, 2-10 function of, 3-34, 3-42
Initialize function SetDataFileTime command, 3-36, 3-42
as export function in EDC project template file, 2-1 SetDataFileTitle command
initializing external device, 2-7 and defining data file header, 2-17
initializing global variables, 2-7 function of, 3-35, 3-42
return value, 2-6 SetDCMeasParams command, 3-10−3-11, 3-42
using with ExecuteEDC function, 2-8 SetField command, 3-6, 3-42
Installation. See EDC language: Installing SetPlotAppearance command
IsAborting command, 3-38, 3-41 and defining data file header, 2-17
function of, 3-31, 3-42
Library declaration, 2-2 SetPlotItems command
Local variables, 2-5 and defining data file header, 2-17
function of, 3-32, 3-42
Magnetic field, setting. See SetField command
SetRSOMeasParams command, 3-13−3-14, 3-42
MeasureAC command, 3-17, 3-41
SetTemp command, 3-8, 3-42
MeasureDC command, 3-11, 3-41
SRQ line, 2-18
Measurement parameters, setting. See SetACMeasParams
System environment commands, 3-5−3-9
command; SetDCMeasParams command;
System measurement commands, 3-10−3-22
SetRSOMeasParams command
Measurement, taking. See MeasureAC command;
MeasureDC command; MeasureRSO command
Temperature, setting. See SetTemp command
MeasureRSO command, 3-14, 3-41
Timestamp
MpmsDefinitions, 2-2
definition of, 2-17
MpmsExports, 2-2