Easy-Wire Scripting Manual.2017.4.0
Easy-Wire Scripting Manual.2017.4.0
Version 2017.4.0
easy-wire Scripting Manual
Copyright Cirris Systems Corporation
401 North 5600 West
Salt Lake City, Utah 84116
U.S.A.
II
Introduction 1
What is easy-wire scripting? ........................................................................................... 1
Enabling Scripting........................................................................................................... 2
Getting a Script ............................................................................................................... 3
Different kinds of scripts ................................................................................................. 4
LUA Test Event Scripts 5
Overview ....................................................................................................................... 5
Required Syntax for a LUA Test Event Script ................................................................. 6
Selecting the LUA Test Event Script for a Test Program................................................. 7
EVT Test Event Scripts 8
Overview ....................................................................................................................... 8
Required Syntax for an EVT Test Event Script ............................................................... 9
Selecting the EVT Test Event Script for a Test Program............................................... 10
Parameter Types and Values ....................................................................................... 12
Component Scripts 13
Overview ...................................................................................................................... 13
Component Script Syntax ............................................................................................. 14
Parameter Types and Values ....................................................................................... 15
More Component Script Examples ............................................................................... 15
Inserting a LUA Component into a Test Program.......................................................... 16
Custom Report Scripts 18
Overview ...................................................................................................................... 18
Setting up a Custom Report Script ............................................................................... 18
Custom Report Syntax.................................................................................................. 19
Custom Script Example ................................................................................................ 19
Easy Touch Embedded Blocks 20
Who Should Read this Section ..................................................................................... 20
How Embedded Blocks are Implemented ..................................................................... 21
Script Errors & Debugging 34
Common Script Errors .................................................................................................. 34
Debugging Methods ..................................................................................................... 35
Cirris Functions 36
Cirris functions organized by category .......................................................................... 36
Cirris Functions organized alphabetically ...................................................................... 38
Date and Time Functions.............................................................................................. 40
Digital Input and Output Functions ................................................................................ 43
File Functions ............................................................................................................... 55
Low Level Function....................................................................................................... 59
Measurement and Test Functions ................................................................................ 68
Printer Functions .......................................................................................................... 87
Tester Information Functions ........................................................................................ 91
Test Information Functions ........................................................................................... 94
User Interface Functions............................................................................................. 104
1100 Embedded File Functions .................................................................................. 111
Preserved Lua 3.2 Functions ...................................................................................... 119
Unsupported Cirris Functions ..................................................................................... 120
Index 121
ii
You may download example scripts files and a PDF
version of this manual from the Cirris Community
Forum.
To do this:
1. In your web browser, type in the URL https://community.cirris.com.
2. Click Downloads on the top menu bar.
3. Click Documentation under Download Categories.
4. Find the downloads Search box in the upper right corner of the download page. In
this box type Easy Touch Scripting.
5. Click on either the Easy Touch Scripting manual or examples.
6. Click Download.
iii
Introduction
What is easy-wire scripting?
You can use easy-wire scripting on the Cirris Easy Touch, CR, and CH2 testers, all of
which use the Cirris easy-wire software. You can also use easy-wire scripting on a Cirris
1100 tester that is controlled by a PC running the Cirris easy-wire software. An easy-wire
script will typically not run on an independent 1100 Tester, or on a Cirris Touch1 tester. A
Cirris scripting language with some different commands is used for these applications.
By using scripting you can make the tester extremely flexible and customize a test process
to fit a unique task. The following list gives examples for using scripts:
• Create complex tests that are easy for line workers to use.
• Make highly customized reports or cable tags.
• Control external devices such as lamps, hold-down clamps, markers, etc.
• Test devices such as switches, gas fuses, zener diodes, bi-color diodes, etc.
• Verify color and lighting of LED’s.
• Display prompt messages.
• Hipot different nets at different voltages.
1
Introduction
Enabling Scripting
Scripting must be enabled before you run a script file on your tester. If scripting was
ordered with your tester, the scripting option should be checked on the tester’s options
label. You can find this label on the top front corner on the left side of the tester. If you are
enabling this option in the field, use a marker to check this label when Scripting has been
enabled.
If you are using an 1100 series tester, PC Control must also be enabled in the above
Enabled Features window.
2
Introduction
Getting a Script
Writing scripts can be challenging. You may choose to have Cirris write a script for you,
or modify an existing script for your application. For those who choose to write their own
scripts, having an aptitude for programming and previous programming experience is
highly recommended. You may download example scripts files from the Cirris
community forum. See the page after the table of contents for instructions on
downloading these examples.
Scripts are ASCII text files. You can write or modify a script using a text editor or a word
processor running in text mode. Many programmers prefer to use a text editor that is
optimized for the programming environment Notepad++ is a popular editing program
that can be downloaded for free. If using Notepad++, make sure to set the language
option to Lua for better programming clarity.
Whenever you are about to make major modifications to a script that has been
functioning, make sure to make a copy of the script to preserve the original file. When
developing a script, being able to quickly make and try script changes is critical. To this
end you may find it helpful to attach a keyboard to the Easy Touch tester to edit a script.
You may also store script files on a network where they can be accessed by the tester
and your programming station. When using easy-wire software to control an 1100
tester, you may copy the script files to any drive and directory that is accessible to the
PC running the easy-wire software.
3
Introduction
Component Scripts
You can attach one component script to test program. However, the component script file
can have one or more custom components. After attaching the component script file to a
test, you can add its custom to the test in manner similar to how you can add test
instructions. Like test instructions, custom components must be correctly completed for a
test to pass. Therefore, a component script differs from other script types in that it can
cause the test to fail. Creating a custom component script can allow you to test standard
components to higher level or test electrical components and conditions that differ from
standard components.
4
LUA Test Event Scripts
Overview
A LUA Test Event Script is executed when one or more test events occur during the test
process. The easy-wire software uses a value to represent each of these events. When the
event occurs, the script passes the value to the script. The test events and their values are
shown in the table below.
value LUA test event
1 The first test event occurs when the test program is loaded.
2 The second test event occurs when the low voltage test begins. The low voltage
test is the first test that is performed on a cable and always occurs.
If the Test Method is set to Signature Continuous Test, the low voltage test
starts when the operator attaches a cable assembly.
- OR -
If the Test Method is set to Signature Single Test, the low voltage test starts
when the operator presses Start in the Test Window.
3 The third test event occurs at the end of all tests on a cable. This includes the
low voltage test, and if selected, the high voltage and intermittents test.
If the Test Method is set to Signature Continuous Test, the end of all tests
happens when the cable assembly is removed.
- OR -
If Test Method is set for Signature Single Test mode, the end of the test
happens when the low voltage, and if selected, high voltage test are completed.
A LUA Test Event Script says in essence, “When a test event happens, do the following thing
or things.” A LUA Test Event Script will not cause the test to pass or fail. If you want to test
custom electrical characteristics of a circuit, you should use a component (CMP) script
instead. Unlike CMP and EVT scripts, LUA Test Event Scripts accept no parameters.
Parameters allow you store values for the script, which can then be changed in the test setup
without modifying the script.
You can assign one test event script to a test program. A LUA Test Event Script must end
with a .lua file extension and must include the required syntax as shown in the following
section.
5
Lua Test Event Scripts
Here’s a slightly longer LUA test event script that congratulates the operator at all three test
events.
function DoOnTestEvent(iwhen)
if iwhen == 1 then
MessageBox(“Good job loading the test program”)
end
if iwhen == 2 then
MessageBox(“Good job starting the test”)
end
if iwhen == 3 then
MessageBox(“Good job completing the test”)
end
end
6
LUA Test Event Scripts
1. Edit the Test Program. In the test editor press the Set Test Defaults tab.
2. Press Select Test Event Script.
3. Press the Attach button. Remember, a LUA Test Event Script must have a .lua file
extension.
4. Note: With Enable Script Changed Warnings selected in the window above, you will not
be able to load the Test Program using the script if the script changes. Instead a warning
window will be displayed. After you are through making frequent changes to a script, you
can use this selection to help ensure the integrity of the test event script used by the test
program.
5. Press OK.
7
EVT Test Event Scripts
Overview
An EVT Test Event Script can execute upon the test events shown in the table below. Each
event has an associated value. The easy-wire software passes this value to the script when
each of these events occurs.
If the Test Method is set to Signature Continuous Test, the low voltage test
starts when the operator attaches a cable assembly.
- OR -
If the Test Method is set to Signature Single Test, the low voltage test starts
when the operator presses Start in the Test Window.
3 The third test event occurs at the end of all tests on a cable. This includes the
low voltage test, and if selected, the high voltage and intermittents test.
If the Test Method is set to Signature Continuous Test, the end of all tests
happens when the cable assembly is removed.
- OR -
If Test Method is set for Signature Single Test mode, the end of the test
happens when the low voltage, and if selected, high voltage complete.
4 The forth test event occurs when the test window is open and the test is
waiting to start. Note that this test event happens before each test cycle.
5 When the operator exits the Test Window to return to the main menu.
Unlike a LUA Test Event Script, an EVT Test Event Script accepts test parameters. The test
parameters are values that are passed to the script, but can be easily changed in the easy-
wire software’s test editor. This also allows you to use the same EVT test event script in
different test programs, but use different parameter values for each program as needed. For
more information on parameter types see page 12.
There can be only one LUA or EVT Test Event Script used in a test program. If using parent
child test programs, only the parent test program can use a test event script.
An EVT Test Event Script must end with an .evt extension and have the required syntax as
described as follows.
8
EVT Test Event Scripts
9
EVT Test Event Scripts
1. Edit the Test Program. In the test editor click the Set Test Defaults tab.
2. Press Select Test Event Script.
3. Press the Attach button. Remember, an EVT Test Event Script must have a .evt extention.
4. Select the script and press Open. Applicable error messages will be displayed. When the
script successfully loads the parameter editor will open. If Hello Bob were used for the
greeting parameter as in the preceding example, you would see the value as shown.
greeting
5. If desired, you could change “Hello Bob”. When you are satisfied with the value, press OK.
The value will be used whenever the test is used. It is also possible for no default value to
be used in the parameter definition. If no parameter is displayed, always enter a value
before pressing OK.
10
EVT Test Event Scripts
At any time you can change the value of the parameter by returning to the Select Test Event
Script Window and pressing Edit.
With Enable Script Changed Warnings selected, you will not be able to load the Test
Program using the script if the script changes. Instead, a warning window will be displayed.
After you are through making frequent changes to a script, make sure to check this selection
to help ensure the integrity of the test event script used by the test program.
11
EVT Test Event Scripts
0 = OFF, 1 = 3 uA
2 = 12 uA, 3 = 30 uA
4 = 110 uA, 5 = 376 uA
6 = 2 mA, 7 = 6 mA
“number” Floating point: maximum four For components that need a numeric value. Also for
points before and after decimal capacitances, percentages, resistances, and voltages
outside the range for these parameter types.
“percent” 1 – 99 For percentages outside this range, use the “number”
parameter.
“point” Number tag ties points together Any one test point in a test program. This point can be a
for hipot tests: < 0 means do fourwire point.
not tie together, >= 0 means
group points in this component This type can tie nets together. Points and point lists can
with the same number tag also be tied together by assigning the same number tag.
together for hipot tests.
“point list” < 0 = treat as a separate point Multiple test points in a wirelist that are common to one
(default) action.
0 = tie all points with this
number tag together (can have This type can be used to tie nets together. Points and
multiple number tags) point lists can also be tied together by assigning the
same number tag.
“resistance” .1 Ohms – 5 Megaohm Resistance of a component. For milliOhm, four-wire, and
values greater than 5Meg, use the “number” parameter.
“string” 30 characters, maximum ASCI text variables
“textlist” Allows the script to do different options depending on
your selection. When creating a textlist parameter type,
use text strings that will aid in identifying the test
parameter. When the selection is made, there will be an
index starting at one to identify which item in the list was
selected. To access your selection, inside the test
function use the first item in the input parameter list. For
example:
Button = {one ,two, three, four}
Button[1] = the position in the array
Button[2] = the text in that position
“voltage” 50 –1500, tester dependent High voltage applied to a test point or net. For other
voltages or setting external voltages, use the “number”
parameter.
12
Component Scripts
Overview
You can add one component script to a test program. However, a component script can
contain one or more “Lua Components”. You can use a Lua Component to test for a unique
characteristic on the tested assembly, which characteristic could not be tested with the
tester’s base capability. Just as the test instructions for wires, a Lua Component must be
correctly completed for a test to pass. Therefore, a Component Script differs from other script
types in that it can cause the test to fail.
Component Scripts can use test parameters just as EVT scripts. The test parameters are
values that can be used in the test, but can be easily changed in the easy-wire software’s test
editor. For more information on parameter types see page 12.
One you add a Component script to a test program you one or more of the script’s Lua
Components to the test program. In some instances you might even use the same Lua
Component multiple times with different parameters in a test program. You add Lua
Components to a test program in a similar manner to how you can add test instructions to a
test program. Lua Components execute after the other test instruction have completed.
Component scripts must end with a .cmp file extension and use a defined syntax format as
defined in the following section.
13
Component Scripts
14
Component Scripts
Hipot_pt_net.cmp Applies hipot to one or more nets. The parameters of this Component
allow you to select the points and hipot settings for this test.
LEDHC.cmp Allows you to select the current for a higher current LED.
CustomLED.cmp LED testing script
15
Component Scripts
4. Navigate to the desired Component Script File. Only files with a .cmp extension will be
displayed. Select the file and press Open. In the window below the Component Script
File, EveryTest, has been selected.
Note: With Enable Script Changed Warnings is selected, you will not be able to load the
Test Program using the script if the script changes. Instead a warning window will be
displayed. Use After you are through making frequent changes to a script, you can use
this selection to help ensure the integrity of the test program using the test program.
16
Component Scripts
8. If there is more than one component in the LUA script file, select the appropriate
component using the pick box.
9. To change a parameter value double tap on the parameter line. A parameter value
window will appear. Select an appropriate value and press OK.
10. When you have set all the parameter values as desired, press OK at the LUA Component
Editor Window shown above.
Note: The OK button will be grayed out until you have entered a parameter value for
each of the parameters. In the example window above “Point List” has no default value.
A value must therefore be entered before the values can be accepted.
11. Press OK at the Select LUA Script window to exit back to the Test Editor.
17
Custom Report Scripts
Overview
The easy-wire software makes it easy to customize and print different standard reports and
labels. However if you need to print a report or label outside the standard easy-wire
software’s capability, you can set up a Custom Report Script. Some custom reports may be
better created using an EVT Test Event Script. We describe the advantages of the different
report options below.
Standard Reports
The standard reports and labels created in the easy-wire software can be turned on, off, or
configured separately for each test program.
To use a custom report script, the custom file - whether it be auotgood.rpt, autobad.rpt,
autoall.rpt - must be in the appropriate folder location on the test system. For Vista and
Windows 7, the script file must be stored the report folder on the path
C:\Users\Public\Documents\Cirris\easywire\Report .
For older test systems using XP and 2000, the script file must be stored in the report folder
on the path C:\Documents and Settings\All Users\Documents\Cirris\easywire\Report .
18
Custom Report Scripts
19
Easy Touch Embedded Blocks
Who Should Read this Section
Intended audience
This section affects only those who are running a script on an Easy Touch or who are
controlling an 1100 tester with easy-wire software. This section will provide details of how
the embedded script blocks are implemented on these testers. This section is intended
for advanced scripting users or those with general programming experience.
In normal operation, when a script is started in easy-wire software, the script begins
running in the PC processor. Some of the Cirris measurement functions (such as
GetResistanceMeasurement) are executed in the embedded processor so that the
embedded system can directly control the tester hardware. When the PC processor script
encounters such a command it transfers control to the embedded processor. The PC
script then waits for the results of that function to return from the embedded processor.
Each of these commands must be transmitted over the communication channel between
the two processors, which is very slow compared to the execution speed of the
processors.
In most scripts the time required to pass data between the PC and embedded processors
is unnoticeable, but in some cases a script may run slower because of the time required
for this data transmission. If such a function were executed only a few times during a
script execution, the operator would not recognize a noticeable slowdown. However, if the
function were called repeatedly for a hundred measurements (for the sake of getting an
average, for example), the operator could notice a pause when the script executes.
For this reason Easy Touch scripting allows the use of “embedded blocks”, in which an
entire block of script commands can be designated to run exclusively together in the
embedded processor. Using an Embedded Block can reduce significant data
transmission and substantially increase the execution speed of the script. Thus if a speed
critical section of a script is calling many Cirris measurement functions with little
processing between them, using Embedded Blocks may be a good choice.
20
Embedded Blocks
.
. Functions defined outside the Embedded
. Block will always execute in the PC
processor.
PC processor functions
This syntax is all that is required to make use of Embedded Blocks. With this example any
functions defined in the Embedded Block will always execute in the embedded processor
and nothing else is needed. This behavior is likely sufficient for most new scripts. However,
Embedded Blocks have some additional functionality that may be useful for some new
scripts and for adapting legacy scripts to make use of Embedded Blocks.
21
Embedded Blocks
When the preprocessor encounters a function defined in an Embedded Block, the function
is first sent to the embedded processor in its original form. Then, in the PC script, the
function is replaced with three functions which allow the function to be called in three
different ways – the original function name, an embedded name, and a PC name. The
embedded name causes the function to execute in the embedded processor while the PC
name function will execute in the PC processor. The original function name will call either
the embedded version or PC version depending on a user defined default behavior
(described below).
As an example, consider the following code which represents the original script file before
running the preprocessor.
---------------------------------------
-- {$end}
---------------------------------------
22
Embedded Blocks
After preprocessing, the script will look like essentially like the following (though some
details are not shown to simplify the example):
Embedded Script
---------------------------------------
-- {$block embBlockName }
---------------------------------------
function MyFunction(a, b)
-- original function code
end
---------------------------------------
-- {$end}
---------------------------------------
PC Script
---------------------------------------
-- {$block embBlockName }
---------------------------------------
Original function renamed. This allows for
function __embBlockName_MyFunction(a, b) reassigning the original function name to
-- original function code selectively point to embedded or PC
end version.
function e__embBlockName_MyFunction(a, b)
Embedded name.
return -- call embedded version
end
PC name.
function p__embBlockName_MyFunction(a, b)
return __embBlockName_MyFunction(a,b)
This line reassigns the original function
end
name to point to either the embedded or
PC version depending on user specified
myFunction = e__embBlockName_MyFunction
default behavior. Here it is being assigned
to the embedded version.
---------------------------------------
-- {$end}
---------------------------------------
23
Embedded Blocks
With this new version of the script the user has access to either the embedded version or
the PC version of the function. Based on the example above, to call the PC version of the
function the user would call
p__embBlockName_MyFunction(a, b)
and to call the embedded version the user could call either
e__embBlockName_MyFunction(a, b)
or more simply
myFunction(a, b)
since the default behavior allows for the original function name to call the embedded
version. It is important to remember, however, that these new function names are only
available in the new PC version of the script. Thus any function defined in an Embedded
Block cannot use the alternate function names. It is also worth noting that if you use the
alternative function names in your script code you will be referencing a function that does
not exist until the EasyWire preprocessor processes the script. This could cause
problems if you are using any external Lua syntax checking tools.
Important Notes
Because the code in an Embedded Block may execute on the embedded processor there
are a few important considerations to remember when writing code for Embedded Blocks.
First, because the embedded processor uses a Lua 3.2 environment, all code in an
Embedded Block must be Lua 3.2 compatible. This includes ensuring that functions are
defined before being called and not using newer Lua features that are not supported in 3.2
such as ‘for’ loops. A second important note is that since the code may run on the
embedded processor, functions such as ‘MessageBox’, ‘DialogOpen’, and
‘PromptForUserInformation’ should not be used because the dialog boxes will be sent to
the embedded processor display, which may not exist (in the case of an EasyTouch
tester, for instance). These functions will cause the script to appear to be ‘hung’ because
the script is waiting for user input which the user cannot give.
24
Embedded Blocks
Global Variables
In addition to function definitions, global variables can also be defined in an Embedded
Block. This could be useful for updating an existing script to run faster on an Easy Touch
Tester, but is not advisable when writing a new script. When global variables are defined
inside the Embedded Block both the embedded processor and the PC processor will have
a unique copy of the variable, and thus the variable will no longer be truly global. If the
variable is serving as a constant value that is never updated this is acceptable behavior
and will allow both processors to see the constant value. However, if a global variable
gets updated by one processor the change will not be represented in the other processor,
which may cause unexpected behavior.
Of equal importance to remember is that global variables not defined in an Embedded
Block will not be defined in the embedded processor and could provide unexpected ‘nil’
values if used in functions defined in the Embedded Block. The preferred way to transfer
information between functions that may execute in different processors is simply to use
the parameters and return values of those functions.
If you think there is a compelling reason to use global variables inside an Embedded
Block you will have to provide a mechanism to ensure that the global variables in both
processors remain synchronized. Some example code for such behavior is provided
below.
25
Embedded Blocks
---------------------------------------
-- {$block embBlockName}
---------------------------------------
myGlobal = 0
function ChangeGlobal()
myGlobal = 100
end
function UpdateMyEmbeddedGlobal(NewValue)
myGlobal = NewValue Synchronizing Functions – defined
end inside the Embedded Block to give
access to embedded version of
function GetMyEmbeddedGlobalValue() myGlobal
return myGlobal
end
---------------------------------------
-- {$end}
---------------------------------------
function My_PC_Function()
myGlobal = 5
UpdateMyEmbeddedGlobal(myGlobal)
ChangeGlobal()
myGlobal = 5 before execution
myGlobal = GetMyEmbeddedGlobalValue() myGlobal = 100 after execution
end
26
Embedded Blocks
Embedded Script
---------------------------------------
-- {$block embBlockName }
---------------------------------------
function MyFunction(a, b)
local c
c = a + b
return c
end
---------------------------------------
-- {$end}
---------------------------------------
PC Script
---------------------------------------
-- {$block embBlockName,1 }
---------------------------------------
function __embBlockName_MyFunction(a, b)
-- original function code
end
function e__embBlockName_MyFunction(a, b)
return -- call embedded version
end
function p__embBlockName_MyFunction(a, b)
return __embBlockName_MyFunction(a,b)
end With the 2nd parameter of the block
definition set to ‘1’ the original function
myFunction = __embBlockName_MyFunction name is now set to refer to the PC version
of the function.
---------------------------------------
-- {$end}
---------------------------------------
27
Embedded Blocks
The behavior of having the original function name refer to the embedded version of the
function is the default when no parameter is provided following the block name. This
behavior can also be achieved by providing a ‘0’ as the second parameter, as illustrated
below.
-- {$block embBlockName,0}
The most likely scenario for changing the default behavior of the block is when changing
an existing script to work more efficiently on an Easy Touch Tester. In most scripts only a
limited portion of the script will need to be put into an Embedded Block for speed
improvement. However, the functions placed in the Embedded Block may call other
functions that are used throughout the rest of the script which will need to run in the PC
most of the time. In this case it may be beneficial to change the default behavior to have
all Embedded Block functions run in the PC processor and then explicitly call the
embedded versions in the few select cases where they are needed.
28
Embedded Blocks
Calling sub-functions
In general there are two types of code in a script – code defined inside an Embedded
Block, and code defined outside an Embedded Block. Functions defined in an Embedded
Block may call other functions also defined in an Embedded Block. Code execution can
also flow between code defined outside a block and code defined inside a block. Script
execution always begins with code defined outside a block which executes on the PC
processor. When execution moves from code defined outside a block to code defined
inside a block we may say execution is ‘entering’ the block. Similarly, when execution
flows from code defined inside a block to that defined outside the block we may say
execution is ‘exiting’ the block. If more than one Embedded Block is defined in a script it
is also possible to exit one block and enter directly into another block.
There are two ways in which execution can enter a block from code defined outside a
block – calling the PC version of a block function or calling the embedded version of a
block function. The path that is taken to enter the block determines on which processor
that code will run. Once execution is started on a given processor it is desirable to
continue execution on the same processor until exiting the block.
29
Embedded Blocks
For instance, consider functions functionA and functionB, which are defined in an
Embedded Block in the following example.
---------------------------------------
-- {$block emb}
---------------------------------------
function functionB()
…
end
function functionA()
…
functionB()
end
---------------------------------------
-- {$end}
---------------------------------------
…
PC_function()
…
P__emb_functionA()
…
end
…
In the function defined outside the block, PC_function, it is desirable to call functionA to
run on the PC processor to save the overhead of transferring execution to the embedded
processor. However, functionA calls functionB, which is also defined in the Embedded
Block. If functionB executes in the embedded processor, there will be no benefit to calling
functionA to run on the PC processor. Thus, the desired behavior in this case is to have
functionB also execute on the PC processor since that is how functionA was called.
However, if a different path of execution is taken in which functionA is running on the
embedded processor, it would be equally inefficient to have functionB run on the PC
processor. Therefore, the desired behavior is that when code execution enters a block it
will continue executing on the same processor until it exits the block. This behavior is
accomplished through some details of the script preprocessing which were hidden earlier.
These details are explained in the following example for those who want to understand
more fully, however, it is not essential to understand the details of how this accomplished
and the example may be skipped. The important point to understand is that when calling
code in an Embedded Block the code will execute on the same processor until it leaves
that block even if other block functions are called.
The preprocessor adds an extra enable flag to track entering and exiting the block as
illustrated in the full preprocessor output below (new details highlighted). The yellow
highlighted text below shows changes from the script example on page 23.
Embedded Script
---------------------------------------
-- {$block embBlockName }
---------------------------------------
function MyFunction(a, b) No changes are made in embedded script.
-- original function code Thus once execution in a block begins in
end the embedded processor all function calls
will execute on embedded processor.
---------------------------------------
-- {$end}
---------------------------------------
PC Script
---------------------------------------
-- {$block embBlockName }
---------------------------------------
__embBlockName_enable = true
function __embBlockName_MyFunction(a, b)
-- original function code
end
function e__embBlockName_MyFunction(a, b) Checks enable flag – executes on
if __embBlockName_enable then embedded processor if flag is true,
return -- call embedded version otherwise calls PC version.
else
return __embBlockName_MyFunction(a, b)
end
end
Enable flag is cleared to keep execution on
function p__embBlockName_MyFunction(a, b) PC processor.
__embBlockName_enable = false
local temp = {__embBlockName_MyFunction(a,b)}
__embBlockName_enable = true
return unpack(temp) Enable flag is set to allow for processing
end on the embedded processor in future calls.
The default state for the enable flag is true.
myFunction = e__embBlockName_MyFunction
--------------------------------------- The temp = {…} and return unpack(temp)
-- {$end} simply ensure that all return values are
--------------------------------------- returned properly.
Examining the preprocessor output reveals that the enable flag defaults to true – which
enables execution to take place on the embedded processor. If execution enters a block
by calling the PC version of the function this flag is cleared - which keeps execution from
being transferred to the embedded processor for further Embedded Block function calls. It
is also important to note that the enable flag is tied to the block name. This means that if
more than one Embedded Block is defined in your code and you call functions in another
block the enable flag will not affect the second block. For this reason it is best practice to
keep all Embedded Block code in a single block or at least not allow interactions between
blocks whenever possible. It is also worth noting that the enable flag is not intended for
the user to access directly in a script.
31
Embedded Blocks
Summary Examples
Consider the following code example for getting the average value of a measurement,
which illustrates some of the principles presented in this section.
---------------------------------------
-- {$end}
---------------------------------------
function My_PC_Function()
local myPoint1 = 'J1-001'
This calls the embedded version
local myPoint2 = 'J1-002'
of AverageResistence which will
local fAverageValue = 0
local fAverageTime = 0 call the embedded version of
local i = 0 CalculateAverage.
while i < 5
fAverageValue = AverageResistance(myPoint1, myPoint2)
fAverageValueSum = fAverageValueSum + fAverageValue
i = i + 1
Calls PC version of
end
AverageResistence which will
call the PC version of
CalculateAverage.
fAverageValueSum = fAverageValueSum + p__emb_AverageResistance(myPoint1,
myPoint2)
return p__emb_CalculateAverage(fAverageValueSum / 6)
end
The CalculateAverage function in
the embedded block is called to
run on the PC processor.
32
Embedded Blocks
The following example executes the same as the one on the previous page, but uses the
opposite default behavior for the Embedded Block. The yellow highlighted text below
shows the changes from the previous script.
---------------------------------------
1 as second parameter after block
-- {$block emb,1}
--------------------------------------- name, original function name will
refer to PC version.
function CalculateAverage(sum, samples)
return (sum / samples)
end
---------------------------------------
-- {$end}
---------------------------------------
function My_PC_Function()
local myPoint1 = 'J1-001'
This calls the embedded version
local myPoint2 = 'J1-002'
of AverageResistence which will
local fAverageValue = 0
local fAverageTime = 0 call the embedded version of
local i = 0 CalculateAverage.
while i < 5
fAverageValue = e__emb_AverageResistance(myPoint1, myPoint2)
fAverageValueSum = fAverageValueSum + fAverageValue
i = i + 1
Calls PC version of
end
AverageResistence which will
call the PC version of
CalculateAverage.
fAverageValueSum = fAverageValueSum + AverageResistance(myPoint1, myPoint2)
return CalculateAverage(fAverageValueSum / 5)
end
The CalculateAverage function in
the embedded block is called to run
on the PC processor.
33
Script Errors & Debugging
Common Script Errors
34
Script Errors & Debugging
Debugging Methods
Once you have written or edited a script, you may find the syntax is not correct or it simply
does not work. Here are a few techniques you can use to get your script running.
• Put the script on your network where it can be accessible to both the tester and a network
workstation. That way you can evaluate your script changes quickly. Make sure “Enable
Script Changed Warnings” is not selected. That way you won’t have to re-select the script
after each script change. If a network is unavailable to an Easy Touch tester, make and
evaluate script changes on a USB drive. Another option is to attach a keyboard to the
Easy Touch tester.
• Use the Cirris Message Box function to display the value of variables at one or more points
in the script’s execution.
• Revert to the simplest thing that you can get to work. Comment out code, or save a copy
of the script so you can delete sections of the code. Introduce more script functionality to
find script errors.
• After you’ve eliminated all the syntax errors, continue to test the script to ensure it works as
intended and maintains its functionality under different scenarios.
35
Cirris Functions
Cirris functions organized by category
Date and Time Functions Low Level Function
Delay .................................................. 40 Sink / Unsink ..................................... 59
GetDateAsText ................................... 40 Turn On Relay ................................... 60
SetDelayTimeInMilliseconds .............. 41 Source / Clear Source Vector ............ 61
TimePassed ....................................... 41 Read / Clear Read Vector .................. 62
TimerClose ......................................... 41 Set Current ......................................... 62
TimerDone .......................................... 42 Measure Voltage ............................... 64
TimerReset ........................................ 42 Route Current to Relay ....................... 64
Set All Default .................................... 66
Digital Input and Output Functions Set High Current................................. 67
SetUserOutputStates ......................... 46
Cirris.ReadPLCInputOutputStates ...... 47 Measurement and Test Functions
Cirris.SetPLCOutputStates ................. 48 HipotNetTiedToPoint ........................ 76
Cirris.GetBuiltInTesterOutputStates .... 49 Cirris.HipotNetTiedToPoints .............. 68
Cirris.ReadBuiltInTesterInputStates ... 50 Cirris.HipotPointMask ........................ 68
Cirris.SetBuiltInOutputStates .............. 50 EPROM .............................................. 69
GetUserOutputStates ......................... 43 GetCapMeasurement ....................... 71
ReadUserInputStates ......................... 44 GetRelCapMeasurement .................. 72
SetUserOutputStates ......................... 45 GetResistanceMeasurement ............ 73
GetResistanceMeasurement4W ........ 74
File Functions GetTotalCapMeasurement ................ 75
Cirris.ChDir ......................................... 55 HipotNetTiedToPoint ......................... 76
Cirris.CloseDir ..................................... 55 HipotNetsTiedToPoints....................... 76
Cirris.CopyFile..................................... 55 HipotPointMask ................................. 80
Cirris.CurrentDir .................................. 56 LearnCable ......................................... 81
Cirris.DirExists..................................... 56 MicroLan ............................................ 82
Cirris.MkDir ......................................... 56 TestWirelist ....................................... 84
Cirris.OpenDir .................................... 57 UseChildWirelist ............................... 85
Cirris.OpenFileDialog .......................... 57
Cirris.OpenFolderDialog ..................... 57
Cirris.ReadDir ..................................... 58
Cirris.RmDir ........................................ 58
36
Cirris Functions
37
Cirris Functions
EPROM .......................................... 69
38
Cirris Functions
Note: Some Cirris functions previously used in scripting for Cirris 1100 and Touch 1
testers are no longer supported in Easy Touch Scripting (See Unsupported Cirris
Functions page 120 ). Some Lua 3.2 functions previously used in Cirris scripts continue
to be supported (See Preserved Lua 3.2 Functions on page 119).
39
Date and Time Functions
Delay (delayseconds)
Sets a delay for tester functioning in seconds. Use this function when controlling relays
using the low level commands and a delay is needed to let the tester catch up. This
function acts like a NOOP operation. Also, see the SetDelayTimeInMilliseconds function.
GetDateAsText
GetDateAsText (select)
This function returns the current date information as a text string. You can select the
format for the returned date information as indicated in the table below.
date information returned select
function describes itself nothing
Month only MM (no preceding 0) 1
Day only DD (no preceding 0) 2
Year only YYYY 3
Year only YY 4
Full Date MM/DD/YYYY 5
Full Date DD/MM/YYYY 6
Example
sCurrentDate = GetDateAsText (1)
If July were the current month, the function would return the string “5”.
40
Date and Time Functions
SetDelayTimeInMilliseconds
SetDelayTimeInMilliseconds(delay)
This function sets a delay time for tester functioning in milliseconds. See also the function
Delay for setting a delay time in seconds.
Examples:
iInputNum = 5
SetDelayTimeInMilliseconds(iInputNum)
The function will delay all functioning on the tester for 5 milliseconds.
SetDelayTimeInMilliseconds(10)
The function will delay all functioning on the tester for 10 milliseconds.
TimePassed
TimePassed (timer)
This function returns the elapsed time since a timer specified by the handle timer was
opened or reset. The timer handle is integer. Time is returned as an integer value
represented in milliseconds.
Example:
local iTimerHandle = TimerOpen(500)
SetDelayTimeInMilliseconds(300)
local iTimePassed1 = TimePassed(iTimerHandle)
if iTimePassed1 > 200 then
MessageBox(“READY TO START”)
end
TimerClose(iTimerHandle)
This example will create a timer with a 500 millisecond timeout. If the time has been greater
than the 200 msec, a message box will display. The timer will then be terminated.
TimerClose
TimerClose(timer)
This function closes the timer specified by the handle timer, freeing one of the ten available
timers. Timers are created using the function TimerOpen.
41
Date and Time Functions
TimerDone
TimerDone(timer)
This function returns 0 if the timer specified by the handle timer has timed out, or the
function returns 1 if more time is remaining. A timer is created using the function
TimerOpen.
TimerReset
TimerReset (timer)
This function restarts the timer using the original timeout delay that was determined when
the timer was created. The function uses the timer’s handle timer, an integer value
created by the TimerOpen function.
42
Digital Input and Output Functions
GetUserOutputStates
The function returns the state of the digital outputs on the tester’s I/O port. If desired, you
can specify multiple outputs and this function will return their respective states. This
function will return a 0 if the output is on (sinking), or 1 if the output is off (non conducting).
The state of the output port is determined by using the SetUserOutputStates function or by
using the setup for Digital Outputs on the tester.
IO
Connector
Input 0
Power +5 Vdc, 100 mA, max
Input 1
Output 2
Input 2
Output 3
Input 3
Power +5 Vdc, 100 mA, max
Output 0
Not Used
Output 1
Ground
Output 4
Ground
Output 5
3
select IO Connector
(integer) Pin
1 5
2 6
3 10
4 11
5 7
6 8
7 7
8 8
43
Digital Input and Output Functions
ReadUserInputStates
This function returns the state (on or off) of one or up to all four digital inputs on the digital
I/O port. Each returned input state corresponds respectively to the specified input. The
function returns a 1 if the input is on (high) or a 0 if the input is off (low). Each input is
specified by an input select number as shown in the table below.
input description
select number
1 Input 0
2 Input 1
3 Input 3
4 Input 4
The figure below shows the digital IO port as viewed from the back of the tester.
IO
Connector
Input 0
Power +5 Vdc, 100 mA, max
Input 1
Output 2
Input 2
Output 3
Input 3
Power +5 Vdc, 100 mA, max
Output 0
Not Used
Output 1
Ground
Output 4
Ground
Output 5
3
Examples:
input0 = ReadUserInputStates(1)
The function will get the state of the Input 0.
io1,io2,io3,io4 = ReadUserInputStates(1,2,3,4)
The function returns the values of all four inputs to io1, io2, io3, and io4.
44
Digital Input and Output Functions
SetUserOutputStates
SetUserOutputStates (Easy Touch and 1100 only)
The outputs are capable of sinking up to a nominal 24 volts and 500 milliamps as an
absolute maximum, but 200 milliamps is more realistic. See the easy-wire help system for
example IO circuits. The relation between outselect and the IO connector pin out on the
back of the tester is shown in the table and figure below.
IO
outselect description Connector
1 Output 0
Input 0
2 Output 1 Power +5 Vdc, 100 mA, max
Input 1
3 Output 2 Output 2
Input 2
Output 3
4 Output 3 Input 3
Power +12 Vdc, 100 mA, max
5 Output 4 Output 0
Not Used
Output 1
6 Output 5 Ground
Output 4
Ground
Output 5
3
Examples:
iDigitalOutput0 = 1
iOutputState0 = 0
iDigitalOutput1 = 2
iOutputState2 = 1
SetUserOutputStates (iDigitalOutput1, iOutputState1,iDigitalOutput2, iOutputState2)
The function above will set the Output 0 (pin 5) output on, and Output 1 (pin 6) off.
SetUserOutputStates(6,0)
45
Digital Input and Output Functions
PLC Digital IO
The Cirris CR and CH+ testers do not have a Serial Port for IO functions, but can perform
IO through a PLC connected to the computer running the tester. The CH2 and Easy
Touch Testers also support PLC IO; however, these testers also have their own built-in
Digital IO to support IO control. All Cirris testers require that the PLC must be the Direct
Logic model number DO-05DR PLC. See the topic PLC I/O in your easy-wire help system
for more information on connecting this PLC.
Cirris.GetPLCOutputStates
Cirris.GetPLCOutputStates (CR, CH2, & CH+ only)
The function returns the state the digital outputs on the PLC’s control I/O port. If desired,
you can specify multiple outputs and this function will return their respective states. This
function will return a 1 if the output is energized (sinking low), or 0 if the output is not
conducting. The state of the output port is determined by using the
Cirris.SetPLCOutputStates function or by using Edit I/O Blocks Window in the easy-wire
Editor.
46
Digital Input and Output Functions
Cirris.ReadPLCInputOutputStates
Cirris.ReadPLCInputStates (CR, CH2, & CH+ only)
This function returns the state (energized or inactive) of one or up to all eight digital inputs
on the digital I/O port. The function returns a 1 if the input is energized and a 0 if input is
inactive. Note that depending how the Direct Logic PLC is wired, inputs can be low or high
in their inactive state, and become active with the opposite logic state. The Each input is
specified by an input select number as shown in the table below.
47
Digital Input and Output Functions
Cirris.SetPLCOutputStates
Cirris.SetPLCOutputStates (CR, CH2, & CH+ only)
)
The full format of this function is:
Cirris,SetPLCOutputStates(outnum0, set0, outnum1, set1, … outnum5, set5)
This function sets the digital outputs on the user I/O port to a particular low or high logic
state. This function takes up to six parameter pairs. In each pair, the first parameter
outnum specifies which output to be set. The relation between output numbers and the
labeling on the PLC is shown in the table below. The second parameter, set specifies
whether to set the output on or off. If set is 1 the output will be energized (sinking low); if
0 the output will be turned off (not conducting). Note that the function
Cirris.GetPLCOutputStates allows you to read the state of the outputs.
Examples:
iDigitalOutput1 = 1
iOutputState1 = 0
iDigitalOutput2 = 2
iOutputState2 = 1
SetUserOutputStates (iDigitalOutput1, iOutputState1,iDigitalOutput2, iOutputState2)
The function above will set output 1 (Y1) on, and output 2 (Y2) off.
48
Digital Input and Output Functions
Cirris.GetBuiltInTesterOutputStates
Cirris.GetBuiltInTesterOutputStates (CH2 only)
The function returns the state of the CH2’s digital outputs. If desired, you can specify
multiple outputs and this function will return their respective states. This function will
return a 1 if the output is energized (sunk low), or 0 if the output is off (not conducting).
Each output is specified by its output number, 0 to 9. The state of the output port is
determined by using the Cirris.SetBuiltInTesterOutputStates function or by using Edit I/O
Blocks Window in the easy-wire software
49
Digital Input and Output Functions
Cirris.ReadBuiltInTesterInputStates
Cirris.ReadBuiltInTesterInputStates (CH2 only)
This function returns the state (on or off) of one or up to all ten digital inputs on the digital
I/O port. A 1 is returned if the input is on (high). A 0 is returned if the input is off (low).
Each input is specified by its input number, 0 to 9.
Cirris.SetBuiltInOutputStates
Cirris.SetBuiltInTesterOutputStates (CH2 only)
)
The full format of this function is:
iPassed = Cirris.SetBuiltInTesterOutputStates(outnum0, set0, outnum1, set1,
… outnum9, set9)
This function sets the digital outputs on the user I/O port to a particular low or high state.
This function takes up to ten parameter pairs. In each pair, the first parameter outnum is
an integer select number 0 to 9, which represents the output number. The second
parameter, set specifies whether to set the output on or off. If set is 1 the output is turned
on (sunk low); if 0 the output is turned off (not conducting). This function will return a value
of 1 if successful to iPassed or a value of 2 if unsuccessful. Note that the function
Cirris.GetBuiltInTesterOutputStates allows you to read the state of the outputs.
50
Digital Input and Output Functions
Digital IO Module
Unlike the digital IO port built into most Cirris tester models, this enhanced digital IO
module comes with more voltage options, more inputs and outputs, and more current
giving you additional control of your test process. The Digital IO connector has a 44-pin
D-Sub connector with the following functions:
4 Voltage Rails
The digital IO module has 4 voltage rails capable of drawing a max of 500 mA
combined. They are accompanied by 4 ground pins. The rails have the following
voltages:
• 3.3 VDC
• 5 VDC
• 12 VDC
• 24 VCD
51
Digital Input and Output Functions
1 24 VDC 23 Input/Output 15
2 Ground 24 Input/Output 16
3 12 VDC 25 Input/Output 17
4 Ground 26 Input/Output 18
5 5 VDC 27 Input/Output 19
6 Ground 28 Input/Output 20
7 3.3 VDC 29 Output 21
8 Ground 30 Output 22
9 Input/Output 1 31 Output 23
10 Input/Output 2 32 Output 24
11 Input/Output 3 33 Output 25
12 Input/Output 4 34 Output 26
13 Input/Output 5 35 Output 27
14 Input/Output 6 36 Output 28
15 Input/Output 7 37
16 Input/Output 8 38
17 Input/Output 9 39
18 Input/Output 10 40
19 Input/Output 11 41
20 Input/Output 12 42
21 Input/Output 13 43
22 Input/Output 14 44
52
Digital Input and Output Functions
The digital IO functions are written in the free LUA programming language. For more
information on LUA and scripting, see the easy-wire Scripting manual.
To control the digital IO module, Cirris has created a library of LUA functions called
diomod.lua. The diomod.lua file must be copied to your working directory in order for the
LUA script to have access to the diomod library. This file can be found on cirris.com or
on the flash drive.
diomod.ReadUserInputStates Example
The following example illustrates commands used with lua software to control the digital
IO module.
This function returns the state (on or off) of the digital inputs on the digital IO port. Each
returned input state corresponds respectively to the specified input. The function returns
a 1 if the input is on (high) or a 0 if the input is off (low).
diomod.SetUserOutputStates Example
The full format of this function is:
The outputs are “sink” outputs. This function sets the digital outputs on (sinking) or off
(floating). This function takes up to eight parameter pairs. In each pair, the first
parameter, specifies which output to be set. The second parameter, specifies whether
the output is set on or off. If this parameter value is 0 the output is set on (sinking low); if
1, the output is set off (not conducting).
53
Digital Input and Output Functions
function cmpDIO.test()
end
-- ***************************************************
-- LoadLibrary FUNCTION MUST BE PRESENT IN THE SCRIPT
-- ***************************************************
function LoadLibrary(sLibrary)
if Cirris then
package.path = string.format(“%s;%s?.lua”,
package.path,string.match(debug.getinfo(1).
source:match(“@(.*)$”), “(.-)([^\\/]- %.?([^%.\\/]*))$”))
_G[sLibrary] = require(sLibrary)
Else
dofile(sLibrary..”.lua”)
end
end
54
File Functions
File Functions
Cirris.ChDir
Cirris.ChDir (x:\\directory)
This function changes the current directory to the drive, path and directory specified by the
input string x:\\directory. This allows the drive, path and directory to not have to be
restated in subsequent file functions.
The function also returns two outputs, result and error as shown.
result, error = Cirris.ChDir (x:\\directory)
If the function is successful in making the directory, it returns 1 to result and nil to
error. If unsuccessful, the function returns a 0 to result and a string describing the error
to error.
Example:
iCopyGood, sCopyError = Cirris.ChDir (“c:\\junk”)
The function attempts to make the current directory c:\junk for further file functions. If
successful, 1 will be returned to iCopyGood and nil to sCopyError.
Note: When using Easy Touch Scripting to control an 1100 tester, this command affects
only the current directory of the computer controlling the tester, not the directories in the
embedded memory of the tester.
Cirris.CloseDir
Cirris.CloseDir (handle)
This function closes the current directory that is identified by a handle previously specified
by the Cirris.OpenDir function. The handle input to this function is a string.
Example:
DirHandle=Cirris.OpenDir (“c:\\junk”)
Cirris.CloseDir (DirHandle)
The functions above open and close the directory c:\junk.
Cirris.CopyFile
For example,
Cirris.CopyDir (“c:\\Cirris\\Data”, “c:\\Company\\Data”)
55
File Functions
Cirris.CurrentDir
Cirris.CurrentDir
Returns a string for the value of the current directory. The current directory is set
previously set using the Cirris.ChDir function. This function will also return result and
error as shown in the full function definition below.
result, error, = Cirris.CurrentDir
If the function is successful in making the directory, it returns 1 to result and nil to
error. If unsuccessful, the function returns a 0 to result and a string describing the error
to error.
For example,
Cirris.ChDir (“c:\\junk”)
sCurDir = Cirris.CurrentDir
Cirris.DirExists
Cirris.DirExists (x:\\directory)
Returns 1 if the directory on the given path exists or 0 if it doesn’t.
Cirris.MkDir
Cirris.MkDir (x:\\directory)
Creates a new directory as specified. If the directory given in the path does not yet exist,
Cirris.MkDir attempts to create it. Cirris.MkDir returns 1 if it successfully creates all
necessary directories, 0 if it could not create a needed directory.
56
File Functions
Cirris.OpenDir
Cirris.OpenFileDialog
Cirris.OpenFileDialog
This function opens a dialog box so the user can browse to and select a file. To select a
file the user clicks the file and clicks OK. The function returns the path and name of the
selected file as a string.
Cirris.OpenFolderDialog
Cirris.OpenFolderDialog
This function opens a dialog box so the user can browse to and select a folder. To select
a folder the user clicks on a folder and clicks OK. The function returns the path and name
of the selected folder as a string.
57
File Functions
Cirris.ReadDir
Cirris.ReadDir (handle)
This function provides information on the contents of a directory. The directory must be
referenced by handle. Previous to using Cirris.ReadDir, use the function Cirris.OpenDir to
return handle. The Cirris.ReadDir function is used in a while loop. Each time the function
executes it attempts to read one entry of a directory. The function returns the name of a
file or directory, and returns 0 for a file or 1 for a directory. After reading all of the entries
of a directory, Cirris.ReadDir returns a nil value to the directory name.
Examples:
The code above opens the directory Documents. The Cirris.ReadDir function is used
inside a while loop to read and identify each of the directory entries. Each entry name and
its folder/file designation is added to the string sDirEntries using the Lua Format function.
The MessageBox function is then called to display this string. Each file name will have a 0
displayed next it; each folder will have a 1.
Cirris.RmDir
Cirris.RmDir (directory)
Removes the specified directory.
58
Low Level Function
Critical: While using these function to test complex circuitry, never connect an outside
power supply over 5.5 volts to the testers test points. If you break this rule, you will void
the tester's warranty and damage the tester. If you follow this rule, it is impossible for the
commands listed below to damage the tester.
Sink / Unsink
Example:
result = LowLevelCmd(1,"J1-001", 1)
This example sinks point J1-001.
59
Low Level Function
Turn On Relay
Low Level Function: Turn On Relay (Easy Touch & 1100 only)
)
This low level command allows you to turn on a relay that controls a scanner point. Why
would you turn on a test point relay? The test point relays switch out the analog hardware
on a scanner point and connect the point to the high voltage system. The high voltage
hardware can be used for hipot testing or measuring capacitance. The current source can
be routed through the high voltage system, allowing you to apply current to more than one
point at a time for complex measurements.
Notes:
a. You can turn on as many relays as you want but you have to call this function for each
point. The relay remains on until you turn it off.
b. You cannot directly measure the voltage on a point when the relay is turned on for that
point.
c. It takes time for a relay to turn on. You can turn on a lot of relays and then call Delay
(0.010) to give the relay's contact time to move before performing any measurements.
Example:
result = LowLevelCmd(2, 3, 0)
This example turns off the relay connected to point, J1-003.
60
Low Level Function
Note: Only one point can be connected to the current source at a time. Whenever you
pick a new point, the current is removed from any prior point. This command doesn't
actually turn on the current source but simply connects it to the point you choose. It does
not affect the current source just the current source vector.
Example:
result = LowLevelCmd(3, "J3-001", 1)
This example sources the point, J3-001.
61
Low Level Function
Note: Currently, there is no reason to call this function. It is here for future use.
62
Low Level Function
Set Current
Low Level Function: Set Current (Easy Touch & 1100 only)
This low level command simply turns on/off the current source and sets its value. It does )
not send the current anywhere. Use the SetSourceVector function to send the current
through the normal analog channels or use the RouteCurrentToRelay and
TurnOnRelay functions to send the current through the relays. The input currents given
below are approximate. The actual current (in amperes) is returned in the result.
Example:
fCurrent = LowLevelCmd(5,7)
This example turns on 6 mA of current.
63
Low Level Function
Measure Voltage
Low Level Function: Measure Voltage (Easy Touch & 1100 only)
The greatest accuracy for this low level command will be obtained if at least one of the )
points is at two volts or less with respect to ground. This is always the case if that point is
sunk. See LowLevelCmd 1 on how to sink a point.
If you are using relays to route the current to a point, you cannot directly measure its
voltage using this command. Add an external connection to tie that point to another point
on the tester so you can measure its voltage there.
Note: YOU CANNOT MEASURE ANY VOLTAGE GREATER THAN 5.5 VOLTS.
APPLYING EXTERNAL VOLTAGE TO THE TESTER CAN DESTROY IT.
Example:
fVoltage = LowLevelCmd(6, 3, "J1-001")
This example will return the measured voltage between J1-003 and J1-001 if using an
AHED-64 adapter. The first point given is expected to be the high point similar to the "red"
lead on a voltmeter.
64
Low Level Function
Use the Delay (0.010) command after calling this command to allow time for the current
source to be switched over.
The normal resistance measurement and other functions won't work properly if you forget
and leave the current routed through the relays.
Example:
result = LowLevelCmd(7, 1)
This example will route the current through the relays.
65
Low Level Function
Master Clear
Low Level Function: Master Clear (Easy Touch & 1100 only)
)
Use this low level setting to unsink and turn off relays for all points. It disconnects the
current source from the test points. It does not affect where the current is routed (to
relays).
Example:
result = LowLevelCmd(8)
This example will unsink and turn off relays for all points.
Example:
result = LowLevelCmd(9)
66
Low Level Function
Note: The high current source must only be used for short time periods. Turn it off as soon
as you are done measuring or it can damage the circuit on the high voltage card.
Example:
local fCurWanted = 1.0 – default current to 1 amp
if aCur[1] = = 2 then
fCurWanted = 0.25 – want current at ¼ amp
end
local fCur = LowLevelCmd(12, fCurWanted) – turn current on
local fVolts, err = LowLevelCmd(6, wSenseHi, wSenseLo)
if (err ~= nil) and (err ~= 0) then
error(“Invalid test point(s)”)
end
LowLevelCmd(12, 0) – turn current off
LowLevelCmd(9) – reset tester to default state
This function sets the high current source to ¼ amp. It measures the voltage and then
turns the high current source off. It then resets everything back to a default state.
67
Measurement and Test Functions
This function is used for the CH2 tester. This function has the same use and parameters
as the function HipotNetsTiedToPoints used by the Easy Touch and 1100H Testers. See
HipotNetsTiedToPoints on page 76 for more information.
Cirris.HipotPointMask
This function is used for the CH2 tester, and has the same use and parameters as the
function HipotPointMask used by the Easy Touch and 1100H Testers. See
HipotPointMask on page 80 for more information.
68
Measurement and Test Functions
EPROM
Use this function to talk to an I2C (like 24LC00). See the MicroLan function to talk to
Dallas Memory tokens using the MicroLan protocol. The valid address range for writing to
and reading from is the address range of the eeprom. For example on an eeprom with 8
bytes, the valid range is 1-8. To talk to an eeprom on the scanner test points, some setup
is needed. Connect a 10 K ohm resistor from VCC (pin 8) to sclk (pin 6) and another one
from VCC (pin 8) to sdata (pin 5). Tie pins 1-4 (address & GND) together to establish an
address for the part. Leave pin 7 floating (low) or pull to ground (pin 4).
myInputs myResults
1, GndPt, VCCPt, ClkPt, DataPt Setup nil = OK
OR
Error code
2 Clean up and disconnect nil = OK
from the device. OR
Error code
3, [fromAddress] Read a byte from the nil = OK and returns byte
EEPROM read
OR
Error code
4, toAddress, Data Write a byte to the nil = OK
EEPROM OR
Error code
5, fromAddress, MaxNumChars Read text nil = OK and returns text
read
OR
Error code
6, toAddress, Data Write text nil = OK
OR
Error code
69
Measurement and Test Functions
Example
EEPROM(1, GroundPt, VCCPt, ClkPt, DataPt)
EEPROM(6, 0, "testkd") -- write "testkd" to eeprom
theResult = EEPROM(5, 0, 90) -- read "testkd" (90 chars max) from eeprom
EEPROM(4, 4, ascii("e")) -- replace the "k" with a "e"
theResult = EEPROM(5, 0, 90) -- read "tested" from eeprom
print(theResult)
EEPROM(4, 5, 248) -- write a 248 to location 5
theCharNum = EEPROM(3, 5) -- read the 248 from where "d" once was
print(theCharNum) -- get the non-ascii number
EEPROM(2)
This example sets up the eeprom and then writes "testkd" to the eeprom. It reads back up
to 90 characters maximum, including the "testkd". It then replaces the "k" with an "e" to
form "tested" and again reads from the eeprom. It then writes a byte 248 to location 5 and
then reads it out again from location 5. Finally, it does cleanup setting everything back to
a default state.
70
Measurement and Test Functions
GetCapMeasurement
This function returns the measured capacitance between two points. The points can be
integer values representing system points, or strings representing point labels. Depending
on whether the points are valid, the function returns capacitance and error as shown in
the table below.
capacitance error
If the input points are valid Floating point number representing Nil
the capacitance measurement
If the input points are not valid 0 -99
It is good practice to check that error value is nil before using it in further calculations.
Example:
sPoint1 = "J1-001"
sPoint2 = "J2-005"
fCapacitance, iError = GetCapMeasurement(sPoint1, sPoint2)
if(iError == nil) then
MessageBox(format(“Capacitance between %s and %s is %.2f nF”, sPoint1, sPoint2,
fCapacitance/1e-9))
end
In the example, GetCapMeasurement returns the measured capacitance value between "J1-
001" and "J2-005" to fCapacitance. It displays a message box with the measured
capacitance value.
71
Measurement and Test Functions
GetRelCapMeasurement
Use this function to identify that a shield is in a given position. Cable shields are in close
proximity to other many nets in a cable; hence shields have higher capacitance relative
to the other wires in the cable.
This function measures the capacitance between a test point, which you believe is
connected to the shield, to all other cable nets. This function also measures the
capacitance of another test point that you believe can be used as a reference of a wire in
the cable. Finally, this function divides the shield measurement by the reference
measurement to return a floating point number representing the ratio. For example, if a
shield were five times more capacitive than the reference point, the function will output a
floating point number of about 5. The function also returns value that verifies the
selected shield and reference points are valid.
Example
sShieldPoint = "J1-026"
sReferencePoint = "J1-005"
fRatio, myResult = GetRelCapMeasurement(sShieldPoint, sReferencePoint)
The example above will find the ratio of capacitance of a shield with respect to the
reference point, J1-005. The shield point is a point tied to the shield. The reference point
is used as a point within the shield.
72
Measurement and Test Functions
GetResistanceMeasurement
Example1
myPoint1 = "J1-001"
myPoint2 = "J2-005"
fMeasuredValue, myResult = GetResistanceMeasurement(myPoint1, myPoint2)
The function will return the measured resistance value between "J1-001" and "J2-005" in
fMeasuredValue. The result, myResult, will be nil if there is no error.
Example2
local fStrapRes = GetResistanceMeasurement(VPlusStrap, ConnectingStrap)
if fStrapRes > 1.0 then
MessageBox("AD5P-68A Adapter Not Found")
end
The example gets the measured resistance value to check if the adapter strapping is
correct.
73
Measurement and Test Functions
GetResistanceMeasurement4W
The returned resistance measurement is returned as a floating point number. The input
points point1 and point2 may be either a force or sense points, but each must have its
four wire mate. The input points must be strings representing system points (“35”, “87”),
strings representing labeled test points (“J2-003”, “J3-22”), or a string representing
custom pin labels (“Force1” or “Force3”).
If only one of the input points is not a valid 4-wire point, the function returns 0 to
resistance and -99 to valid. If both points are valid, the function returns nil for
valid. It is good practice to check that valid is nil before using the resistance
measurement in further calculations.
Example
my4WPt1 = "J1-003"
my4WPt2 = "J1-005"
fMeasuredValue, myResult = GetResistanceMeasurement4W(my4WPt1, my4WPt2)
if myResult == nil then
MessageBox(“4W Resistance Value is:”..fMeasuredValue)
end
The function will return the measured four-wire resistance value between "J1-003" and
"J1-005" in fMeasuredValue. myResult will be nil since there is no error.
Frequently you may use the GetPtType and Get4WPairPt functions in conjunction with
this function. See the function GetResistanceMeasurement on the previous page to do
a standard resistance measurement between two test points.
74
Measurement and Test Functions
GetTotalCapMeasurement
This function returns the total capacitance between one or more points specified in
points and all other points of the device under test. The input points is a string with
multiple points being separated by a space. Points can be integer values representing
system points, or strings representing point labels. Depending on whether the points are
valid, the function returns capacitance and error as shown in the table below.
total capacitance error
If the input points are valid Floating point number representing Nil
the capacitance measurement
If the input points are not valid 0 -99
It is good practice to check that value of error is nil before using it in further
calculations.
Example:
sPoints = “J1-003 J1-005”
fCap, iError = GetTotalCapMeasurement(sPoints)
if iError == nil then
MessageBox(format("Point: %s, Cap: %0.1f pF", sPoints, fCap / 1e-12))
else
MessageBox(format("Point/s: %s is/are not valid", sPoints))
end
If the specified points J1-003 and J1-005 are valid, a message box will display the
capacitance between these points and all other points in the device under test. If the
specified points are invalid, a message box will display the invalid points.
75
Measurement and Test Functions
HipotNetTiedToPoint
This function causes hipot to be applied to a single net and returns the leakage
resistance value and the test results of the hipotted net. All points of the DUT outside
the net are held at ground while the net is hipotted. The input of this function is a single
point; however the tester will apply hipot simultaneously to all points that are defined in
the wire list as being connected to the defined point.
The function HipotNetTiedToPoints can perform the same task as this function, or
apply hipot to multiple nets at the same time. Inputs and outputs are identical to both
functions, with the exception that function HipotNetTiedToPoint only allows you to input
a single point. Since HipotNetTiedToPoints is more versatile, we suggest using it
rather than this function. See function HipotNetTiedToPoints for more information.
HipotNetsTiedToPoints
This function causes a high voltage test to be applied to one or more nets. An
equivalent command, Cirris.HipotNetTiedToPoints is used for the CH2 tester. The input
to this function is one or more points. Each point may be an isolated point such as an
unused connector contact, or one point of a larger net on the tested device. If the point
is part of a net, the tester will hipot all points of the net. While a hipot is applied, all other
DUT points are held at ground. This allows a hipot test to ensure the hipotted net or
nets are sufficiently isolated from other nets. The function returns the leakage
resistance in terms of ohms and the test results of the hipotted net or nets.
If you want to use this function to apply hipot to only one or to certain nets in a tested
device, turn off hipot in the test program. This function will apply hipot even with high
voltage testing turned off in the test program. If the optional high voltage parameters for
this function are not specified, the function will use the hipot settings used in the test
program.
You may choose one of three different formats depending on the high voltage testing
complexity and whether the tester has AC voltage capability. The advanced format
allows you to control all the high voltage settings you can control in the easy-wire
software. When using the advanced settings, note that the DW Voltage must be equal
to or higher than the IR voltage. Additionally, the IR voltage must be set sufficiently high
for the tester to measure some IR resistances. Using the test window to try advanced
settings will ensure the settings are valid. The three different formats are as shown on
the following pages.
76
Measurement and Test Functions
Simplified Format
result, measured = HipotNetsTiedToPoints(point1 [point2…,voltage, insulres, dwell,
maxsoak]
Advanced DC Format
result, measured = HipotNetsTiedToPoints(point1, [point2…,voltagetype, DWVvoltage,
DWVcurrent, dwell, IRvoltage, IRinsulres, timegoodfor, soaktime, soakuntilgood])
Advanced AC Format
result, measured = HipotNetsTiedToPoints(point1, [point2…,voltagetype, frequency,
DWVvoltage, DWVcurrent, dwell, IRvoltage, IRinsulres, timegoodfor, soaktime,
soakuntilgood])
Inputs and outputs to these functions are defined in the following tables.
77
Measurement and Test Functions
Inputs continued
78
Measurement and Test Functions
Examples:
This example hipots the net tied to the point, J1-001, using the high voltage parameters in
the test program. The variable iResult will contain the test result.
iResult = HipotNetsTiedToPoints("J1-001")
This example uses the simplified format to hipot the net tied to the custom test point label,
Blue. It uses the inputs which are independent of the settings in the test program. High
voltage Is set 50 volts, insulation resistance to 5M ohms, and duration to 30 seconds. No
soak time was given so it will be set to zero. The variable iResult will contain the test
result and fMeasResis will contain the measured leakage resistance.
iResult, fMeasResis = HipotNetsTiedToPoints("Blue", 50, 5000000,30)
This example hipots the points using optional parameters, which are independent of high
voltage test settings in the test program. A high voltage warning message will display
during the hipot. If an error occurs, a message box will display the error.
local sErr
if iErr == 1 then
sErr = format("Has leakage (%i M ohms)", fRes/1000000)
elseif iErr == 2 then
sErr = "Overcurrent"
elseif iErr == 3 then
sErr = "Dielectric Failure"
elseif iErr ~= 0 then
sErr = format("Unexpected error #%i", iErr)
end
if iErr ~= 0 then
MessageBox(sErr)
end
79
Measurement and Test Functions
HipotPointMask
When high voltage testing is turned on, high voltage is applied to each of the nets
defined in the test program. This function allows you to mask a point that would
normally be high voltage tested in the test program. If you use this function to mask one
point of a net, no other point of the net will have high voltage applied to it during the high
voltage test. Note the CH2 tester uses an equivalent function, Cirris.HipotPointMask.
While you can use this function to subtract points from the tester’s list of points that will
be high voltage tested, you can also use this function to add points back to this list. Note
however, that un-checking the setting Hipot All Adapter Pins (Not just Connection),
means that unconnected test points in the DUT will not be in the tester’s list of points to
be tested. You cannot use this function to mask these points on.
The optional input testpoints is a string of the point or points that can be added to hipot
point list when the input select is 1. On the other hand, testpoints will be subtracted
from the hipot list when select is 0. The input select is an integer value that directs the
function as follows:
If select equals, the function will:
0 Subtract point or points from the hipot list
1 Add point or points to hipot list
2 Subtract all points from hipot list
3 Add all points to hipot list
Note the function can return hipotpoints, a string value of the points to be high voltage
tested. Additionally the function can return invalidpoints, a string of the points from
the hipot list that are invalid because they are not defined for the test. Test points can
be specified by their connector points, or by their test point label.
Examples:
sNewHipotPoint = HipotPointMask (0, J1-013)
Point J1-13 is removed from the tester’s existing list of points to be high voltage tested.
The points that will be tested are returned to the string variable sNewHipotPoint.
80
Measurement and Test Functions
LearnCable
Use this function to learn a cable that is connected to the tester. The cable is learned as
a wirelist and saved to the tester’s embedded memory.
The function can return two outputs. The output result, is a text string containing
messages. The output error is a text string containing errors.
To control learn settings, the following optional inputs may be used to the function:
1, filename String filename specifies a test wire list file for the learned
cable. This name cannot be the same as the wirelist currently
in memory.
2, description String description specifies a description for the cable.
3, testparameters String testparameters specifies the low and high voltage
parameters used for the test.
4, learncomponents Integer learncomponents specifies the components types
learned in the test. 1 = resistor, 2 = capacitor, 4 = diode,
8 = twisted pair, 11 = all but diodes, 15 = all
8, noconnectlearn If noconnectionlearn is the integer 0, the learn will not occur if
no connections are found. If greater than 0, the learn will
happen even if no connections are learned.
If no optional inputs are given, the function will learn a cable with the following test
settings:
filename = untitled.wir
cable description = last learned
connection resistance = 10
lv insulation resistance = 100k
hipot = off
components to learn = no
Learn with event or custom component scripts = no
learn if no connections = yes
81
Measurement and Test Functions
Examples:
sResultMessage, sErrorText = LearnCable (1,”batch1.wir”, 4, 1)
This example will learn the cable and save the wirelist as batch1.wir. The cable will be
learned with the default low voltage and high voltage parameters. It will also learn
resistors.
MicroLan
Use the MicroLan function to talk to Dallas Memory tokens using the MicroLan protocol.
See EEPROM to talk to an I2C like a 24LC00.
82
Measurement and Test Functions
Examples:
The following example sets up the Dallas DS1993 (or DS1994) chip. It then checks to
see if it is present. If it is present, it writes the text "Hello There Fred" and reads it back
out.
The following example verifies the chip is attached to the tester, reads the product code
identifying the part type and the first byte of the product serial number. See the Dallas
Semiconductor product documentation for the bytes to send to your components to get
the data you want out.
83
Measurement and Test Functions
TestWirelist
This function performs one of the three tests on the wirelist of the loaded test program.
The input, testnum, is an integer number that identifies which of the three tests to
perform as shown in the table below.
testnum test
3 LV test only
4 HV test only
255 LV, Components, & HV tests
The function returns result, an integer that identifies the results of the test as shown in
the table below.
result test
0 Test Passed
3 LV tested failed (includes components test)
4 HV test failed
If the test fails, you can also use the function TWLGetErrorText to return the error text
that relates to the value of result.
Use the function UseChildWirelist to load the child wire list before calling TestWirelist to
test. When TestWirelist is used to perform a high voltage test, the high voltage test is
performed on all the nets. If you want to hipot one or selected nets, use the functions
HipotNetTiedToPoint or HipotNetTiedToPoints. The TestWirelist function does not affect
SPC Data Collection or the cable test counters.
Examples:
local iTestVal = TestWirelist(3)
The function will perform the low voltage and components test on the current wirelist.
84
Measurement and Test Functions
UseChildWirelist
result = UseChildWirelist(wirelist)
This function has two formats. In the format shown above the UseChildWirelist function
loads a wire list from memory or disk. The function TestWirelist can then be called to test
the wire list. The input wirelist is a string that defines an optional path and the wire list
name. The function returns 0 to result to indicate the wire list loaded successfully, or a
nonzero integer if the wire list failed to load.
UseChildWirelist(stop)
In this format, the function will stop using the wire list, and depending on the integer
value of stop, either leave the wirelist in memory or free the wire list from memory as
shown below.
stop Description
0 Stop using the current child wire list but leave it in memory.
1 Stop using the current child wire list and free the memory.
This function allows you to load multiple child wire lists into memory where they can be
quickly recalled and used at one at a time. After finishing using all the wire wirelists,
remove all of the wire lists from memory by calling this function again.
Example 1
iCouldntLoad = UseChildWirelist(sChildWLFilename)
This example will load the named wire list contained in the string, myChildWLFilename and
make it the current wire list running on the tester.
85
Measurement and Test Functions
Example 2
TestArray = {"test1.wir", "test2.wir", "test3.wir" }
iNumTests = 3
iTesting = 1
while iTesting == 1 do
iButtonNum = MessageBox("Test all", "Yes", "Done")
if iButtonNum == 1 then
iTestIndex = 0
while iTestIndex < iNumTests do
MessageBox(format("Ready to test # %i", iTestIndex+1))
-- display the test number so user can get ready
iLoadFailed = UseChildWirelist(TestArray[iTestIndex])
-- make it current, loading wirelist from disk or memory as needed
if iLoadFailed ~= 0 then
MessageBox("Couldn't load wirelist")
else
iTestResult = TestWirelist(255) -- perform all tests
if iTestResult ~= 0 then
sErrors = TWLGetErrorText(iTestResult)
MessageBox(sErrors) -- Show them what failed
end
UseChildWirelist(0)--Leave in memory, to get quickly next time
end
end
else
iTesting = 0 –- Done, will cause tester to exit loop
end
end
iTestIndex = 0
while iTestIndex < iNumTests do
UseChildWirelist(TestArray[iTestIndex]) -- make it current
UseChildWirelist(1) -- free it from memory
end
This example will loop through the child wirelists: test1.wir, test2.wir and
test3.wir. Test1.wir will be loaded and if no errors occur during loading, testing will
be done using test1.wir. After testing, the child wirelist will be left in memory for
quick access in the future. The script will continue for each of the child wirelists. At the
end of loading and testing all the child wirelists, each child wirelist will be loaded and
freed from memory.
86
Printer Functions
Printer Functions
Notes on Printing
When formatting strings to print, the Cirris print functions in this section allow for either
the c-like or decimal escape codes such as those in the following table:
Refer to the 5.1 Lua Manual for more information on formatting strings.
Cirris.EndPrintJob
Cirris.EndPrintJob()
Ends the print job. Used after Cirris.StartPrintJob and Cirris.Print.
87
Printer Functions
Cirris.GetPrinterNameByIndex
Cirris.GetPrinterNameByIndex(number)
This function is useful to find the exact name of a local Windows printer or a network
printer with its server path. The exact printer name is required for the Cirris.SetPrinter
function, which is used to direct printing to a printer other than the default printer.
Example:
iNumberOfPrinters = Cirris.GetNumPrinters()
printer_names = ""
for i=0, iNumberOfPrinters-1 do
printer_names = printer_names..i..". "..Cirris.GetPrinterNameByIndex(i).."\n"
end
MessageBox("~Cirris.Print~".."Available Printers:\n"..printer_names.."\n")
The example above uses the function GetNumPrinters to find the number of printers,
and then uses the function GetPrinterNameByIndex to make a string of printers that are
then displayed using the message box function.
Cirris.GetNumPrinters
Cirris.GetNumPrinters()
Returns the number of Windows printers that are available to the tester. The number of
printers is returned as an integer, which can then be used in conjunction with the Get
PrinterNameByIndex to return the printer names.
Cirris.NewPage
Cirris.NewPage [(immediate)]
Starts a new print page. Subsequent data to print will be on the new page. If the
optional input immediate is 1, the function immediately causes the printer to output the
current page. Any data previously sent to printer will print on this page. If immediate is
not used or is 0, the printer waits until Cirris.EndPrintJob is called to print the page.
88
Printer Functions
Cirris.Print
Cirris.Print (string)
Outputs a string to the print spool. The function Cirris.EndPrintJob will cause the string
to be printed. The string can include the ASCII text to be printed, and escape codes
such as \n or \f to be applied to the string.
The full function definition is shown below. Note that three outputs can be returned.
number, status, error = Cirris.Print (string)
The output number identifies the number of characters sent to the print spool; status is
and integer that identifies the printer state (see
Printer Status Codes on page 87); error is a string that describes a print error.
Cirris.SetPrinter
Cirris.SetPrinter (name)
Selects the printer that will be used to print the subsequent print job. The input name is a
string that must exactly match a local Windows printer name or network printer name
with its server path. Use the function Cirris.GetPrinterNameByIndex to get the exact
system names of printers.
Cirris.StartPrintJob
Cirris.StartPrintJob()
Tells the print driver to start spooling the print job. This function will direct printing to the
Windows default printer, or to the printer selected by the function Cirris.SetPrinter. The
Cirris.StartPrintJob function is always followed by Cirris.Print and Cirris.EndPrintJob
functions.
The function has no inputs, but can return two outputs as shown below.
status, error = Cirris.StartPrintJob()
The output status is an integer that identifies the printer state (see
Printer Status Codes on page 87); error is a string that describes a print error.
89
Printer Functions
SendTextToParallelPrinter
SendTextToParallelPrinter(string [,return])
This function has been preserved so that scripts previously written for the Touch 1 and
1100 testers can be used with Easy Touch Scripting. When run in the Touch 1 and
1100 testers, the function would send a string to a parallel printer. However now when
used with Easy Touch scripting, this function sends the string to the Windows default
printer’s print spool, not the parallel port on the tester. The string can include the ascii
text to be printed, and escape codes such as \n or \f to be applied to the string.
There are a few notable differences when using this command with a modern printer as
opposed to a parallel printer. When sending a string to a parallel printer, the printer
prints immediately. On a modern printer no text is printed until a form feed (\f) is
received. Also, parallel printers accepted the escape code \r (return to beginning of line)
to overprint text at the beginning of a line. However, modern printers do not support this
feature and will replace, not overprint, existing text when a \r is used. Additionally some
parallel printers do not return to beginning of a line when a new line code (\n) is
received. Windows printers return to the beginning of a line when a new line code is
received.
This function allows an input return. If return is non zero, a carriage return (\r) is
always added with a new line code (\n). This setting was used to ensure a parallel
printer would return to the beginning of a line when it received a new line code (\n).
The output number, is an integer representing the number of the characters that were
printed. The function also returns an integer to status. This integer identifies the
printer’s status as defined in printer status code table on page 87.
Examples:
sTextToPrint = "Text string to be printed"
iNumCharsPrinted, iStatus = SendTextToParallelPrinter(sTextToPrint)
The function will output "Text string to be printed" to the default printer.
iNumCharsPrinted will contain the number of characters printed and iStatus will contain a
number describing the current status of the printer.
SendTextToParallelPrinter("GOOD CABLE\f")
The function will cause "GOOD CABLE" to be printed on the default printer.
90
Test Information Functions
Get4WPairPt (point)
This function determines if a given point is a four-wire pair point. If the point is a four-
wire point, the function returns a string containing the label for the point. If not, or if the
function is unsuccessful, the function returns nil. The point can be specified as an
integer value representing the system point, or a string representing a point label.
Example:
iPinNumber = 3
testPoint = Get4WPairPt(iPinNumber)
if testPoint == nil then
error(iPinNumber .. “ is not a part of a 4W pair)
end
The RESULT, testPoint, will contain the label text if it is a fourwire pair point or nil if it is
not. If it is not a four-wire pair point, a message box listing the point will be displayed.
GetHardWareVersion
GetHardWareVersion()
This function returns the hardware version running on the tester. There are no inputs to
this function. The version is returned as a string.
GetProbedPin
GetProbedPin ( )
Use this function to get the number of the test point of the currently probed pin.
GetRawPointNum
GetRawPointNum (label)
This function returns the system pin number of a custom label. System pin numbers can
range be 1 and 1024 depending on the size of your test system. If the label string is
invalid, the function returns nil. If no input is supplied, this function returns a description
of itself.
Examples:
sLabelText = “GROUND”
iPinNumber = GetRawPointNum(sLabelText)
The function will return the pin number in iPinNumber for the GROUND custom label.
91
Tester Information Functions
GetPtType
GetPtType (point)
This function returns a value to identify whether a given point is Stress High or Stress
Low. Half of the test points on the tester can be used to supply current from the high
current source in the tester. Stress High is used to supply the current and Stress Low is
used to sink the current. This function is used ONLY for commands dealing with four-
wire resistance measurement and the high current source.
GetTimeAsText
GetTimeAsText (select)
This function returns current tester time information as a text string. The returned time
information is determined by the integer input used as shown below. See also the
related function GetTimeasInteger.
92
Tester Information Functions
GetTimeAsInteger
GetTimeAsInteger (input)
This function returns current tester time information as an integer. The type of returned
time information is determined by the input number as shown below. See also the
related function GetTimeasText.
GetSystemInfoAsText
GetSystemInfoAsText (select)
This function returns system information about the tester as a string. The system
information that is returned is determined by the integer value of select, as shown in the
table below.
returned tester information select
Tester serial number (8 characters) 1
Login name that was used to log into the tester 2
Software version of the tester 3
Hardware version of the tester 4
Number of system test points 5
Maximum scanner voltage of the tester 6
Tester type 7
WiresAttached
WiresAttached ()
Use this function to determine if a cable is present. It checks only the
adapters/connectors listed in the currently loaded test. The function returns nil if the
tester does not sense a wire connection, and 1 if a connection is sensed. There are no
inputs to this function.
93
Test Information Functions
Cirris.BadCount
Returns the total of assemblies tested bad in all test runs.
Cirris.CableID
Cirris.CableID
Returns the cable ID for the cable being tested. For cable ID’s to be recorded, a method
for serial numbering must be selected under the Test Defaults Tab in the Test Editor.
Cirris.GetAdapters
This function returns information on the adapters involved with a test. There are three
modes in which this function can be called as detailed below:
Mode Mode Description Number of Return Value
Return Descriptions
Values
Learn – Performs a “Learn” operation and
Number of
discovers all adapters attached to the tester
0 1 Learned
and then returns the number found (only used
adapters
in EVT script, event 1)
Get Index – Returns the position, signature,
Position,
and strapping of the adapter at the index
1 3 Signature,
specified by the second parameter to the
Strapping
function call (first adapter is at index 0)
Get Count – Returns the number of attached
adapters as determined by the loading of the Number of
2 1
wirelist (i.e. only adapters specified in the verified adapters
wirelist will be considered)
The Learn mode can only be called in an event script triggering upon event 1. This is
because the “Learn” operation performed by GetAdapters will erase test state data and
will cause the error “Not Ready to Test” when the test continues to execute after the Lua
call. Calling GetAdapters during event 1 is allowed because it occurs before the test is
initialized.
To get adapter information from a component script or other event number, use the Get
Count mode to get the number of adapters available.
After calling GetAdapters in either Learn or Get Count mode, the function can be called
94
Test Information Functions
in Get Index mode with a second parameter (index) in order to get information on a
specific adapter. The index provided must be in the range of 0 to (AdapterCount – 1)
where AdapterCount is the value returned from GetAdapters in Learn or Get Count
mode.
Example:
The example above could be called in a component script to print out all the information
for adapters used in the test.
95
Tester Information Functions
Cirris.GoodCount
Cirris.GoodCount
Returns the number of cables that were tested good in the current test run.
Cirris.LotID
Cirris.LotID
Returns the Lot ID for the current test run. For Lot ID to be recorded, the Enter Lot ID
option must be checked under the Set Test Defaults Tab of the Test Editor.
Cirris.RunBadCount
Cirris.RunBadCount
Returns the number of cables tested bad in the current test run. A test run begins when
a test program is loaded and the first test completes, and ends when the test program is
closed.
Cirris.RunGoodCount
Cirris.RunGoodCount
Returns the number of cables tested good, in the current test run. A test run begins
when a test program is loaded and a first test completes, and ends when the test
program is closed.
Cirris.RunNumber
Cirris.RunNumber
Returns the number of the current test run. A test run begins when a test program is
loaded and the first test completes, and ends when the test program is closed.
Cirris.RunTotalCount
Cirris.RunTotalCount
Returns the number of all cables tested, good or bad, in the current test run. A test run
begins when a test program is loaded and a first test completes. A test run ends when
the test program is closed.
Cirris.StationID
Cirris.StationID
Returns the Station ID number. This is a unique number that that identifies the tester or
test station. The Station ID number is generated when the Cirris easy-wire software is
installed.
96
Test Information Functions
Cirris.TotalCount
Cirris.TotalCount
Returns the total count of all cables tested in all test runs. The total count continues to
accumulate for any test that completes until the total counts are cleared in the test
window
GetCableStatus
This function returns the good or bad status for the cable tested. The function has no
inputs. If the cable status is good 0 is returned; if bad, -99 is returned.
Example
if GetCableStatus() ~= 0 then
iNumberBadCables = iNumberBadCables + 1
end
The integer, iNumBadCables, will be incremented if the cable test result is bad.
GetComponentCount
GetComponentCount ()
This function returns an integer value of the number of components in the loaded Test
Program. Components include custom components, resistors, diodes, capacitors and so
forth. The function has no inputs.
Example:
iCount = GetComponentCount()
MessageBox(“Number of components = ”..tostring(iCount))
This example will display a message on the tester’s screen that contains the number of
components in the current wirelist.
97
Tester Information Functions
GetComponentDetails
98
Test Information Functions
GetErrorSignature
This function returns the error signature for a bad cable as a string. If a cable is good,
this function returns the cable signature as a string. There are no inputs to this function.
Example
if GetCableStatus() == -99 then
sErrorSig = GetErrorSignature()
MessageBox(sErrorSig)
end
This example will output the error signature to the screen if the cable tested was bad.ple,
"8062B5-6F8NO" would be displayed on the screen.
GetErrorText
GetErrorText ( )
This function returns error text on cables that have tested as bad on the tester. This error
text is the same error text displayed on the error screens during cable testing. If the
cable is not attached, the errors returned for this function are the same as the errors for
SPC data collection. If the cable is still attached, the errors returned for this function are
intermittent or low voltage errors. There are no inputs to this function. If the cable tests
as good, the function returns an empty string, "".
GetNumberTested
This function returns the counts of the cables tested (Total, Good, and Bad) in the
current test run. These are the same counts displayed in the Test Window on the
tester. Each input number will return a different count type in the table below. If the
function has no input, it will return a description of itself.
99
Tester Information Functions
GetPinLabel
GetPinLabel (pin,[select])
This function returns a default or custom label for a raw system pin number. Pin
numbers (test points) are between 1 and 128 for a base tester with no addons, between
1 and 256 for a tester with one addon, and so forth. If the function has no input, it
returns an error describing the function.
returned label (string) pin (integer) select (integer)
Default Label assigned to the raw A raw test point number. Any integer greater equal
system test point. such as 56 to or greater than one.
For example, “J2-024”.
Custom Label assigned to the A raw test point number. Not used
raw system test point For example, 56
For example, “Red Wire”
Example
sCustomLabelText = GetPinLabel(25)
The function will return the custom label text assigned to pin number 25 as a string in the
variable sCustomLabelText.
iPinNumber = 5
iReturnDefaultLabel = 1
sDefaultLabel = GetPinLabel(iPinNumber, iReturnDefaultLabel)
The function will return the default label format for pin number 5 because
iReturnDefaultLabel is set to one. It returns a string such as J1-005 in
sDefaultLabel.
100
Test Information Functions
GetWirelistInfoAsText
Use this function to get text information on the loaded test program. Each input number
will return different information about the test program.
Examples:
sWirelistText = GetWirelistInfoAsText(1)
The function returns the current wirelist filename as a text string in, sWirelistText. For
example, sWirelistText = "TESTFILE.WIR".
101
Tester Information Functions
sCableDescription = GetWirelistInfoAsText(3)
The function returns the cable description of the current wirelist as a text string in
sCableDescription. For example, sCableDescription = "Cable for batch 10".
sCableSignature = GetWirelistInfoAsText(5)
The function returns the cable signature of the current wirelist as a text string in
sCableSignature. For example, sCableSignature = "5760A5-6F0Z2".
sLowVoltSettings = GetWirelistInfoAsText(10)
The function returns the low voltage settings as text with each parameter on a separate
line in sLowVoltSettings. For example, sLowVoltSettings =
"CONNECTION RESIS 2.00 K ohm
LV INSULATION RESIS 6.00 K ohm"
sWirelistLabels = GetWirelistInfoAsText(14)
The function returns each label as a text string on a separate line in sWirelistLabels.
For example, sWirelistLabels =
"J1-001 = BLUE
J1-002 = RED
J5-006 = GREEN"
functionDescription = GetWirelistInfoAsText()
The function returns the function description as a text string in functionDescription.
102
Test Information Functions
IsSPCDataCollectionOn
Example:
iDataCollectionOn = IsSPCDataCollectionOn()
iDataCollectionOn will contain a zero if SPC data collection is OFF in the current
wirelist or a one if SPC data collection is ON in the loaded test program.
TWLGetErrorText
error = TWLGetErrorText(result)
This function returns a text string, error, that describes an error from the last test after
the function TestWirelist was called. The function TestWirelist function returns result
which is used as an input to TWLGetErrorText. Using TWLGetErrorText is the only
reliable way to get error text when testing wirelists using TestWirelist.
Example:
iTestVal = TestWirelist(255) -- 255 selects LV, component and HV test
if iTestVal > 0 then -- error are greater than 0
sErrText = TWLGetErrorText(iTestVal)
end
This example will get the error text for the failed wirelist test.
WiresAttached
WiresAttached()
The WiresAttached function determines whether a cable is present. It checks only the
adapters listed in the currently loaded wirelist. This function has no inputs. The function
returns nil if nothing is attached, or a 1 one or more connection is sensed.
Example:
iAttached = WiresAttached ()
iAttached will contain nil if no wires are attached, or 1 if wires are attached.
103
User Interface Functions
If the input text contains a line feed code (LF) by itself, this function replaces it with a
carriage return and a linefeed code (CRLF).
In Easy Touch Scripting the legacy Cirris function GetWrappedText behaves identically
to the Cirris.GetWrappedText function. Note that previously a third input allowed the
legacy GetWrappedText function to control whether linefeed codes would be replaced
with carriage return line feeds. If used this input now ignored.
Example:
sWrappedText = GetWrappedText(sTextToWrap, 80)
The function returns the text wrapped at 80 characters per line as a string in
sWrappedText. The text will be left justified.
Cirris.HideBackgroundImage
Cirris.HideBackgroundImage
This function closes the background image file previously displayed using
Cirris.ShowBackgroundImage function. The Cirris Test Window and other open
application windows will again be visible on the test monitor.
104
User Interface Function
Cirris.PlaySoundFile
This function plays a sound file (.wav) on the PC controlling the tester. The string
soundfile specifies the image file name and path.
Cirris.PressDoneButton
Cirris.PressDoneButton
This function effectively presses the Done button in the test window while in a script.
This command allows event script that could be in a mode to run repeatedly to exit.
Cirris.ShowBackgroundImage
105
User Interface Functions
DialogCheckBtn
See the example dialog box for the DialogOpen function on the next page. The code
below would identify which button is pushed for the example dialog box.
DialogClose
DialogClose (handle)
Closes a dialog box identified by the input number. This function is used along with the
functions DialogOpen and DialogCheckBtn. The script is still running when a dialog box
is displayed on the screen unlike a message box. Because operations are still running,
any tester pop-ups will display on top of a dialog box. This function is used to clean up
memory. For every DialogOpen function there should be a DialogClose function.
106
User Interface Function
DialogOpen
DialogOpen
handle = DialogOpen ([~title~..]message [, button1] [, button2] … [,sbutton6])
The DialogOpen function displays a dialog box containing custom text and up to six
dialog buttons. This function also returns a handle to identify the dialog box. This
handle is used with the DialogCheckBtn and DialogClose functions. The dialog box will
not have a default CANCEL button if no other custom buttons are created. The script is
still running when a dialog box is displayed on the screen unlike a message box.
Because operations are still running, any pop-ups from the tester will display on top of
these dialog boxes.
For example, the following statement creates a dialog box like the one below
iDia = DialogOpen ("~Wire Color~".."What color is the wire?", "Red", "White”, “Green”)
MessageBox
MessageBox
This function displays a message box on the tester’s display to display a message to the
operator. Up to six buttons can be displayed on the message box to allow a selection.
Unlike dialog boxes, the tester and script do not continue to run when a message box is
displayed. The full format for this function is as follows:
107
User Interface Functions
Examples:
108
User Interface Function
PlaySound
Example:
iPitch = 300
iDuration = .5
iVolume = 100
PlaySound(iPitch, iDuration, iVolume)
This example will play the sound for 500 milliseconds at 300 Hz at full volume.
PromptForUserInformation
PromptForUserInformation
This function displays a user prompt window on the tester and returns the valid user
entry. The prompt window can receive user entry that is alphanumeric, numeric, or
“password”. When the password entry is used, alphanumeric entry is accepted, but
asterisks hide the operator’s entry characters. Numeric entry accepts only integers. At
the bottom of every prompt window an OK and CANCEL button. The full format for the
function is as follows:
entry = PromptForUserInformation(type, firstline, secondline, maxchar[, initial])
Inputs to this function are described in the table below.
Input Description
type An integer value that defines the type of user input.
1 = alphanumeric
2 = numeric (integers)
5 = password
firstline String of text - up to 30 characters - for the first prompt line.
secondline String of text - up to 30 characters - for the second prompt line.
maxchar Integer of the maximum number of characters the user can enter. The
range for this value is 1 to 30.
initial Contains an initial value displayed in the prompt entry box. An
alphanumeric string or an integer depending the value of type
109
User Interface Functions
The function will return the text the user enters to entry, or if the user presses Cancel,
the function returns nil to entry. Always test for the value of nil and replace it with a
valid string so subsequent routines will not break when they expect a string
Example:
sInput1 = PromptForUserInformation(1, "Enter the assembly part number", "five digit extention", 10,
"80-");
110
1100 Embedded File Functions
Many scripts were written with Cirris Scripting functions designed to run internally to
Cirris 1100R and 1100H testers. Many of the functions below are the similar equivalent
to the Cirris Scripting functions designed for controlling files internally to the tester. To
differentiate many of these functions from the previous scripting functions an underscore
“_“ has been added at the beginning of the function’s file name. For example the first
function described below, _appendto has the previous similar function, appendto.
Therefore, if you want to use a script written with Cirris Scripting functions for internal file
control, you will have to do one of two things. You can change the functions used in the
script to the new files names, or you may make an argument statement at the beginning
of the script file equating the old function file name with the new. For example,
appendto=_appendto will make the new internal function _appendto take the place of the
previous appendto function.
_appendto
This function opens a file from the 1100 internal memory and returns a handle for the
file. If no file is opened, nil is returned to the handle. If the function is unsuccessful, a
separate error message is also returned. Use this function when you want to add
something to the file. This function will not erase the contents of a file. This function
does not close the current output file so when done use the _closefile or _writeto
functions to close the file.
Example:
serialNumFile, sErrMsg = appendto(“c:\\cableser.dat”)
write(“Serial Number: 12345678”)
writeto() -- This closes the file
Returns the file handle in serialNumFile if the file “cableser.dat” opens successfully.
If it fails opening the file, it will return a nil in serialNumFile and an error string in
sErrMsg. The write function will write to the file and the writeto function will close
the file.
111
1100 Embedded File Functions
CopyEmbeddedFileToPc
Example:
sCopyErrror = CopyEmbeddedFileToPc (“lastlrnd.sys”, “c:\\myfolder\\last.wir”)
In this example the last learned file from an 1100 tester, lastlrnd.sys is copied to a
new file name last.wir in the folder my folder on the PC.
_copyfile
This function copies a source file to a destination file within the 1100 internal memory. If
there is a copy error, its description is returned.
Example:
_copyfile (“test1.wir”, “test1.bak”)
CopyPcFileToEmbedded
112
1100 Embedded File Functions
DirUtils
This function can perform directory services for the 1100 embedded memory. These
services include changing the current directory, displaying the current directories
contents, and getting the current directory’s path. The table below shows the
relationship between the inputs of this function and returned directory information.
New current directory’s path is 1 String containing the directory path that
returned as a string, or nil if will be the current directory.
unsuccessful.
Contents of the current directory 2 String containing a linefeed delimited list
of the specified file type returned of file types to display.
as a string, or nil if unsuccessful.
Examples:
“*.wir” or “*.*” or
“*.wir\n*.lua\n*.evt” or
“*.rpt\n*.cmp”
default: “*.*”
Current directory’s path returned 3 Not used
as a string, or nil
Example:
sCurDir = DirUtils(3)
sResult = DirUtils(1, sNewDir)
sDirContents = DirUtils(2,”*.wir”)
sResult = DirUtils(1, sCurDir)
This example stores the original directory path in sCurDir. The current directory then
becomes the directory contained in the string sNewDir. All the wirelist files in the
directory and their available descriptions are then retrieved into sDirContents before
changing back to the original directory.
113
1100 Embedded File Functions
_openfile
This function opens a file in the mode specified in the string mode. It returns a new file
handle, or, in case of errors, nil plus a string describing the error. Potential values of
mode are defined as follows:
mode description
"r" read mode
"w" write mode
"a" append mode
"r+"; update mode, all previous data is preserved
“w+” update mode, all previous data is erased;
"a+" append update mode, previous data is preserved, writing is only allowed
at the end of file
_read
This function reads a file according to a read pattern. If you call the function without
readpattern, it defaults to reading the next line or the first line for the first read. The
function returns a string containing the characters read, or a nil if it fails to read anything.
Previous to using the read function, the file must be opened using the _readfrom
function. Use the function, readfrom, to close the file when finished reading. Potential
read patterns are described below.
readptattern description
“*.*” Returns the next character or nil on end of file.
“.*” Reads the entire file.
".*" Returns the next line without the linefeed or nil on end of file. This
is the first line when reading a file for the first time. You do not
have to type in this default pattern, just call the function without
using any input.
"[^\n]*{\n}" Returns the next word skipping spaces if necessary or nil on end
(default pattern) of file.
"{%s*}%S%S*" Returns the next integer or nil if the next characters are not
integers.
"{%s*}[+-]?%d%d" Append update mode. Previous data is preserved. Writing is
only allowed at the end of file.
114
1100 Embedded File Functions
115
1100 Embedded File Functions
_readfrom
Use this function to open or close a file from 1100 embedded memory. The path should
be included in the filename. When used to open a file, the function returns a file handle.
If the function fails to open a file, it returns a nil, and a string describing the error. When
this function is called without a filename, it closes the file.
Example:
sFilename = “c:\\cable550.wir”
canReadFile, sErrMsg = readfrom(sFilename)
if (canReadFile ~= nil) and (sErrMsg == nil) then
local sFirstLine = read
local sSecondLine= read
readfrom ()
end
This example combines the read function with the readfrom function. It will return the file
handle in canReadFile if it successfully opens the cable550.wir file. If the function fails, it
will return a nil in canReadFile and an error string in sErrMsg. If the file opens, the first
line will be read into the string sFirstLine using the read function. The second line will
be read into the string, sSecondLine using the read function. The file is then closed
calling the function readfrom again.
_remove
This function deletes the file with the given name in 1100 embedded memory. If this
function fails, it returns nil, plus a string describing the error.
Example
sFilename = "temp.wir"
error, sErrMsg = remove(sFilename)
The function removes the file "temp.wir”. If the function should fail, it will return a nil to
error and an error string such as "No such file or directory" in sErrMsg.
116
1100 Embedded File Functions
_rename
This function to renames a file in 1100 embedded memory. If the function fails to
rename the file, it returns a nil, plus a string describing the error.
Example:
sOldFilename = "c:/temp.fil"
sNewFilename = "c:/values.fil"
error, sErrMsg = rename(sOldFilename, sNewFilename)
The function will rename the file, temp.fil to values.fil. If the function fails, it will
return a nil in error and an error string in sErrMsg.
_seek
In case of success, the _seek function returns the file position, measured in bytes from
the beginning of the file. If the call fails, it returns nil, plus a string describing the error.
The default value for base is cur, and for offset is 0. Therefore, the call _seek(file)
returns the current file position, without changing it; the call seek(file, "set") sets the
position to the beginning of the file (and returns 0); and the call seek(file, "end") sets
the position to the end of the file, and returns its size.
_write
117
1100 Embedded File Functions
_writeto
The other use of this function is to close the current output file. When a file is opened it
becomes the current output file until it is closed or another file is opened. To close the
current output file use this function without a filename.
Example
sFile = “c:\\storage.txt"
iCanWriteFile, errMsg = _writeto(sFile)
if iCanWriteFile then
_write("Company XYZ")
_writeto() -- Close the file
end
In this example the function writeto will return the file handle in iCanWriteFile if it
successfully opens the storage.dat file. If it fails, it will return a nil in iCanWritefile and
an error string in sErrMsg. The function _write, writes the string, Company XYZ, to the file
and _writeto then closes the file.
118
Preserved Lua 3.2 Functions
Easy-wire scripting uses Lua version 5.1. However scripts that executed within the
Touch1 and 1100 testers were written in Lua version 3.2. Some Lua 3.2 functions have
become obsolete in Lua 5.1. To allow you to more easily run the older 3.2 Lua scripts,
the functionality of these obsolete functions is preserved in Cirris easy-wire Scripting.
Preserved Lua 3.2 New Lua 5.1 Preserved Lua 3.2 New Lua 5.1
functions functions functions functions
abs math.abs. log10 math.log10
acos* math.acos max math.max
ascii string.byte. min math.min
asin* math.asin mod math.fmod
atan* math.atan pi math.pi
atan2* math.atan2 pow math.pow
ceil math.ceil rad math.rad
cos† math.cos random math.random
cosh† cosh.cos randomseed math.randomseed
date os.date sin† math.sin
deg math.deg sinh† math.sinh
execute os.execute sort sable.sort
exp math.exp. sqrt math.sqrt
getn table.getn strbyte string.byte
ldexp math.ldexp strchar string.char
log math.log. strfind string.find
floor math.floor strlen string.len
foreach table.foreach strlower string.lower
foreachi table.foreachi strrep string.rep
format string.format strsub string.sub
frexp math.frexp strupper string.upper
gsub string.gsub tanh† math.tanh
Idexp math.idexp tinsert table.insert
log math.log tremove table.remove
* This function assumes an angle is specified in terms of degrees, whereas its replacement assumes an angle
in terms of radians.
† This function returns an angle in terms of degrees, whereas its replacement Lua 5.1 function returns an
angle in terms of radians.
119
Unsupported Cirris Functions
The following scripting functions may have been used in scripts executed within the
Cirris Touch1 and 1100 testers, but are no longer supported in Easy Touch Scripting.
Unsupported Notes
Function
appendto see io.output. You can use _appendto for 1100 embedded
memory files.
remove You can use “_remove” for 1100 embedded memory files.
rename You can use “_rename” for 1100 embedded memory files.
Seek Use “_seek” for embedded files.
remove
rename
call See pcall and xpcall.
cleardirectory See os.remove.
copyfile See the Lua 5.1 functions io.input, io.output, io.open, and
io.write. You can use _copyfile for 1100 embedded memory
files.
Dofile
GetButtonPress
LoadWirelist
LuaError
openfile You can use _openfile for 1100 embedded memory files.
outtextxy
read You can use _read for 1100 embedded memory files.
ReadBlockFromSerial
readfrom You can use _readfrom for 1100 embedded memory files.
ReadFromSerial
remove
rename
SaveSPCData
Seek
SetCableSerialNumber
SetSerialParams
TestPreference Preferences can now be saved on each test.
tmpname
write You can use _write for 1100 embedded memory files.
WriteBlockToSerial
writeto You can use _writeto for 1100 embedded memory files.
WriteToSerial
120
Index
Cirris.RunBadCount, 89
_ Cirris.RunGoodCount, 89
_appendto, 104 Cirris.RunNumber, 89
_copyfile, 105 Cirris.RunTotalCount, 89
_openfile, 107 Cirris.SetBuiltInOutputStates, 48
_readfrom, 108 Cirris.SetPrinter, 82
_readpattern, 107 Cirris.ShowBackgroundImage, 98
_remove, 108 Cirris.StartPrintJob, 82
_rename, 109 Cirris.StationID, 89
_write, 109 Cirris.TotalCount, 90
_writeto, 110 component scripts
examples, 15
1 inserting in a test, 16
1100 embedded file functions, 104 overview, 13
syntax, 14
C
CopyEmbeddedFileToPc, 105
Cirris. PressDoneButton, 98 CopyPcFileToEmbedded, 105
Cirris.BadCount, 87
Cirris.CableID, 87 D
Cirris.ChDir, 49 debugging, 32, 33
Cirris.CloseDir, 49 Delay, 38
Cirris.CopyDir, 49 DialogCheckBtn, 99
Cirris.CurrentDir, 50 DialogClose, 99
Cirris.DirExists, 50 DialogOpen, 100
Cirris.EndPrintJob, 80 DirUtils, 106
Cirris.GetNumPrinters, 81
Cirris.GetPrinterNameByIndex, 81 E
Cirris.GetWrappedText, 97 EEPROM, 63
Cirris.GoodCount, 89 embedded blocks
Cirris.HideBackgroundImage, 97 calling sub-functions, 27
Cirris.HipotPointMask, 62 changing default, 26
Cirris.LotID, 89 global variables, 25
Cirris.MkDir, 50 implementation, 21
Cirris.NewPage, 81 introduction, 20
Cirris.OpenDir, 51 EVT test event script
Cirris.OpenFileDiaglog, 51 overview, 8
Cirris.OpenFolderDiaglog, 51 parameters, 12, 14
Cirris.Print, 82 required syntax, 9
Cirris.ReadBuiltInTesterInputStates, 48 selecting, 10
Cirris.ReadDir, 52
Cirris.RmDir, 52
121
F L
file functions, 49 LearnCable, 74
functions low level function, 53
alphabetically, 36 sink / unsink, 53
by category, 34 LUA Test Event Script
required syntax, 6
G selecting, 7
Get4WPairPt, 84
GetAdapters, 87 M
GetBuiltInTesterOutputStates, 47 measurement and test functions, 62
GetCableStatus, 90 MessageBox, 100
GetCapMeasurement, 64, 68 MicroLan, 75
GetComponentCount, 90
GetComponentDetails, 91 P
GetDateAsText, 38 parameter types and values, 12, 14
GetErrorSignature, 92 PlaySound, 102
GetErrorText, 92 PlaySoundFile, 98
GetHardWareVersion, 84 preserved lua 3.2 functions, 111
GetNumberTested, 92 printer functions, 80
GetPinLabel, 93 PromptForUserInformation, 102
GetPLCOutputStates, 44
GetProbedPin, 84 R
GetPtType, 85 ReadPLCInputStates, 45
GetRawPointNum, 84 ReadUserInputStates, 42
GetRelCapMeasurement, 65 remove, 112
GetResistanceMeasurement, 66 rename, 112
GetResistanceMeasurement4W, 67 report scripts
GetSystemInfoAsText, 86 overview, 18
GetTimeAsInteger, 86 setting up, 18
GetTimeAsText, 85 syntax, 19
GetTotalCapMeasurement, 68
S
GetUserOutputStates, 41, 44, 47, 48
GetWirelistInfoAsText, 94 script errors, 32
scripting
H Easy Touch scripting defined, 1
HipotNetTiedToPoint, 69 enabling scripting, 2
HipotNetTiedToPoints, 62, 69 getting a script, 3
HipotPointMask, 73 SendTextToParallelPrinter, 83
SetDelayTimeInMilliseconds, 39
I SetPLCOutputStates, 46
IsSPCDataCollectionOn, 96 SetUserOutputStates, 43
122
T TWLGetErrorText, 96
test information functions, 87
U
tester information functions, 84
TestWirelist, 77 unsupported cirris functions, 112
TimePassed, 39 UseChildWirelist, 78
TimerClose, 39 user interface functions, 97
TimerDone, 40 W
TimerReset, 40
WiresAttached, 86, 96
123