Malvern Instruments makes every effort to ensure that this document is correct. However, due to Malvern Instruments
policy of continual product development we are unable to guarantee the accuracy of this, or any other document after
thedate of publication. We thereforedisclaimallliabilityfor any changes,errorsor omissions after the dateofpublication.
Noreproductionortransmissionofanypart of this publication is allowed without the express written permission of Malvern
Instruments Ltd.
Head office:
Malvern Instruments Ltd.
Spring Lane South,
Malvern.
Worcestershire. WR14 1XZ
U.K.
Tel + [44] (0) 1684-892456
Fax + [44] (0) 1684-892789
Welcome to the Malvern Basic Reference manual. This manual has been designed to give a
detailed description of the operation and use of Malvern Basic. It gives details on the structure
of a Malvern Basic program and details all commands available.
Warning: You must remember that the Zetasizer or the samples to be
measured are potentially dangerous if misused. You must read the
Health and safety booklet before operating the system.
1.2Systems covered by this manual
Zetasizer is a generic name given to a family of systems. Each system within the family uses the
same software and only vary in operation in small areas. For this reason this manual has been
written to cover more than one instrument.
Within this manual the Zetasizer system will be referred to as the “Zetasizer” or the “system”
unless the information given is for a particular instrument.
Within this manual “BASIC” will refer to the specific Malvern Zetasizer version of the language.
Any program examples wil be shown in the Courier font.
1.4Windows Terms
It is important that you understand some Windows terms before reading further. (Note that US
spelling is used for some terms for compatibility)
Program - The Zetasizer software - it can also mean the Zetasizer Basic program used within
the main Zetasizer software.
Cursor or Pointer - The graphic - usually a pointer that is moved on the screen by operation of
the mouse.
Icon - The graphic on the desktop that represents a program.
Click - The mouse button is depressed and released. If this is not qualified with a button
description then assume it is the left button. ‘Clicking a button’ means click the left mouse button
with the cursor over the button.
Double-click - Press and release the mouse button twice in quick succession. If this is not
qualifiedwith abuttondescription thenassume itis theleft button.Usethe Mouseicon inProgram
Managers Control Panel to change the double-click speed.
Dialogue Box - A window containing controls. The OK button accepts changes in the dialogue
box. The Cancel button closes the dialogue without accepting the changes.
Control - This can mean a graphic on a dialogue like a button, listbox, textbox etc.
Press or Select - This means click the mouse over a control or use the accelerator key (the
underlined letter) or use the Tab key to move the focus to a control then use the Enter key.
Menu items can be selected using the cursor keys in the same way.
Button - This acts like a real-life button. Click to carry out an action. A typical button is shown
below.
Option Button or Radio Button - A series of buttons in a group, selecting one button cancels the
others in the group. A radio button is shown below.
ILL 1992ILL 1993ILL 1994ILL 1995ILL 3864ILL 3863
Check Box - A button that can be toggled on and off. A check box is show below.
Text Box or Edit Box - A box you can type text or values into. A text box is shown below.
List Box- A box containingalist of options. SomeList Boxes allow multiple entriesto be selected.
Combination List Box or Combo Box- A combination of a list box with a text box. A buttonbeside
the text box displays or hides the list part of the control. In some cases you can type new values
into the text box part, in others the text box just shows the current selection from the list.
Drag - An action with the mouse which involves moving the mouse while holding down the left
mouse button. This is used for moving icons or making multiple selections in a list box.
1.5Menu Commands
Menu commands from the Malvern software are referred to in the form main menu-menu item.
As an example, the command File-Save Sample refers to selecting the Save Sample item in the
File menu. The same rules apply for sub-menus of sub-menus, so that Edit-Copy-Data refers to
the Data item in the Copy sub-menu, which itself is a sub-menu of the Edit menu. Menu
commands are always shown in bold text.
1.6Where to find information
The information within this manual is divided into five chapters. The information within these
chapters is summarized below.
Chapter 1 (This chapter)
Chapter 1 gives general information on the content and protocols used within this manual.
Chapter 2
Chapter 2 details the structure of a Malvern Basic program, giving details on how to write and
run a program.
Chapter 3
Chapter 3 explains how to write page description programs for views and reports. These views
and reports can then be allocated to the View menu.
Chapter 4
Chapter 4 is the main section of the manual. This section gives comprehensive details on all the
commands and functions available within Malvern Basic.
Chapter 5
Finally chapter 5 gives details of advanced features.
It should be remembered that on-line help can be gained at any point when using the Malvern
software.
1.7Reporting Problems
Beforereportinga problem pleasecheckthe relevant sectionsof the userandsoftware reference
manual, or any accessory manuals, which may have an answer. If the problem persists try to
give as much detail as possible.
If thereisaprobleminthesoftware try to give information that will allow the engineers at Malvern
to reproduce the conditions. If the problem is in the measurement or the analysis the Malvern
engineers will require a copy of the Fullsize.pcp report.
To print a Data report:
l
Change the View menu to Data.
l
Select a report print in the File - Print dialogue.
The program language used in the Zetasizer software is similar to many other variants of Basic.
Some features of other versions are not needed for our application and many extra functions
have been added for specific use in particle sizing. Throughout these notes the term Basic will
mean the specific Malvern Zetasizer version of the language.
Basic is a line interpreted language. This means that as a program is executed each line is
checked for syntax and then executed. Unless controlled to do otherwise, the execution will
continue with the next line. This means that, when you test a program, an error some way down
the program will not be reported until you reach that line.
Zetasizer Basic program examples in the manual are shown in the Courier font.
The fundamental building block of a program is the statement. This is a single instruction to
performsome action.A linein theprogrammaycontainmorethanone statement.Anystatements
on a line must be separated by colons (:).
For example :
X = 3 : Y = 2 : Z =-5
and
X=3
Y=2
Z =-5
are equivalent.
The lines of a program may be labeled. This is not necessary except when you need to refer to
a specific line from within the program itself.
The apostrophe character ( ‘ ) is used to mark comments. Any line beginning with this character
is ignored when the program is executed. Comments may be added at the end of lines using the
same character.
For example:
‘Area of a rectangle
‘Prompt for length’
10 Input “Input length”, Rectlength
‘Prompt for width’
Input “Input width” Rectwidth
The use of line numbers with tests to change the order of execution.
Basic is not case sensitive. That is, you can use upper and lower case characters in any
combination. Spaces are not significant. Thus,
RectWidth = Val ( X$ )
and
RectWidth = Val (X$ )
are equivalent.
The exception to this is that names of variables, commands, etc. may not contain spaces. You
can use
InputBox$...
Inputbox$...
inputbox$...
etc.
but
Input Box$...
will fail.
There are various standard ways to make names of variables morereadable.Theexample uses
capital letters. You can also use the underscore character. For example MeanSize or
mean_size.
2.2Building blocks of programs
The building blocks of Basic program statements are:
Commands
The commands cause actions such as “measure”, “print”, etc. They also provide means of
controlling the program by repeating loops, branching as the result of tests, etc.
Functions
The functions provide values for testing or printing.
Variables and numerical constants
The variables allow you to store and calculate with values from functions.
Operators
The operators are the means of adding, multiplying, etc. the variables and constants.
Expressions
Expressionsarethe resultofevaluating combinations ofvariables, functionsandoperators. They
may often be used as options for commands.
Commands may perform a variety of actions depending on the choice made by additional
parameters. They may also modify those actions with further parameters. Functions may be
similarly modified.
The full list of all functions and commands (over 200 items and all their variant parameters) will
not be described in detail here. The precise format of each command and function is given in
chapter 4.
Within each entry in the reference section there is the name ofthecommandorfunction followed
by ‘command’ or ‘function’ as appropriate. Remember commands perform actions and functions
give you a value to use.
2.4Constants and variables
Numbers in Basic are all real numbers (sometimes referred to as floating point numbers). There
are no integer variables. That is to say that all numbers are treated as if they contain decimal
points. The number 2.0 has the same value as the integer (whole number) 2 for all uses in the
language. If it is important to have a whole number in a particular case the language includes a
function Int() which removes the part after the decimal point. For example, Int(2.54) returns the
value 2.
Numerical values are stored to single precision giving 6 significant figures and a range of 10
to 1038.
There are also text values referred to as strings.
Constants are explicit values. For example the number 3.14159 is an explicit numerical constant
and the string “MALVERN” is an explicit text constant.
Variables contain or represent numbers or text. Again, there are no integer variables. The name
of a variable can contain up to 20 characters. The name may consist of alphabetic (A...Z, a...z)
and numeric (0 ... 9) characters, the underscore (_) or period ( . ) characters, but must start with
an alphabetic character.
Some examples of valid variable names are:
My_Variable
P.XPosition
Fi257
Some examples of invalid variable names are:
VariableComment
5FixStarts with a number.
P&GContains the & operator.
A_Very_Long_Variable_NameToo long - would be truncated.
-38
The names of variables are not case sensitive, MyVar , MYVAR and myvar would all refer to the
same variable.
There is space for 50 user variables in any program. An error is reported if this number is
exceeded. If one program calls another the variables in the calling program are not accessible
from the called program (but see below for arrays).
It is good practice to choose variable names which describe the values they will contain. This
‘self-documenting’ approach together with comments will make program maintenance and
debugging much easier.
Certain names will be disallowed. You cannot use a command or function name as a variable
name.
The names of string (text) variables follows the convention of numeric variables but the names
must end with a $ (dollar symbol). String arrays are not allowed. The total number of numeric,
array and string variables must not exceed 50 per program. The maximum length of strings must
be less than 256 characters.
Unlike some versions of Basic, the Zetasizer Basic does not require you to declare all variables
explicitly before use. A numeric or string variable is recognized the first time a value is assigned
to it. However arrays must be declared before use.
2.5Arrays
An array is a group of values referred to by a single name. The individual values in the array are
referred to by an index number.
For example MyData could be an array of 6 elements which would be referenced as MyData(0),
MyData(1), MyData(2), ... , MyData(5).
Notice that the numbering of the array is assumed to start at zero. If it is convenient for clarity to
use only the elements from number 1 onwards you can, of course, ignore element 0.
Unlike simple variables, it is necessary to declare arrays before they are used so that memory
can be reserved for them. This is done using the Dim command.
Array names follow the same rules as for simple variables. String arrays are not allowed. All
arrays are one-dimensional. That is arrays of the type X ( 3, 5 ) are not allowed.
For example:
Dim Ax ( 10 ), Ay ( 10 ), Big_List ( 1000 )
The dimension of an array is limited to 1000 (i.e. 1001 elements).
In a Dim command you may use variables and functions to specify the array sizes.
For example:
X=10
Dim A ( 2 * X + 1 )
Dim B ( StoreChannel )
are valid.
Once an array is dimensioned you may not change its dimension.
* / %Multiply, divide and modulo.
+ -Addition and subtraction.
< >=Relational operators.
>=Relational operator.
<=Relational operator.
<>Relational operator.
|Bit-wise OR operator.
&Bit-wise AND operator.
The expressions are evaluated left to right except with exponentiation which evaluates right to
left.
Unary plus and minus attach a sign to a number. For example -FirstNumber is -1 if FirstNumber
is 1, 7 if FirstNumber is -7, etc.
Exponentiation raises a number to a power. For example 3^4 is 81.
Multiply ( * ) and divide ( / ) are the normal arithmetic operations. The modulo operator calculates
the remainder after division. For example 27% 5 is 2.
Expressions involving the relational operators evaluate to 1.0 if TRUE or 0.0 if FALSE.
The AND ( & )and OR ( | ) operators convert the decimal numbers to integers before evaluation.
Therefore the expressions on either side of these operators must resolve to values in the range
0 to 65535. For example:
The simple progress from line to line of a program is very limited. In order to give the language
real power we need commands which allow us to change the order of operation according to
tests performed on variables.
In addition, the structure of the program can be simplified, the number of variables needed can
be reduced and parts of the program can be made more portable by using subroutines.
In this sense, portable means that useful sequences of instructions can be copied and pasted
into new programs.
Finally, we need to be able to repeat sequences of operations for whole sets of variables or for
a pre-defined number of times.
When the program reaches this line it evaluates the expression and if the answer is false (i.e.
the expression evaluates to 0.0) the rest of the line is ignored. Otherwise the command is
executed.
For example:
If CountsPerSec < 30000 Then Print Status, “Count Rate too small”;
Pause 5
This will check if the count rate is below 30000 and if it is will display the message in the status
bar. It will then pause for 5 seconds.
What happens if the expression is false? The message is not displayed, theprogram goes to the
next line and there is still a 5 second pause. We only want the pause if the message has been
displayed so we could write instead:
If CountsPerSec < 30000Then Print Status, “Count Rate too smalll”; :
Pause 5
This time the group of commands after Then is executed if true and ignored if false. Note that
the commands after the Then must all be on one line. The enter key should be pressed after
...Pause 5 (enter key).
We could go on in this way adding commands separated by colons. The line might then become
very long or difficult to read. In this case we could use the block form of the structure. This form
is:
If expression Then
command
....command
....
End if
Again the expression is tested and if it is true the sequence of commandsfollowing theIf ... Then
line is executed up to the line End if.
For example:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Beep
Pause 5
Print Status, Add more sample and re-run”;
End if
There is one more stage to go. Consider:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
If the test is false the block is ignored and the Print Report will be executed. But, if it is true we
will get the warning and still get thePrint Report. We could get round thisin two ways. The GoTo
command could be used:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Pause 5
GoTo 20
End if
Print Report
20 ‘ This is where to continue.
The neater and clearer solution is to write:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Pause 5
GoTo 20
Else
Print Report
End if
This general form:
If expression Then
command
command
...
Else
command
command
...
End if
executes the first block of commands if the expression is true and the second block if false.
2.7.2Subroutines
Suppose that you write a test:
If CountsPerSec < 30000 Then
Print dialogue, Using, “###.### is too large”, ResultBelow (10 )
Beep
Pause 5
End if
and subsequently want to test some other parameters, say ResultAbove ( 60 ), etc. in the same
way. You could write lots of bits of code copying the above.
It is often useful to be able to perform a group of operations a number of times in a loop. To
achieve this Basic has the structure:
For variable = expression1 To expression2
...
...
Next
The counter variable is set to the value of expression1, the program lines following the For
statement are executed until the Next statement is encountered. Then, 1 is added to the counter
variable and it is compared with the value of expression2. The loop terminates when the value
of variable is greater than or equal to expression2.
If expression1 and expression2 have the same value, the loop executes once
For example:
Data_Max = - 1000
For i = 1 To NumChannels
If StoreChannel ( i ) > Data_Max Then Data_Max = StoreChannel ( i )
Next
This will check through the data to find the maximum value.
Avoid changing the value of counter within the loop. Changing the loop counter is poor
programming practice; it can make the program more difficult to read and debug.
The counter variable may be just that. For example:
For i = 1 To 4
Measure Sample
Calculate
Print Report
Next
Sometimes we may want to step through a set of values using, for example, every other one. To
do this we can use the extended form of this command structure
For variable = expression1 To expression2 Step expression3
...
...
Next
This time instead of increasing the variable by 1 each time the Next is reached it is increased by
the value of expression3.
For example:
OpenFile “standard”
‘Read the number of records in the file.
LastRecord = Numrecords
‘Process pairs of records to show differences between 1 & 2, 3 & 4,
etc.
DifferenceRecord i + 1
View Difference
Pause 10
Next
2.7.4Nesting
Control structures may be nested, that is placed one inside another. If .. Then can be placed
inside For ... Next loops as seen above, or vice versa. If ... Then can be placed inside another If
... Then as below:
If CountsPerSec < 30000 Then
Print Status, “Count rate too smalll”;
Pause 5
GoTo 20
Else
If ResultValid Then
Print Report
Else
Print dialogue, “Result invalid”
End if
End if
Similarly, For ... Next loops can be placed inside other For ... Next loops.
For i = 1 To 5
For j = 1 To 8
Move 20 * i, 10 * j
Box 20 * i + 19, 10 * j + 9
Next
Next
There are limits placed on the number of levels to which you can nest structures. For example,
For ... Next loops can be nested to 25 levels. None of the limits should cause you any practical
problems !
You can see from the above examples that it would be easy, in complex structures, to lose track
of the match between For and its corresponding Next or between the parts of If ... Then ... Else
... End if You can help to avoid this by indenting each block of statements as in the examples.
2.8Special programs in Zetasizer Basic
The Zetasizer Basic language is used, not only to provide control and calculation routines, but
also as the standard method of producing result tables and reports. It is also used for special
programs to perform remote reporting and DDE linking.
For a detailed description of the use of Malvern Basic in page design see chapter 3. For DDE
linkingsee ‘DynamicDataExchange’ inthe SoftwareReferenceManualandforremoteoperation
see ‘Remote’ in the Software Reference Manual.
A program may also be run automatically when the Zetasizer software is first started. This may
be used, for example, to automatically start a measurement sequence. See Control-Assign
Program in the Software Reference Manual for more information.
2.9Functions- a review
There are over 220 functions available but they will not all be dealt with individually here. For
precise details on every function please consult chapter 4.
Page layout functions allow you to design pages by spacing rows and columns of figures in a
way which is best adapted to the specific output device. For more details of page design see
chapter 3.
Result information functions allow you to use values which describe the size distribution.
Sample documentation functions record the Sample identifier, Sample Notes and run number
for accurate identification of the information on print-outs.
Hardware information records the specific settings of hardware used in the measurement.
Software settings give the parameters used in analysing the data.
2.10Writing andrunningprograms
2.10.1Recording a program
If you intend to write a program that controls the Zetasizer measurements or process sample
records you may find it convenient to record the basic outline of the program.
There are two modes of recording - if you elect to Fill in dialogue Boxes then the Zetasizer will
act normally but all your commands will be recorded. If you do not select Fill in dialogue Boxes
then the normal action of the commands will not be carried out - the program will record only the
commands that were actioned.
See the Control-Record Program command in the Software Reference Manual for more
information.
2.10.2Editing a program
A recorded programmaybemodifiedora new program may be written using the program editor.
Theprogram editoris aseparatewindow thatis alsoused forentering pageand reportdescription
programs. To edit a normal program the editor window is produced by selecting the Control-Edit
Program command.
The editor window has its own menu bar.
Menu itemFunction
File-NewEdit a new program
File-LoadLoad a program from disk
File-SaveSave a program to disk
File-Save AsSave a program with a new name
File-ExitClose the editor window
Edit-UndoUndo the last edit
Edit-CutCut the selected text to the clipboard
Edit-CopyCopy the selected text to the clipboard
Edit-PastePaste at the cursor the text in the clipboard
Edit-DeleteDelete the selected text
The first time you run a program you should use the Run button in the Program Editor. If there
are any mistakes or errors then the cursor will move to the line with the error.
When the program is debugged it may be saved on disk (preferable in the PROGRAMS
subdirectory). The program may then be run from the Control-Run Program command (See the
Software Reference Manual for details).
2.10.4Assigning Programs to Keys and Menu
The Control-Run Program command allows a single program to be run several times without
having to pick it from the list of all the programs. If you have several programs you wish to run
you may want to assign them to the end of the Control menu. An assigned program can be run
either by selecting the entry from the Control menu or by using the function keys F5 to F8 (or
those keys in combination with the control and shift keys).
See the Control-Assign Program command in the Software Reference Manual for more
information.
2.11Program Errors
Therearetwo types oferrorsinvolved in usingtheZetasizer programming language. Firstlythere
are errors caused by mistakes in the construction of your program. For example the statements:
IfX>0
GoTo 100
End if
will produce the error “THEN expected” because the first line is incomplete.
A list of these errors is given below. To correct such an error, consult the details of the particular
command or function, if necessary, correct the error and re-run the Program.
The second type of error occurs when you run the Program. For example, if you attempt to use
the command:
Load Record N
and the expected record cannot be loaded for some reason, the system will return an error code
which you can use to make decisions about the next action:
Load Record N
If Error = 0 Then
Print Report
Else
X = Print Dialogue “Record no found”
End
End if
The values of any error codes which might be returned and their meanings are shown in the
description of each individual command and function.
2.11.1Basic Errors
The message displayed at the top of the program editing box gives you information about the
type of error which has occurred. If the message is Syntax error in line n then inspect the line to
ensure that the commands, functions, etc. are correctly spelled.
Specific error messages are :
Unbalanced parentheses
The number of left and right parentheses do not match. For example
X= Int ( ( N - 1 ) / 2
Correct to
X = Int ( ( N - 1 ) / 2 )
No expression present
A value was expected.
Equals sign expected
The line is interpreted as beginning with a variable name but does not have a value assigned.
This often occurs when an incomplete line is entered or a command is mis-spelled.
For I = 1 to 5
Load Record 5
Print Report
Nxt
Correct the last line:
Next
Label table full
You may use up to 100 labels. Your program contains more than this number. To correct this
you will need to simplify the structure of the program to use less labels. Using If... Then ... Else
structures to replace GoTo may help.
Duplicate label
You have used a label more than once. To correct this change one of the labels.
Undefined label
There is a Goto or Gosub which uses a label which you have not included in your Program. To
correct this check that you have typed the label correctly. Add the required label if necessary.
THEN expected
There is an If statement which is incomplete. For example:
IfX>0
GoTo 100
End if
Correct to
If X > 0 Then
GoTo 100
End if
TO expected
There is an error in the For statement. For example:
For I = 1, 10
Correct to
For I=1 To 10
Too many nested FOR loops
For ... Next loops may be nested to a maximum of 25. Your program structure is too complex.
NEXT without FOR
Each blockofstatements beginning For ...must end with acorresponding Next. The error ismost
easily caused when nesting several levels of For ... Next loops or when code has been cut and
pasted incorrectly.
Too many nested GOSUBS
When you call a subroutine you may call anothersubroutinebeforereturningto theoriginal point
in the Program. This process can continue up to 25 levels. This error indicates that you have
exceeded the limit. Your Program structure is too complex.
RETURN without GOSUB
The most common cause of this error is not including an End statement. For example
For I = 1 to 10
GoSub 100
Next
100
Load Record I
Print Report
Return
The standard tables and reports provided with the Zetasizer system are produced by various
page and report programs. A page (or report) program is a “script” written in Malvern Page
Description Language (PDL), which allows selection of the display items, text, graphics, and font
and format of the displayed text.
Although Zetasizer provides you with a number of standard tables and reports for presenting
measurement data and results, you have the option to design your own tables and reports in
styles that suit your need.
This chapter describes the PDL language and program, and example of generating customised
table and report. See the Software Reference Manual for details on standard Zetasizer tables
and report.
3.2Writing page description programs
A page description program is a special form of Zetasizer Basic program which only allows you
to access the Zetasizer data and results and display them in selected style and format. It cannot
be usedtocontrol certain operations of the Zetasizer asanormal Zetasizer Basic program would
do. Therefore, before attempting to write a table or report program you should familiar yourself
with the concepts of the Zetasizer Basic language. See chapter 2 for detailed description on
Zetasizer Basic variables, expressions and functions.
Like all Basic programs the execution of a page description program starts from the first line in
the program and ends when an End statement is reached or when the execution reaches the
last line of the program. The program stops when a programming error is encountered. Like
writing any program it is recommended to use comment lines to give brief description on the
program, so that the program is easy to read and debug should any errors occur. A comment
line starts with an apostrophe character (‘).
A table or report program should start by defining the area where the contents of the table or
report are to be placed. Once the display area is defined, text, lines and boxes can be drawn to
form a table, and the values of the Zetasizer data and results accessed and displayed. When
there are many items to be displayed, it is a good idea to separate the items into groups and
each group is drawn by a section of the program.
A table is drawn in the Table pane on the right hand size of the Malvern Zetasizer main window.
The size of a table is limited by the dimension of the computer screen. Although you can define
a table size larger than the size of the screen, you will need to use window scroll bars to move
the table around to allow you to view the contents. It is therefore recommended that the width of
a table does not exceed the width of thescreen.AllstandardZetasizertablesarehalf the screen
width.
Text, lines and boxes can be drawn at a location specified by (X,Y) co-ordinate on a table or
report. The co-ordinate has its origin at the top left corner of the display area. All dimensions in
the program are measured in millimetres (mm).
A page description program can be created or edited using the built-in Malvern page program
editor or any text editor. It is recommended, however, that the Malvern editor is used so that the
program can be tested while being edited.
To create a new program select the New command from the File menu in the Malvern Editor.
New automatically enters as a first line the Table command to allow you to give a title to the
page or report. This name appears in the View menu when the page is assigned and when the
Info button is pressed in the Setup - Table dialogue.
During editing your program you can use the Run button in the editor to test the program, the
table or report you are editing will be shown on screen. A screen ruler can be switched on using
the Options - Rulers command to help you position items on the table or report.
The program is saved using the editor’s File - Save / -Save As commands.
For more information on the editor window see ‘Editing a Program’ in chapter 2.
FirstPoint FunctionFit Function
Fitdata FunctionFitNum
FitOrder FunctionFitTime Function
FitResiduals FunctionFont Command
For CommandFormat$
Frequency FunctionFrequencyChannels Function
G
Get FunctionGosub command
GotoGraph
K
Keep command
I
If CommandInp Function
Input CommandInRange Function
InStr function.Int Function
Intensity FunctionIscan Mode command
InstrumentType Function
L
LastPoint FunctionLCase$ Function
Left$ FunctionLen Function
Line CommandLineColour Command
LineTo CommandLn Function
Load CommandLog Function
LTrim$ Function
M
MAddSelect CommandMcalculate Command
MDeleteMeasFarPoint Function
Measure CommandMerit Function
Message FunctionMid$ Function
Mie FunctionMload Command
Mobility FunctionMobilityChannels Function
MolecularWeightMove (x,y)
Mprint CommandMsave
MSelect
Val FunctionView
ViewNew CommandVirial2 Function
Virial3 FunctionVolume
W
WriteWriteAt Command
X
Xchar FunctionXpage Function
Xpos Function
Y
Ychar FunctionYpage Function
Ypos Function
Z
ZAnal1ZAnal2
ZAveMean FunctionZeroFieldWidth Function
ZetaChannels FunctionZetaPotential Function
ZetaSpectrumZetaVar
ZimmError FunctionZimmFitOrder Function
ZimmNumConcsZimmNumAngles
ZimmNumPointsZimmAngle Function
ZimmQ FunctionZimmResidual
ZimmIntensity FunctionZimmFit
ZimmConcRadiusofGyration
ZimmFitorderZimmError
ZerowidthZeta Command/Function
ZetaPotentialZetaValue Function
ZetaVar FunctionZlower Function
Zupper Function
The two parameters are optional. The first is the order of the fit, the second the weighting used
in the analysis, which must take the values of 0, 2 or 4. If noparametersaresupplied,Cumulants
is used as the default method, and default values of the parameters are assumed.
Analysis multimodal, Analysis Contin , Analysis MultiAngle, and Analysis NNLS.
For the other analysis types, eitherofthe parameters are optional.If none are given, the analysis
range used is automatically chosen. If one is given then it is interpreted as a range. If two are
supplied, then they are interpreted as upper and lower limits of the analysis range.
Analysis Pef
Brings up the setup analysis dialog
Analysis Fit
Order of fit for current analysis.
Analysis ZeroFieldWidth
Calculate zerofield and apply to current record
Notes
Asm Ini[,port,baud rate] Initialise Autosampler. Optionally set RS232 portnumberandbaudrate.
These can also be set under Setup RS232 from the menu.
Wait
Waits for string (if none “END”)
File 10meSends ascii file to autosampler
Ini iPortInitialises gilson on comm port i
Tube Goto tube i
Asm Tube number
Select a particular sample tube, inject a sample at the injection port. The details of the inject
process can be altered by editing the file “tube.asf”. Normally number is in the range 1-70.
Asm Wait [,text$]
Wait until a particular message is displayed on the autosampler control panel. (defaults to “END”
if text omitted). The match is over the number of characters supplied as text. Case is ignored.
Asm File filename$
Download filename$ (must have extension “.asf”, from disk to the autosampler and run it.
Examples of useful programs follow:
“wash.asf” Cleans sample system between injections
“flush.asf”Flush the sample system with solvent
These are supplied, but could be edited by the user to alter details of the sample processing.
The filename must be in quotes and the extension can be omitted if desired.
Key
Set the sampler to keypad (local) control. use asm ini again to claim remote control.
Dilute ,nn [,]
Dilutes the sample placed in the first row (nearest the sampler unit) over nn columns. ll sets the
number of rows of sub samples to generate. If omitted it is set to one less than set by asm row,
or 6 by default. The dilution process is carried out by code stored in file “dil.asf” and can be
modified by the user.
Syr [,n1][,n2]
Define device to use for dilution. Default n1=0, n2=10000. (use diluter 0, volume 10000
microliters)
RackCode
Set the Autosampler rackcode. Consult your Gilson manual for details.
Rows
Number of rows in the sample tray. This is needed for theTube command to address the correct
row and column correctly.
Cols
Number of columns in the sample tray. This is needed for the Tube command to address the
correct row and column correctly.
Height
Sets syringe height. This is necessary with no standard cuvette sizes, for example, the narrow
cuvettes used on a 320 sample type rack.
Example
Some autosampler examples.
asm ini ‘ Initilialise sampler
asm fil,wash’ load and run sampler program ‘wash.asf’
asm wai’ wait for display END to signify wash complete.
asm dil,5,4 ‘ take the sample in row 1, dilute it 4 times into successive
‘ rows of the same column. Repeat over the first 5 columns.
size mode ‘select size analysis
for i=1 to 25
asm tube,i’ select tubes from 1 to 25
asm wait for tube inject to finish then wash inject line
asm fil,wash
measure sequence 1’ run a measurement
asm wait for the wash sequence to finish
‘ (unless the measurement time is short
‘ this will already have happened), but it is ‘ ‘
‘ safer to include the step.
4.11BackGround Function
Application
Returns background used in a size analysis.
Notes
The background ratio is derived from the ratio of the far point, and the theoretical background or
baselinevaluederived from the monitorchannels.This is primarily usedas an indication ofsignal
quality for a size measurement. It is further used to derive In Range.
4.13Bchannel Function
Application
Data information for Size and Zeta records.
Syntax
BChannel
Notes
The contents of the B monitor channel of the correlator. It is used in Autosizer systems for
temperature readout, available for User input on 4700/Zetasizer.
4.14Beep Command
Application
Command to alert the user.
Syntax
Beep
Notes
This command will cause an audible tone to sound. Use this to draw attention to an alert box,
dialogue or input.
4.15BoxFunction
Application
Page program graphics.
Syntax
Box x,y
Notes
Draws a rectangle from the current anchor position x,y mm in size.
The current line style and colour is used to draw the outline and the box is filled with current fill
colour.
Example
Move 10,10
Box 120,50
4.16CalcFarPoint Function
Application
The background or baseline calculated from the monitor channels.
Application
Does calculation with current analysis.
Syntax
Calculate
Notes
The calculate command operates on the record currently in memory. Note that the commands
Select, Load Rec, Transfer implicitly load a record into memory.
Size mode
Doescalculationwithanalysis set by the Analysis Analysistypecommandon the record currently
in memory.
Zeta mode
Recalculates the zeta potential distribution of the record currently in memory. The use of the
secondarycommand ZeroField Width willrecalculate thevalue ofthecurrentzerofieldcorrection
width.
Intensity mode
Performs a ‘Radius of Gyration’ calculation on the record currently in menu.
4.18CalcZimm Command
Application
Calculates the Molecular weight, Radius of gyrationandvirialcoefficients for a group of selected
records of the appropriate type, ie. an existing Zimm plot.
4.19Capscan Command
Application
In a Zeta potential context a number of records are fitted with a parabola for mobility against cell
position to extract electro-osmotic and electrophoretic results separately.
4.20ChangeTable Command
Application
Redraw current table display.
4.21ChDir Command
Application
Changes current directory on the system disk. Parameter is new directory eg. ChDir “c:\pcs”
4.22Chr$(character)Function
Application
Returns a string of one character which has the ASCII value of Character.
Examples
common dim a(100) ‘ No separate declaration is needed.
common b,c
4.26Copy Command
Application
Copy information via the DDE to the Clipboard or another Application.
Syntax
Copy Graph
Copy Table
Copy Link
Copy String
Notes
Copy Graph
Copy Table
Place the current display from the table area as a metafile onto the clipboard, so that it can then
be placed in another application. Typically this would involve executing an Edit Paste in that
application.
Copy string
Copies the contents of the system string buffer to the clipboard. See Print String for details.
Copy Link
Runs aMacroprogram that places selected information in a DDE linktoanother application. See
Chapter 4 for more details.
Notes
Prescale
This is applicable to the 7032 only. It sets the prescale values of the various sub-groups of the
correlator. If no arguments are supplied, auto prescale is implied.
Wait
Wait for experiment to finish (use after Start)
Clear
Clear correlator. This is only applicable to the 7032
Start
Start correlator.
Halt
Stop correlator.
SampleTime
Set correlator sample time (in microseconds). If the parameter value is omitted an experiment is
run to set the sample time automatically as can be requested by checking ‘auto’ in a
measurement sequence.
Size
Set correlator size in channels (64,128,256).
Dilation
Set dilation factor 1 - 15. (7032 only)
Delay
Set delay to far point, 0 - 4096 in steps of 16. This is applicable to the 7032 only.
Duration
Set experiment duration (in seconds)
Divide [,n]
For the 7032, n may take the value of 1,2,4 or 8 divides the correlator into ,n Set parallel mode
(2,4,8). If the parameter is omitted the selection is made in accordance with the automatic
selection made in a measurement sequence.
For the 7132 and 70128 correlators n 1 will use linear mode, n=1 will put the correlator into log
mode.
Live
0 Hide live display, 1 show live display.
Options
Bring up options dialogue from Correlator control window.
Set the correlator to serial mode (all store channels disposed in a single section, with common
sampletime), set aduration of200seconds, acorrelator sampletimeof 23microseconds, enable
the live display window, clear the correlator contents to zero, then start it accumulating data.
4.28Cos( ) Function
Application
Mathematical Function
Systax
Cos(x)
Notes
Returns thecosineofthe argument. The argument is inradians,and should take values between
0 and 2Pi.
Example
a=3.14159
print dialog using “##.###”,cos(a) ‘will display -1.000
4.29CountsPerSec Function
Application
Returns the value of the Counts per second stored in the data of the current record.
Syntax
CountsPerSec ()
Notes
By definition this is equal to the contents of the A monitor channel divided by the time in seconds
thatthecorrelator ran togatherthat data. Notethat this isthevalue ofthecurrently loaded record,
NOT the actual count rate.
4.30CountsPerST Function
Application
Data information for Size and Zeta records.
Syntax
CountsPerST
Notes
The Contents of the A monitor divided bythe totalnumber ofcorrelator samples taken to get that
count. This is the value of the value stored in the current record, and so does NOT reflect the
current value monitored by the system.
4.31CurrentTime Function
Application
Determines the elapsed time since system startup.
Syntax
CurrentTime
Notes
Returns Current time (in seconds) since system startup
4.32Data Function
Application
Returns data values stored in the current record.
Syntax
data corr i
data qualityfactor
data (parameter_keyword)
Notes
Data corr i
Returns channel i of the first order correlation function.
1ZETA5104
2ZETA5103
3ZETA5110
4ZETA5126
10ZEM010Capillary cell
11ZEM011Non-aqueous cell
14ZEM014Aqueous parallel
dataModulatorFrequencyModular frequency
dataRefIndexRefractive index of dispersant
dataViscosityViscosty of the dispeserant
dataAngleScattering angle
dataTemperatureRead back temperature
dataWavelengthLaser wavelength
dataConductivityConductivity
dataCalibrationConstCalibrationConstant for conductivity calibration
dataFringeSpacingFringe spacing for Zeta analysis
dataDielectricDielectric constant
dataCellSpacingDistance between electrodes (mm)
dataRFRealReal Refractive index of sample
dataRFImagImaginary Refractive index or absorbance of sample
dataMarkhowinkAMark Houwinck A parameter
dataMarkhowinkKMark Houwinck K parameter
dataCellpositionCell position
dataPhpH measurement
dataCellCUrrentCell current
dataCoreRatioRatio of inner to outer diameter for shell model
dataRFRealCoreReal refractive index of core
dataRFImagCoreImaginary refractive index of core
dataFkaF(ka) of sample
dataConcentrationConcentration of sample (g/l)
dataRFStandardRefractive index of standard (Zimm Scan)
datadndcRefractive index increment (ml/g)
dataRayleighRatioRayleigh ratio
Example
e = Data CellVoltage / Data CellSpacing
A calculation of electric field strength for the current record.
Notes
In Size mode this flag determines whether the data is a first or second order correlation function,
depending on whether the value is 1 or 2 respectively.
In Zeta mode this flag determines whether the raw zerofield width is used or a voltage corrected
zerofield width is used, depending on whether the value is 2 or 1 respectively.
4.34DateFormat Command
Set date format n= 1, = long (default) eg. 22nd June 1992, 0 = short eg. 22/6/92
4.35DdeCommand
Application
Communication with other Windows programs.
Notes
The DDE command allows information to be exchanged with other Windows programs through
Dynamic Data Exchange (DDE). conversation_number is the number of the conversation and
takes integer values between 1 and 5. The PCS software allows 5 DDE conversations at any
one time. See chapter 11 “Linking with other applications” in the Software Reference Manual for
more information.
DDE Connect, conversation_number, service_name$, topic$
This command is used to connect to a DDE server. service_name$ is the service name of the
other appliciation you wish to link to which is normally the same as the .EXE file name. topic$ is
the topic of conversation which is application dependent.
DDE Terminate, conversation_number
The command terminates the DDE conversation with number conversation_number
DDE Timeout, time
This sets the timeout time for the DDE exhange. The number is the time in seconds.
DDE Poke, conversation_number, item$ [,string$]
This command allows the user to send information to another Application which is linked by
conversation_number. The string item$ is the item name assigned to the data and is application
dependent. The data sent will be the information held in the Basic system string if the parameter
string$ is not supplied (see Print String) otherwise the data in string$ will be sent.
DDE Execute converation_number, command$
The command allows the user to send a command to another application known as the server
linked by conversation_number. The format of the text in command$ is application dependent.
DDE Update
This refreshes the information which is sent to the partner program. Normally this is updated for
an established hot link at the end of a calculation, but this command enables you to force the
update measurement on request.
Example
This example transfers values to a column of a Microsoft Excel spreadsheet.
DDE Connect ,3,"Excel", “sheet1"
for i=1 to numchannels
Application
Result and data information from Size records.
Syntax
Delay
Notes
The delay period (in sample times) set in the post computational card before the Far point
channels. This function is only available on the 7032 correlator.
4.37DeleteCommand
Application
Dynamic Data exchange and result logging.
Syntax
Delete File
Delete Log
Delete String
Notes
Delete File deletes the file last named in the File command. It does not close the file, but simply
empties it.
Delete String clears the BASIC system string which has been created with the Print String
command. This is necessary before adding new items to a DDE link or copying information to
the clipboard. Missingthedeletion will mean that the items sent orcopiedwillincludeall previous
items. Delete Log clears the current log file.
Application
Result and data information from Size records.
Syntax
Dilation
Notes
The dilation setting of the correlator, ie. the sample time multiplier between the different store
blocks. For the 7132 and 70128 correlators this is always two.
4.39DimCommand
Application
Basic variable definition
Syntax
Dim array_name(n)
Notes
TheDim commandreservesspaceforarrays. array_nameis thename forthe arraybeing defined
and n the size required.
The array names follow the convention for other variables. Only the first 30 characters are
significant and the name must start with an alphabetic character.
Arrays may not be redimensioned aftertheyhave been declared. All array must be dimensioned
before use.
Example
Dim Ax(5), Another(20), LastOne(1000)
4.40Duration Function
Application
Result and data information from Size or Zeta records.
Syntax
Duration
Notes
The length (in seconds) of the experimental ‘run’ that gave rise to that data component of the
current record.
Notes
Alter the value of a parameter of the current record in memory. For a permanent change the
record should be Saved.
Edit Note1 “This is the first line”
Changes the first line of the title in the relevent record.
Edit Program
Edit TimeArray i, delay_time
Sets the value of the ith channel of the time array to delay_time.
Edit StoreChannel i, value
Sets the value of the ith channel of the store channel to value.
Edit Parameter_keyword, value
Changes the value rameter_keyword to the value of v
For a list of valid values of parameter_keyword see the Data command.
Example
Edit Angle 45‘ alter the angle parameter of the current record to 45 degrees.
Edit Storechannel,15,1007 ‘sets the value of the correlation channel 15 to 1007’
An example from a program using Edit is shown below.
edit sampletime samt
edit note1 “Generated Data”
edit MeasFarPoint 10000
edit temperature tem
edit viscosity vis
edit dielectric die
edit CellVoltage volt
edit electrodespacing spac
edit fringespacing fri
edit modulatorfreq modf*sign
edit measfarpoint baseline
edit calcfarpoint baseline
edit zerofieldwidth newwidth
Notes
Enable RefBeam on_off
Turns reference beam on or off, according to whether the value of on_off is 1 or 0 respectively.
This is applicable to the Zeta5000 only.
Enable InstMenu1,0
Enablesthe sub menuaccess undertheSetup.Somemenu itemshere areengineering functions
and not normally available to the normal user.
Enable AccessLevel level
Change the access level, where level takes values 1,2 or 3. 1 is the lowest level (most restricted)
3 is the highest level(totally unrestricted).
Enable Smoothing on_off, cutoff
Configures the Zeta potential analysis. If on_off is 0 or 1 then smoothing is turned off or on. The
value of cutoff defines the noise threshold as percentage of the maximum peak height. This
command is intended for diagnostic purposes only.
4.46Else Command
Part of If ... Then ... Else... End If construct. See If for more information.
4.47EndCommand
Application
Program control.
Syntax
End
End If
Notes
Endsthe programand returnsto menucontrol. Notethat thisdoes notterminate thePCS program
or Windows. The End is essential if the natural sequence of program flow does not finish at the
last line of code. When code in subroutines is placed at the end of the file End prevents the
program running on into the subroutine.
For the use of End If see If... Then ...Else...End If
Example
....
Measure Sequence
GoSub 1000
....
....
End
1000 Calculate
Print Status “Finished measurement”
Return
4.48EndAngle
Application
Angle limits used in angle scan.
Syntax
EndAngle
Notes
An angle scan is a sequence of intensity measurements starting from a lower angle and ending
at an upper angle. EndAngle is the upper limit used.
Notes
The square root of the average of the squared residuals, ie SUM(FitData - Fit)2 /FitNum from
the calculation of size distribution for the current record.
Notes
This command will run an instance of another Windows application. Use Minimised, Maximised,
Normal or Iconic to indicate what state the application will run in. The program_name$ is the full
path name and file name of the application.
max_number_instances is the maximum number of allowed instances of the program that may
be run. If there are more currently running when this command is run then the command will
have no effect.
Example
Execute Normal “c:\excel\excel.exe”, 1
4.51Exit Command
Application
Close PCS application.
Syntax
Exit n
Notes
Exit to Windows from the PCS application. If save_config = 1 then the current PCS application
configuration is saved. If save_config is zero or omitted, it is not.
Notes
This command names the file to be used with the Print, Delete, Input and Close File commands.
filename$ is the full file name but without a pathname. The file is opened at the origin.
Example
NL$ = chr$(13)
F$ = “Please enter a filename”
Input F$, “Input”, X$
X$ = X$ + “.txt”
File X$
4.54FillColour
Application
For use in page programs.
Syntax
FillColour n
Notes
This command changes the fill colour for the Box command. n can range from 0 to 33 and is an
index into the PCS colour palette. Use the Setup Table dialog to see the list of colours. Note that
for the standard VGA screen, colours numbered 16 and onwards are created by dithering and
may give undesirable effects when the text is draw onto a filled box.
Examples
FillColour 10
Move 10,10
Box 100, 60
4.55FirstPoint Function
Application
Results information for sizing records.
Syntax
FirstPoint
Application
Reports the first channel in the correlator used in the fitting procedure for size analysis.
4.56Fit Function
Application
Results information for sizing records.
Notes
The value of channel ichannel of the fit. The fit is that distribution which exactly corresponds to
a given size distribution.
4.57Fitdata Function
Application
Results information for sizing records.
Syntax
FitData(iChannel)
Notes
The value of channel iChannel of the normalised correlation function from the set actually fitted,
the delay time being returned using FitTime.
4.58FitNum
Application
Results information for sizing records.
Syntax
FitNum
Notes
The number of points included in the data analysis (fitting) procedure: ie. The maximum value
of the index i in the three former functions.
4.59FitOrder Function
Application
Results information for sizing records.
Syntax
Fitorder
Notes
The order offitused in an electrophoresis record for the polynomial beamstrippingprocess.This
process removes any exponentially decaying component of the correlation function leaving the
fringe transit data to be processed by the Fourier transform.
4.60FitTime Function
Application
Results information for sizing records.
Syntax
FitTime( i)
Notes
The delay time of the ith point actually included in the fitting process.
Notes
iFont ranges from 1 to 4. If no arguments are set apart from iFont, then the font is set to that
setup by the Setup Table Dialog. facename$ is a standard windows font facename.
4.63ForCommand
Application
Program control
Syntax
For variable = expression1 To expression2 [Step expression3]
....
Next
Notes
The counter variable is set to the value of expression1. The program lines following the For
statement are executed until the Next statement is encountered.
The amount specified by the Step statement expression3 is then added to the counter variable
and iscomparedwith the value ofexpression2.The loop terminates when thevalueof the varible
is greater than or equal to expression2.
If expression1 and expression2 have the same value, the loop executes once.
If Step expression3 is ommitted the value of expression3 is assumed to be 1.0.
Loops can be nested, but ensure that the counter variables of the nested loops are unique.
Counter variables should never be modified.
Example
Notes
GetZerofieldwidthreturns the value of the ZeroFieldWidth
GetModulatorFrequencyreturns system modulator frequency
GetRefIndexreturns system dispersant refractive index
GetViscosityreturns system viscosityvalue
GetAnglereturns system anglevalue
GetTemperaturereturns system temperaturevalue
GetWavelengthreturns system Wavelengthvalue
GetConductivityreturns system Conductivityvalue
GetCalibrationConstreturns system CalibrationConstvalue
GetFringeSpacingreturns system FringeSpacingvalue
GetDielectricreturns system Dielectricvalue
GetCellTypereturns system CellTypevalue
GetCellSpacingreturns system CellSpacingvalue
GetCellSpacingreturns system CellSpacingvalue
GetRFRealreturns system RFRealvalue
GetRFImagreturns system RFImagvalue
GetMarkhowinkAreturns system MarkhowinkAvalue
GetMarkhowinkKreturns system MarkhowinkKvalue
GetCellpositionreturns system Cellpositionvalue
GetWidthreturns system Widthvalue
GetPhreturns system Phvalue
GetLaserPowerreturns system LaserPowervalue
GetCellCurrentreturns system CellCurrentvalue
GetVoltageDiffreturns system VoltageDiffvalue
GetCurrentDiffreturns system CurrentDiffvalue
GetCoreRatioreturns system CoreRatiovalue
GetRFRealCorereturns system RFRealCorevalue
GetRFImagCorereturns system RFImagCorevalue
GetFkareturns system Fkavalue
GetConcentrationreturns system Concentrationvalue
GetRFStandardcasereturns system RFStandardvalue
Getdndcreturns system DnDcvalue
GetRayleighRatioreturns system RayleighRatiovalue
The list is the same as under the Set command, which can be used to alter them.
4.68Gosub command
Application
BASIC gosub statement.
Syntax
Gosub label
Notes
Theprogramoperation temporarily jumpstothe subroutine attheline starting withthelabel label.
The use of subroutines allows you to repeat program lines which are needed in more than one
place.
Labels are numerical values.
At the next Return the program continues at the instruction after the GoSub
Example
Measure Sample
GoSub 1000
End
1000 Calculate
Print File using “#.#\r\n”, ZAvemean
Return
4.69Goto
Application
Program Control
Syntax
GoTo label
Notes
The program operation jumps to the line starting with “label”. Do not use goto’s without good
reason as their use is generally considered bad programming practice in all but exceptional
circumstances.
Notes
In the following graph_type is a keyword that can be one of the following:-
Size mode
Intensity
Number
Volume
Residuals
Correlogram
Fit
MolecularWeight
RelaxationTime
Diffusion
Zeta Mode
Mobility
Zeta
Frequency
RawFreq
ZetaData
FringeModel
Graph Pref graph_type.
Brings up graph preferences dialog for the graph specified by graph_type.
Graph Limits graph_typex_scale , y_scale Sets auto/manual limits for the graph. If x_scale 0
then the x axis scales automatically for the graph specified by graph_type. If y_scale 0 then the
y axis scales automatically for the graph specified by graph_type.
Graph Scaling graph_typex_log, y_log if x_log 0 then the x axis uses logarithmic scaling for the
graph specified by graph_type. if y_log 0 then the y axis uses logarithmic scaling for the graph
specified by graph_type.
Graph Xlimits graph_typex_min,x_max
Sets the upper and lower limits for the x axis of the graph specified by graph_type.
Graph Ylimits graph_typey_min,y_max
Sets the upper and lower limits for the y axis of the graph specified by graph_type.
Graph Styles graph_typegraticules, style_type
Specifies the style of the graph specified by graph_type.
1 Colour fill
2 Histogram
3 Colour filled histogram
4.71Keep command
Application
Record management for the live records buffer.
Syntax
Keep n
Notes
Keep n
Saves the current record as record n of the live buffer. The companion function is Select n. Be
aware that selecting a record and then modifying it by say analysing it will not permanently save
the changes in the buffer.
The Keep command is needed to commit the changes to the buffer.
4.72If Command
Application
Program control
Syntax
If expression Then command_expression
If expression Then
...
Else
...
End If
Notes
The If construct takes two forms. If the single line form is used, the command_expression is
executed if expression is true.
In the block form only comments are allowed after the Then.
If the expression is false execution continues after the corresponding Else or End If. The Else
and block between Else and End If may be omitted.
If Then Else End If can be nested to any level.
If ZaveMean 5000 Then
Prompts theusertoinput the numeric value input_value from adialog.Thestring prompt_string$
is the message displayed to the user. Only a single variable can be input at one time.
Input prompt_string$, input_string$
Prompts the user to input the string input_string$ from a dialog.
Input Filevar1 [,var2]
Reads var1, var2 ... from the file opened by the File command. Note that the variables can be
numeric or string type. Strings are comma delimited.
Input Comm string$
Reads string$ from RS232 communications. The end of line delimiter is by default a carriage
return but can be reset to any ASCII character by using Comm Delimater.
4.75InRange Function
Application
Results information in Size record.
Syntax
InRange
Notes
The InRange value calculated from the ratio of the far points. A high value (85 -100 %) indicates
that the correlation function has nearly decayed to 0 by the measured far point, and hence the
sample time is set to a suitable value, and the experiment a well founded one.
Notes
This function returns a string made up of the first ncharacters of string$.
If n is greater than the number of characters in string$ then the whole string is returned.
Example
After the call A$ contains “Ab”
A$ = Left$(“AbcDe”,2)
4.84Len Function
Application
String Function
Syntax
Len(String$)
Notes
This function returns the number of characters in the string string$
Examples
A = Len(A$) + 2
4.85Line Command
Application
Page graphics.
For use in pages only.
Syntax
Line x1,y1, x2,y2
Notes
Draws line from (x1,y1) to (x2,y2) and sets current position to x2,y2.
The current line colour and style is used. Positions are defined in mm.
Notes
This command changes thelinecolourofthe lines draw on tables. n is the line colourasan index
into the PCS colour palette. Use the Setup Table dialog to see the list of colours. Only values of
n between 1 and 15 can be used.
Example
Line 10,10 ,100,10
LineColour 2
Line 100,10, 100,100
LineColour 3
Line 100,100, 10,100
LineColour 4
Line 10,100, 10,10
4.87LineTo Command
Application
Page graphics.
For use in pages only.
Syntax
LineTo x,y
Notes
Draw line from current position to x,y, and sets current position at x,y.
4.88Ln Function
Application
Mathematical function.
Syntax
Ln(x)
Notes
Returns the natural logarithm of the argument, which should be greater than zero.
4.89Load Command
Application
File system command
Syntax
Load Record i
Load Contin i
Load Configuration FileName$
Loads record i from the current file into memory. If changes are made to thisrecordthatyouwish
to save, remember to use the Save Record command.
Load Contin i
Loads record i from the set of records produced by the last Contin analysis into memory.
Load Configuration FileName$
Loads a PCS configuration file. FileName$ is the filename.
4.90LogFunction
Application
Mathematical function.
Syntax
Log(x)
Notes
Returns the Log to the base 10 of the argument, which should be always greater than zero.
4.91LTrim$Function
Application
String command
Syntax
LTrim$( String$)
Notes
Returns astringwith all leading space, tab and othernon-printing characters of String$ removed.
4.92MAddSelect Command
Application
File system command
Syntax
MAddSelect i
Notes
This adds to the current set of records selected. Where the records will be selected is dependent
on the file context. This selection will be used in any subsequent MCalculate command for
example. Whether the records are selected in the current file or the live buffer can be set by the
Use command.
Set delay time between measurements (defined in hours, minutes and seconds).
Measure Sequence [,Number_of_measures, Duration, sample_size]
Starts measurement sequence. Note that for a Zeta measurement sequence the sample_size
argument is not necessary. If any parameters are missing then automatic defaults are supplied.
Measure DocumentDocument dialog
Initiates the Measure Document dialog
Measure DurationMeasurement duration
Sets experiment duration. Execution of this command will set the measurement duration of the
measurement relevent to the current mode. For example in Intensity mode the durations of the
TimeTrace/AngleScan measurements will be set.
Measure ZLimitsZLower , ZUpper
Set Zeta potential range. This defines the modulator frequency in a measurement sequence.
The modulator frequency is set as follows:
2Abort, Retry & Ignore
3Yes, No & Cancel
4Yes & No
5Retry & Cancel
16Stop Icon
32? Icon
48! Icon
64* Icon
256Button 2 is default
512Button 3 is default
Return value
1 = left, 2 = middle, 3 = right button
4.98Mid$ Function
Application
String Command
Syntax
Mid$(string$,start,n)
Notes
This function returns a string with n characters of string$ starting at character start.
An error isissued ifstartisbeyondtheend of string$. If n is greater that thenumberof characters
remaining in the string then the remaining characters are returned.
Example
After the call A$ contains “cdefg”
a$ = Mid$(“abcdefghijk”,3,5)
Notes
Returns ith channel of spectrum in mobility space. The channels are defined by the Fourier
transform underlying the analysis.
4.103MolecularWeight
Application
Result information from intensity record.
Syntax
MolecularWeight
Notes
Returns the MolecularWeight calculated from a Zimm Plot or Debye plot. This is only valid if the
record has been obtained from a Zimm scan or Debye scan.
The result is in AMU.
4.104Move (x,y)
Application
Page graphics and text.
Syntax
Move x,y
Notes
Moves the current anchor position for lines, boxes or text to position x,y on the table page or
report. No drawing is performed x and y are in mm and if either is omitted the current value is
used. x,y are measured from the top left hand margin of the page. y increases positively down
the page.
Example
for k =1 to 10
FillColour k
LineColour 10 -k
X1 = k*10
Y1 = k*10
Move X1,Y1
Box X1+10, Y1+10
next
Notes
Prints current selection of records. These have been selected using Select and MSelect. They
are selected from the live records buffer or current file according to whether Use Buffer or Use
Disk have been used.
4.106Msave
Application
File and record management
Syntax
MSave
Notes
Saves selected records from Buffer to Disk. Records are selected using Select and MSelect.
4.107MSelect
Application
File and record management
Syntax
MSelect
Notes
Selects arecordinthe current file or live record bufferaccordingto the last Use FileorUse Buffer
command. The selection can be added to using the MAddSelect function. Once selected the
records can then be analysed using MCalculate, or printed using MPrint, saved or loaded using
MSave/MLoad. If no parameters are supplied then the relevant records list dialogue box is
opened.
Mtransfer
Transfers data from the correlator and performs analysis and appends it to the live buffer. The
appended record is made the selected record in the buffer. It has the same effect as using the
Measure Transfer menu item.
Next
For full details please consult the For command. This is part of the For...To...Next structure.
4.108Number function
Application
Results information from Size record
Syntax
Number size_band
Notes
Returns the number disribution amplitude of size class size_band. The number of classes is
equal to NumSizes (see later).
A file is opened in the current directory. If the file extension is omitted one of the same type as
the current mode (ie .sz2, .zet etc.) will be included. Opens new data file for the current mode.
If an extension is not given then one will be supplied.
Open Comm port_id, baud_rate, Parity, data_bits, stop_bits, handshaking
Opens and configure a comms port for serial communiciation.
Port_id
Id of port to be used. This is limited by the number of physical ports in the computer.
baud_rate
Baud rate at which communication will operate. Valid values are 2400,4800,9600 and 19200.
Parity
One of the following keywords must be used:- EVEN, ODD, NONE.
data_bits
Number of data bits. Valid values are 6,7 or 8.
stop_bits
Number of stop bits. Valid values are 0 ,1 or 2.
handshaking
Flow control. Valid values are 0 (none), 1 (XOn/XOff) or 2 (Hardware).
If any parameter is omitted, then a default will be supplied from the Setup configuration
Secondary command
Comm Comm Port , Baudrate, databits. StopBits, Parity,XonXoff
Parity may be EvenParity,OddParity or NoParity. If any parameters are missed out, defaults will
be supplied set up under the Setup Configuration.
4.114OsmoticMob Function
Application
Result information from Zeta record.
Syntax
OsmoticMob
Notes
The equivalent value of mobility calculated for the cell wall by the last capillary scan calculation
applied to the current record.
Notes
Outputs a 16 bit digital value to the port address on the computer bus.
4.116Page Command
Application
Page program design.
Syntax
page page_name$, x_extent, y_extent
Notes
Specifies page size (in mm). Program name is used as a label which is longer and therefore
potentially more descriptive than the filename containing the page program. This command
should be the first line of a page program. Pressing Info on the pagesetup dialogue displays the
program name field for the selected program file.
4.117Pause
Application
Program control
Syntax
Pause time
Notes
The operation of the program is suspended for time in seconds. Other Windows programs can
run during the pause unless the program is in Exclusive mode.
Examples
Print status “About to open valve”
Pause 5
4.118Peak Command
Application
Results information for Zeta and Size records.
Syntax
PeakNumberArea inumber distribution
PeakVolumeMeans ivolume distribution
PeakIntensity Width iintensity distribution
PeakZeta Numberzeta distribution
PeakMobility Areamobility distribution
PeakFrequency Widthfrequency distribution
Notes
The peak command returns information about the modes in distributions.
Return the relative area of the ith mode of the distribution as a percentage of the complete
distribution. The value of i must be greater than zero and less than or equal to the total number
of peaks in the distribution.
If i is absent then 100 is returned.
Peak Means i
Return the mean of the ith mode of the distribution. The value of i must be greater than zero and
less than or equal to the total number of peaks in the distribution. If i is absent then the mean of
the complete distribution is returned.
Peak Width i
Return the width of the ith mode of the distribution. The value of i i must be greater than zero
and less than or equal to the total number of peaks in the distribution. If i is absent then the
standard deviation of the complete distribution is returned.
Peak Number
Returns the total number of modes found in the distribution.
Examples
To find the number of peaks in the number distribution of a size result we could use the following
n = Peaks number number
if n then goto 1000
write “Peak Mean (nm) Width Area”
for j=1 to n
m = Peaks number means j
w = Peaks number width j
a = Peaks number area i
write “## ####.# ####.# ####.#”, j,m,w,a
next
1000
end
4.119Picture Command
Application
Drawing bitmaps, metafiles or graphs in page programs.
Notes
All picture types except the bitmap and metafile type correspond to graph types produced by the
system. For the bitmap and metafile options, the filename$ is the file containing the associated
bitmap or metafile.
The availability of the particular graph will depend on the operating mode.
Intensity, Volume, Number, Correlogram, Fit, MolecularWeight, RelaxationTime and Diffusion
are only available in Size mode.
Zeta, Frequency, Rawfreq, Fringemodel and Correlogram are available in Zeta mode.
InverseQScan, Qscan, Anglescan, Zimmplot and Timetrace are available in Intensity mode.
4.120PolydispersityFunction
Application
Results information from Size record.
Syntax
Polydispersity
Notes
The Polydispersity calculated using the initial cumulants fit to the current size result.
4.121Print Command
Application
Command to output to various destinations
Notes
These commands print the result of a list of expressions to different destinations. expression_list
is a list of expressions containing variables, constants, string variables or quoted strings. Each
expression is separated by a comma or by a semi-colon.
Print Dialog , expression_list
The printing appears in a message box with OK and Cancel buttons.
Print File
Printing will output to the file last named by the File command. Use delete file to prepare a new
file for saving information to . Each subsequent use of print file append information to the file.
Print Comm
Printing will output to the comm port opened by the last call to Open Comm.
Print Status
The printing is sent to the status line at the bottom of the graph window.
Print string
The printing is sent to a global buffer which can be used for DDE operations. Use Delete string
to empty the string before use. Each call appends information to Copy string transfers the
contents to the clipboard.
the string.
The string produced by evaluating the list of expressions must not exceed 255 characters. A line
feed and carriage return are appened to the end of the printed line unless the list i
Print Printer
Prints directly to the LPT port. This is only useful if a printed log is required.
4.122Print Page Command
Application
Printing to paper
Syntax
Print Page type1 [,type2], graphsize
Notes
This command prints items to the printer. type1, type2 are options from the list Report, Graph,
Table, Key, Title.
Any of these items may be used in any combination. If a graph is required the size of the graph
may be specified by the graph_size, which can be:-
FitFit the graph to the page (when another option has been selected).
If no parameters are supplied use print dialog
4.123Print Report Command
Application
Prints report to paper
Syntax
Print Report [,PageFile1$] [, PageFile2$]
Notes
If no parameters are supplied, then the currently selected options are used. Otherwise a report
is printed using the page files Page1$,andPage2$ as page files.This function returns the angle,
in radians, of which the cosine equals the number. The value returned is in the range 0.0 to 2Pi
The value of number must be in the range -1.0 to 1.0.
4.124Print ...Using command
Application
Command for formatted output to various destinations.
Syntax
Print dialog using, format$, expression_list
Print dialog using format$, expression_list
Print status using format$, expression_list
Print string using format$, expression_list
Notes
This is a formatted version of the Print command, See Print for information on the destinations
for the print.
expression_list is a list of expressions containing variables,constants, string variables or quoted
strings. Each expression is separated by a comma. The format$ contains information on how to
format each item in the expression list and must not exceed 255 characters in length. For each
item in theexpression_list theremustbea corresponding format item in format$. Details on what
may appear in format are given below.
Formatting numbers
To format numbers use the # character to represent each digit and the period to represent the
decimal point. The number of digits before and after the decimal point can be varied by adding
# characters. An example for format$ is “##.###”. Negative numbers are prefixed with a minus
sign. The number may also be represented in scientific format using a format such as
“#.###^^^^”,The ^ characters represent the position of the exponent termEsxx where E denotes
the exponent , s is the sign (+ or -) and xx is the power of 10 to be used.
Note: The scientific format must have 4^ characters and must have only one # charater before
the decimal point. For example, we show the result of displaying the number 123.4567 with
various formats.
String Characters
To format a string variable, string functions or quoted strings use the $ character to represent
each character of the string. The character string is left justified in the format string if the format
string is longer than required., For long strings you do not need to use a large number of $
characters. If the format is “$n”, where n is a number between 1 and 256, then it acts as if n $
characters were used. The format"$*" acts as if the same number of $ were used in the format
as appear in the string.
For example, below is the result of displaying the string “PCS Software” with various formats.
FormatResult
$$$$$$$$$$$$$PCS Software#
$$$$$$PCS Sof
$8PCS Softw
$*PCS Software
Special characters
The character \ is taken to be a special character in format strings. In combination with another
character they form escape sequences to produce non-printable characters.
\r the carriage return character - Chr$(13)
\n the new line character Chr$)10)
\" the double quotation mark Chr$(4)
\\ the back slash Chr$(92)
\t the tab character
These are meant for special formatting of items. The \r or \n sequences may be used for creating
a new line in a print dialog message box. If you prefer you may produce the same effect using
the Chr$() function.
Other characters
All other characters apart from those printed above printed without alteration.
4.125Range
Application
Range for size analysis.
Syntax
Range
Notes
If the analysis limits have been set using upper and lower sizes the Range will return 0.
4.126RadiusofGyration
Application
Data information for intensity record.
Notes
Results of Zimm Calculation (Rg from all points fitted simultaneously, so not ,in general, equal
to average Rg values for different records)
4.127RawFreq Function
Application
Results information for Zeta record
Syntax
RawFreq (index)
Notes
Intensity ofFouriertransform (for electrophoresis data) atgivenchannel, the number of channels
in this case being equal to that of the correlator.
4.128RecordNumberFunction
Application
File and record management
Syntax
RecordNumber
Notes
The record number of the current record from the Live buffer, or the current file for disk based
data.
4.129Reference Function
Application
Instrument control
Syntax
Reference
Notes
References the stepper motor on the 4700 spectrometer.
4.130Residuals
Application
Result information from size record
Syntax
Residuals (i)
Notes
The difference between fit and data in the ith channel of the current record.
Application
Result information for intensity record
Syntax
Rg
Notes
Returns the radius of gyration from a Guinier plot. This is different from the Radius of gyration
as calculated from a Zimm plot.
4.133Right$ Function
Application
String function.
Syntax
Right$(string$,n)
Notes
This function returns a string made up of the last n characters of string$. If n is greater than the
number of characters in string$ then the whole string is returned.
4.134RTrim$Function
Application
String command
Syntax
RTrim$( String$)
Notes
Returns a stringwithalltrailingspace, tab and other non-printing characters of String$removed.
4.135Run
Application
Program control
Syntax
Run filename$
Notes
The program stored in the specified file is loaded and run. Control is passed back to the calling
program when the subsidiary program terminates. Further nesting and recursion (calling of a
program by itself) is permitted - be careful ! - a method of terminating such a sequence must be
provided.
Notes
This command controls the current running mode of the program. If the expression warning is
greaterthanzero then anycommandthat fails willcausea message boxtoappear onthescreen.
Normally between each command in the BASIC program any pending Windows messages are
processed. If the expression exclusive is greater than zero then no messages are processed
and other programs will not run concurrently with the PCS program. In this mode the program
cannot be terminated by selecting Stop from the main menu but will respond to the cancel button
in Print Dialog.
Example
Runmode 1,0
4.137SampleTime
Application
Data information for Size and Zeta record
Syntax
SampleTime
Notes
Correlator sample time in microseconds, from current record.
4.138Save Command
Application
File and record processing
Syntax
Save Record i
Save Config
Notes
Save Record i
Save current record as record i of the currently open file. If the parameter i is missing then the
record is appended to the file.
Save Config fileName$
Saves current configuration in the file filename$. If no file is specified then the configuration is
saved in the current configuration file.
4.139ScaledCount
Application
Data information for Size record. Applicable to the 7032 correlator only.
Notes
Returns the ith scaled count monitor channel.
4.140ScanAngle
Application
Data information from an Intensity record.
Syntax
ScanAngle i
Notes
Returns the angle at which the ith measurement of an angle scan was performed.
4.141ScanDuration
Application
Data information from an Intensity record.
Syntax
ScanDuration
Notes
Returns duration of each measurement carried out at each angle during an angle scan.
4.142ScanQ Function
Application
Data information from an Intensity record.
Syntax
ScanQ i
Notes
ScanQ i returns the square of the wavevector associated with the ith measurement of an angle
scan. The wavevector is related to the angle by the following:-
Wavevector:=4*Pi*RefIndex*sin(0.5*Angle)/WaveLengthwhereRefIndex is therefractive index
of the dispersant and Wavelength is the wavelength of the incident light.
4.143ScanType
Application
Data information from an Intensity record.
Syntax
ScanType
Notes
ScanType returns the type of measurement that produced the record. The following
1Angle scan
2Zimm scan
3Standard scan
4Background scan
5Zeroconcentration scan
6Zero concentration standard scan. (Zero concentration measurement copied from
standard scan)
8Debye scan
4.144Select Command
Application
Record management
Syntax
Select irecord
Notes
Selects record n in the live buffer as the current record and loads it into memory. Note that any
modifications to the record must be saved by using the Keep command.
4.145SetCommand
Application
Set data variables in current record.
Syntax
Setnote1string$
Set note2string$
Set note3string$
Set Timearray iChannel ,value
Set StoreChannel iChannel, value
Set TotalSamples value
Set SampleTime value
Set AChannel value
Set BChannel value
Set MeasFarPoint value
Set CalcFarPoint value
Set Zerofieldwidthv
Set ModulatorFrequencyv
Set RefIndexv
Set Viscosityv
Set Anglev
Set Temperaturev
Set Wavelengthv
Set Conductivityv
Set CalibrationConstv
Set FringeSpacingv
Set Dielectricv
Set CellTypev
Set CellSpacingv
Set CellSpacingv
Set RFRealv
Set RFImagv
Set MarkhowinkAv
Set MarkhowinkKv
Set Cellpositionv
Set Phv
Set LaserPowerv
Set CellCurrentv
Set CoreRatiov
Set RFRealCorev
Set RFImagCorev
Set Fkav
Set Concentrationv
Set RFStandardv
Set DnDcv
Set RayleighRatiov
Notes
See Get command for details on the various commands.
Notes
Setup Table
Displays the Setup Table dialog.
Setup Table name
Set table for table type Table_name to a user defined page program , page_file$.
4.148Setup Report
Application
Configure printed report setup.
Syntax
Setup Report [,page1$ ,page2$]
Notes
Set report pages to page1$ and page2$. If page2$ is missing then only one page is used If
page1$ and page2$ are missing then the Setup Report dialog is shown.
AngleEndEnd angle of measurement
ElapsedTimeTime at which measurment was started
PhpH
ConductivityConductivity
NumPointsNumber of points used in analysis
TitleTitle
4.150Setup Userlogtable
Application
Configure user log table.
Syntax
Setup Userlogtable x1, x2, ....
Notes
This command configures the user log table so that the table displays the options x1, x2 ... Valid
option keywords are as for the Setup Userlogplot command. If an empty list is supplied then the
Setup UserLogTable dialog is shown.
Notes
Simulate start simulate_zeta.
Puts the software into simulation mode. If simulate_zeta is greater than zero then the input
functions are simulated too - that is artifical values of voltage, temperature etc are supplied.
Simulate Stop
Returns from simulate mode to the standard mode of operation.
Simulate Size peak_position
When in size mode simulate asignalarisingfroma monomodal distribution at peak_position nm.
Simulate Countrate count_rate
Sets count rate of simulated signal.
Simulate SignalToNoise signal_to_noise
Sets signal to noise ratio of simulated signal
Simulate NoiseLevel noise
Set noise level of simulated signal.
Application
Result information from a Size record.
Syntax
Sizes i
Notes
Size Class(i) in nanometres. i ranges from 1 to NumSizes.
4.154Spacing
Application
Result information from a Size record.
Syntax
Spacing
Notes
The nominal multiplicative factor (analysis dilation) specifying the minimum separation between
successive correlator channels chosen to form the set FitTime. Since the hardware of the
correlator can only generate channels at certain integer delay times the actual channel chosen
will be the nearest integer greater than the previous channel multiplied by this spacing.
4.155StartAngle
Application
Result information from an intensity record.
Syntax
StartAngle
Notes
StartAngle returns the starting angle of the current record if the data is an angle or zimm scan.
Otherwise it is the angle at which the timetrace or Debye scan was carried out. See EndAngle.
4.156Step
This is part of the control structure For... = ...To...Step...Next
For full details see the For command
Application
Result information from an Size or Zeta record.
Syntax
StoreChannel i
Notes
Contents of the ith store channel of the correlator data stored in the current record
4.158Str$ Function
Application
String command
Syntax
Str$(value)
Notes
Returns a string representaion for the number value (or result of numeric expression)
4.159StrCmpCommand
Application
String Command
Syntax
StrCmp(String1$,String2$)
Notes
Compares the strings String1 and String2 lexicographically and returns a value indicating their
relationship. The comparison made is based on the current language selected by the user at
setup or the Control Panel. The comparison is case-sensitive. The value return is
1 = String1 String2
0 = String1 = String2
-1= String1 String2
4.160TextAlign
Application
Table and graphics output.
For use in pages and reports only.
Notes
This command controls text alignment to the current page position. If n= 0 the text is left aligned.
If n =1 then the text is centre aligned and if n=2 the text is right aligned. In all cases the current
anchor position is at the top of the text.