Professional Documents
Culture Documents
Win Secs
Win Secs
Win Secs
7
COM Reference
2006 by Brooks Automation, Inc. All rights reserved. Printed in the United States of
America.
This document contains information that is the property of Brooks Automation, Inc., Chelmsford, MA
01824, and is furnished for the sole purpose of the operation and the maintenance of products of
Brooks Automation, Inc. No part of this publication is to be used for any other purpose, and is not to
be reproduced, copied, disclosed, transmitted, stored in a retrieval system, or translated into any
human or computer language, in any form, by any means, in whole or in part, without the prior
express written consent of Brooks Automation, Inc.
Although every effort is made to ensure the accuracy of this document, Brooks Automation, Inc.
assumes no responsibility for errors that may appear herein. The information is subject to change
without notice. Any sample code that appears in this document and that may be included with the
software product is included for illustration only and is, therefore, unsupported.
Export Notice
This technical data or any direct product of it may not be exported, re-exported, or released, directly
or indirectly, to Iran, Iraq, Libya, Cuba, North Korea, Sudan and Syria, and any other embargoed
country, and any of those countries listed from time to time in Country Group D:1 or E:2 in the
Export Administration Regulations, Parts 730-774 to Title 16 of the U.S. Code of Federal Regulations,
without a license from the U.S. Department of Commerce and/or other appropriate governmental
agencies or other authorization under the Export Administration Regulations. For purposes of this
prohibition, the term direct product is defined to mean the immediate product (including processes
and services) produced directly by use of the technical data.
Contents
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Introduction to WinSECS
Chapter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Overview of WinSECS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Adding WinSECS to your Visual Basic application . . . . . . . . . . . . . . . . 3
Instructions for Visual Basic 6.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Incorporating the WinSECS control in your application . . . . . . . . . 3
Keeping the .oca file available . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
WinSECS objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
SecsLibrary object: the message library . . . . . . . . . . . . . . . . . . . . . . . . 4
SecsTransaction object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
SecsMessage object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
SecsItem object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Array items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Potential conversion problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
SECS message construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Item construction conversion process . . . . . . . . . . . . . . . . . . . . . . 14
Binary message construction process . . . . . . . . . . . . . . . . . . . . . 15
Item searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
SECS message parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Event sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Issues when using Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Event blocking with modal dialogs . . . . . . . . . . . . . . . . . . . . . . . . 22
Handling secondary messages in Visual Basic . . . . . . . . . . . . . . 23
WinSECS Control
Chapter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Properties
AcceptDuplicateBlocks property . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AutoBaud property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AutoDevice property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Baud property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BaudIndex property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CodePage property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connected property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ConnectionMode property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
30
31
32
32
33
34
35
iii
SecsLibrary Object
Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Properties
Description property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Transaction property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
TransactionCount property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Methods
AddNew method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
UseDefault method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
SecsTransaction Object
SecsMessage Object
Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Properties
ActionOnError property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ActionOnSuccess property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AutoSystemBytes property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Description property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DeviceID property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Index property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
InProgress property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Name property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Primary property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReplyExpected property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Secondary property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SystemBytes property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tag property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
76
76
77
77
78
78
78
79
79
80
80
81
81
Methods
Delete method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Receive method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reply method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Send method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
82
82
82
83
Chapter 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Properties
Description property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Item property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Length property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Name property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Raw property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RawHex property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Root property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stream property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
86
86
87
87
87
88
88
89
90
Methods
Build method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Parse method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
CONTENTS
SecsItem Object
Chapter 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
Properties
Description property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94
Format property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94
Index property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
Item property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
ItemCount property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
Length property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97
Name property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
NLB property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
Parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Raw property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Value property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Methods
AddNew method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Delete method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Duplicate method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Examples
Appendix A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
Transaction name display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Port test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Set hsms port type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Set rs-232 port type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Message transaction example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
SECS1 port configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
PrimaryOut secondaryin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Send method substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
New transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Download binary recipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
S1F1 message received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
Adding a secsitem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
HSMS port configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Building a new message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Reading data from a message not defined in your library . . . . . . . . .112
Error Messages
Appendix B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
Software Support
Appendix C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137
What is Software Support? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138
Before you call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139
How to contact Software Support . . . . . . . . . . . . . . . . . . . . . . . . . . . .140
Other services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
Revision History
This section provides a record of releases for this product and a brief
description of the changes made to this book in each release.
Release #
Revision
None.
ix
p. xi
p. xi
Notation conventions
WinSECS documentation uses the following typographic conventions:
Convention
Example
Description
Monospace font
Sample code
code _
moreCode
xi
Chapter
1:
Introduction to WinSECS
The Brooks Automation Windows-compatible Semiconductor
Equipment Communications Standard (WinSECS) messaging software
allows you to exchange messages with equipment that complies with
the Semiconductor Equipment Communication Standard (SECS).
WinSECS also facilitates communication with Generic Equipment
Model (GEM)-compliant manufacturing equipment. These standards
are established by the Semiconductor Equipment and Materials
International (SEMI) standards committee. To use WinSECS you must
first understand these standards.
Overview of WinSECS
p. 2
p. 3
p. 4
p. 8
p. 9
Data types p. 11
Array items p. 12
Potential conversion problems
p. 13
p. 17
p. 19
p. 21
p. 23
Overview of WinSECS
Brooks Automation supplies WinSECS as a Visual Basic OLE custom
control. WinSECS consists of the WinSECS control and four OLE
objects that are derived from the control: SecsLibrary object,
SecsTransaction object, SecsMessage object, and SecsItem object.
The WinSECS control is added to a Visual Basic program by
incorporating it into the VB Hotbox. You double click or drag it from
the toolbox and drop it on a Visual Basic form. Once you have the
control on the form, you use standard VB coding practices to build the
interface by filling in the desired Event handlers and setting the
control properties for baud rates, time-outs, etc.
WinSECS allows you to send, receive, and create messages that
comply with the SECS2 standard and are communicated across the
SECS1 or HSMS links. The WinSECS control supports SECS1
(including RS-232, TCPIP, and TELNET transport mediums) and Highspeed SECS Message Services (HSMS) equipment connections. You
can connect multiple SECS devices on each port. Each device is
identified by its SECS device ID. You can use multiple WinSECS
controls in an application for interfaces over multiple ports.
In a WinSECS application, SECS messages are represented by
transaction objects. The WinSECS Library contains predefined
transaction templates for all messages in the SECS standard. You can
pick messages from this Library, modify them, and add them to your
application. You can copy and modify this Library to include only
those messages that are common to the applications that you develop.
You can also add new, non-standard messages to the Library.
The SECS message parsing and construction services that WinSECS
provides allow you to create or modify messages at run time. This
capability facilitates development of interfaces that can be easily
tweaked or updated in response to changing conditions on the factory
floor.
WinSECS includes a debugging feature that provides structured
access to raw SECS messages and uses Events to notify Visual Basic
at every stage of a transaction. When this feature is combined with
Visual Basics debugging environment, WinSECS provides simple
diagnosis and resolution of even the toughest protocol problems.
Installing WinSECS
To run WinSECS you must have the system setup described in the
WinSECS ReadMe. Follow the installation instructions in that
document before proceeding.
WinSECS objects
SECS messages are represented as a set of OLE automation objects.
You must be familiar with these objects in order to use the WinSECS
control.
The OLE automation objects derived from WinSECS are:
SECS Object
Description
SecsLibrary
SecsTransaction
SecsMessage
SecsItem
These objects are described in more detail in the sections that follow.
Properties and Methods associated with each object are described in
the reference chapter for that object.
If you were to create this transaction yourself, you would have to:
create a new transaction, name the transaction, name the contained
messages, add an item, name the item, add two items to the item list,
and name the two items. To reduce these steps, use the transaction
templates in the Library. To use the templates, establish the default
Library and create a copy of the transaction template. In the case
above, you would use the S1F1 template.
In addition, WinSECS uses the Library when it parses incoming
messages. For primary messages, if a SecsTransaction in the Library
has a SecsMessage with Stream and Function matching the incoming
message, WinSECS will use that SecsTransaction as the basis for the
parse. Items in the incoming SECS message will be assigned names as
defined by the SecsItem objects in the Library transaction template.
The following properties and methods are associated with SecsLibrary
objects:
Description property
Transaction property
TransactionCount property
AddNew method
UseDefault method
SecsLibrary
WinSECS1.Library.Transaction(S1F1)
(S1F1) SecsTransaction
WinSECS1.Library.Transaction(S1F1)
Name = S1F1
WinSECS1.Library.Transaction(2)
WinSECS1.Library.Transaction(2)
WinSECS1.Library.Transaction(2)
WinSECS1.Library.Transaction(2)
WinSECS1.Library.Transaction(2)
SecsTransaction
Name = S1F3
SecsTransaction
Name = S6F13
For more information on the syntax of SecsLibrary objects, see the
reference chapter SecsLibrary Object on page 71.
SecsTransaction object
A SecsTransaction object represents a primary and secondary
message sequence: it always contains a Primary SecsMessage object
and a Secondary SecsMessage object. These SecsMessage objects are
returned by the Primary and Secondary properties of the
SecsTransaction object, as shown in the following figure:
SecsTransaction
Object
Primary
SecsMessage
Object
Secondary
SecsMessage
Object
ActionOnError property
Delete method
ActionOnSuccess property
Receive method
AutoSystemBytes property
Reply method
Description property
Send method
DeviceID property
Index property
InProgress property
Name property
Primary property
ReplyExpected property
Secondary property
SystemBytes property
Tag property
SecsTransaction object
7
CHAPTER 1: INTRODUCTION TO WINSECS
SecsMessage object
A SecsMessage object is an object that represents a SECS message
(either Primary or Secondary). Each SecsTransaction contains two
SecsMessage objects, obtained using the Primary and Secondary
properties of the SecsTransaction object.
A SecsMessage object always contains a Root SecsItem object. The
Root SecsItem does not appear in the binary SECS message, but is
used as a parent item for the items that do appear in the message.
The figure below shows the structure of a SecsMessage object and the
contained SecsItem objects that represent a standard S1F2 message.
The first SecsItem object is the Root and does not appear in the SECS
message. The next item is a List. The list contains two items, named
MDLN and SOFTREV. To the left of the SecsItem objects are the
properties of the SecsMessage object that are used to reference the
SecsItem.
SecsMessage
Root
SecsItem
Item(L)
Item(L)
Item(MDLN)
Item(MDLN)
Item(SOFTREV)
Item(SOFTREV)
Item(SOFTREV)
SecsItem
Name = L
SecsItem
Name = MDLN
SecsItem
Name = SOFTREV
Description property
Build method
Function property
Parse method
Item property
Length property
Name property
Raw property
RawHex property
Root property
Stream property
SecsItem object
A SecsItem object can be either a list or an item containing a value.
The figure below shows the SecsItem objects that represent a standard
S1F2 message from the equipment. The Root SecsItem object does not
appear in the SECS message; it is used as a parent for the SecsItem
SecsItem object
9
CHAPTER 1: INTRODUCTION TO WINSECS
objects below. To the left of the SecsItem objects are the properties of
the SecsMessage object that are used to reference the SecsItem
objects.
SecsMessage
Root
SecsItem
Item(L)
SecsItem
Name = L
SecsItem
Name = MDLN
Item(MDLN)
Item(MDLN)
Item(SOFTREV)
Item(SOFTREV)
SecsItem
Name = SOFTREV
Description property
AddNew method
Format property
Delete method
Index property
Duplicate method
Item property
ItemCount property
Length property
Name property
NLB property
Parent property
Raw property
Value property
For more information on syntax of SecsItem objects, see the reference
chapter SecsItem Object on page 93.
Data types
WinSECS uses the Variant data type to handle the various item
formats defined by the SECS standard. The actual SECS item format
code used is determined by the Format property of the SecsItem
object. The associated data value is available through the Value
property of the SecsItem object. The data type of the Value property is
Variant.
The following table shows the correspondence between the various
SECS formats and their associated Variant types. (The Variant type in
the left column is the type returned by the Visual Basic VarType
function.)
Variant type
vbSingle
wsFormatF4
vbDouble
vbString
If the SECS item format code is wsFormatVar, then the format code
used for conversion to the Variant type is determined by the type of
the value at the time of item construction (see Item construction
conversion process on page 14).
When a SECS messag is received and parsed by the WinSECS control,
the items in the SECS message are converted to the Variant types
indicated in the table above.
When a SECS message is sent, a two-step conversion is performed.
The initial type of the Variant is converted to the Variant type that
corresponds to the desired Format property for the item in the table
above. The resulting variant is then converted to the desired SECS
item format.
For example, suppose you want to send a SECS message containing
an item of SECS type U1 (one byte unsigned integer). You set the
Value property of the SecsItem object to 3.0 (floating point) and the
Format property to wsFormatU1. When you send the message, the
WinSECS control performs these conversions:
1. The Float variant 3.0 is converted to a vbLong variant type.
2. The vbLong variant is converted to one byte unsigned integer.
If a conversion cannot be performed, an error event is produced.
Data types
11
CHAPTER 1: INTRODUCTION TO WINSECS
Array items
A SECS item that is an array is handled in the same fashion as nonarray items. The Variant data type is also used to represent array
items.
Restrictions on arrays
While the Variant data type is able to store arrays of any type, and
even mixed types within the array, a SECS item is more constrained.
The rules WinSECS uses for SECS array items are:
array Variant. The type of each element in the array is the same
and is governed by the rules above.
Notice that the vbDouble data type is used for U4, U8, and I8 SECS
formats. This is because the range of these formats lies outside the
range represented by the vbLong type. In the case of U4 data this is
not a problem. The vbDouble data type can represent the entire range
of U4 items without loss of precision. However, precision may be lost
when converting U8 and I8 variables to vbDouble. Fortunately, the U8
and I8 data types are used infrequently. If you use equipment that
uses the U8 and I8 formats, and produces very large numbers, you
will have to access the raw formats of the data.
Boolean values
VarType
vbInteger
wsFormatI2
vbLong
wsFormatI4
vbSingle
wsFormatF4
vbDouble
wsFormatF8
vbCurrency
wsFormatF8
vbBoolean
11
wsFormatBoolean
vbByte
17
wsFormatU1
All others
wsFormatAscii
Item Format Code The format code is the code determined during the
item construction conversion process.
Number of Length Bytes The number of length bytes is either the value
of the NLB property or the minimum number required to represent the
length, whichever is larger.
Length The length is either the value determined during the item
construction conversion process (if the item is not a list), or the
number of items defined in the list (if the item is a list).
3. If the item is not a list, the binary data for the item is added to the
message.
The binary data for the item is that obtained from the Item
construction conversion process on page 14.
Item searching
To locate a particular item in a SECS message, use the Item property
of a SecsItem object (see Item property on page 96). When you use
the Item Name syntax for the Item property (the first parameter is a
quoted string), WinSECS will search not only the SecsItem to which
you apply the Item property, but all child items as well. If you apply
the Item property to a SecsItem object named waf
waf.item(string_to_search_for)
WinSECS will first search the children of waf. It will then search the
children of wafs first child, then of wafs first grandchild. If there are
no matching descendants of the first grandchild, the second
grandchilds descendants are searched. In other words, the SecsItems
within waf will be searched recursively until a match is found.
If the boxes below are SecsItems, the search will occur in the order
shown alphabetically.
a
b
e
c
f
d
g
h
i
j
The Item property will never return the SecsItem to which it is applied
(will never return itself), so a search for
waf.item(waf)
Item searching
17
CHAPTER 1: INTRODUCTION TO WINSECS
The search terminates when the first item that matches the search
parameters is found. In the figure below, a search for the SecsItem
named X
waf.item(X)
a
b
e
c
x
d
x
x
x
x
The two descendants of e named X will not be found because the
search terminates when a match is found at the level above them.
a
b
e
c
x
d
x
x
x
x
The item named X which is sibling to e is not returned because it is
not the second item named X within a list.
It is good practice to use unique item names. Use duplicate names for
similar items in the same parent list.
See Item property on page 96 for more detailed information on
syntax.
Determine type of
transaction
4. Each item in the SECS message is parsed. If the item violates the
SECS2 standard, a SecsError event is generated and the message
parsing fails. During parsing, the Format, NLB, Length, and Value
of the item object are extracted.
5. If the transaction contains a SecsItem object at a location
corresponding to the extracted item, the properties of that item are
assigned the extracted values. Otherwise a new item object is
created and inserted in the transaction. If there is an item object in
the transaction at a position just prior to the extracted item in its
parent list, the new item is assigned the same name as that
previous item. Otherwise the new item name is left blank. The new
item is then assigned the extracted values.
6. When all items have been extracted, the transaction is scanned for
items that were defined, but not found in the actual SECS
message. Such items are deleted from the transaction object.
Forward completed
transaction object
Event sequences
When the Send or Reply methods are used, events described in the
following tables can occur:
Condition
PrimaryOut
Condition
PrimaryOut
Condition
SecondaryOut
Condition
PrimaryIn
Condition
SecsError
Event sequences
21
CHAPTER 1: INTRODUCTION TO WINSECS
Here you see that we merely send the primary message when the
button is clicked and post the result when the secondary message is
received. This is the fundamental idea in handling secondary
messages.
There are still problems with this application. First, we do not check
for errors. Second, we will have problems when we want to add
support for more messages. Let's tackle this second issue first.
Suppose we want to add a second button, that will display the
susceptor temperature when clicked. We can get the susceptor
temperature using SVID = 22 (we get this from the SECS manual
provided with the equipment). We add a new button to the form and a
new text box. These are named TemperatureButton and
TemperatureText. The click event code for TemperatureButton will be
nearly identical to that for PressureButton. But now look at the
SecondaryIn event code. Here we need to decide which secondary
message we have received. Does it contain the temperature or the
pressure? There are many ways to tackle this problem. A simple
technique that will work well for most applications is to use the Tag
property of the SecsTransaction object to "mark" it so that we know
how to handle it in the SecondaryIn event. Here is an example:
Private Sub PressureButton_Click()
Dim Trans As SecsTransaction
Set Trans = WinSECS1.NewTransaction("S1F3")
Trans.Primary.Item("SVID") = 15
Trans.Tag = "Pressure"
Trans.Send
End Sub
Private Sub TemperatureButton_Click()
Dim Trans As SecsTransaction
Set Trans = WinSECS1.NewTransaction("S1F3")
Trans.Primary.Item("SVID") = 22
Trans.Tag = "Temperature"
Trans.Send
End Sub
Private Sub WinSECS1_SecondaryIn(ByVal Trans As
SecsTransaction, ByVal ErrorCode As Long, ByVal ErrorText As
String)
Select Case Trans.Tag
Case "Pressure": PressureText = Trans.Item("SV")
Case "Temperature": TemperatureText = Trans.Item("SV")
End Select
End Sub
Here we have used the Tag property to select the desired action when
the Secondary message is received. We can generalize this approach.
Instead of handling the "Pressure" and "Temperature" cases directly,
we could call user written functions for these cases, passing the Trans
object as a parameter. Also, we could call a second function to handle
errors (the case where ErrorCode is non zero). Then our SecondaryIn
event logic becomes a selection of various functions, based first on the
Tag and then on whether ErrorCode is zero or non-zero.
This is the basic way we recommend you handle your SecondaryIn
events. You can extend this method for the other events, PrimaryIn,
PrimaryOut, and SecondaryOut.
Chapter
2:
WinSECS Control
The WinSECS OLE control provides SECS messaging over a single
physical port. It can support multiple SECS devices connected to that
port. This chapter contains the reference for the control properties,
methods and events. These elements are documented in alphabetical
order within each group.
Properties
AcceptDuplicateBlocks property
AutoBaud property
p. 30
AutoDevice property
Baud property
p. 29
p. 31
p. 32
BaudIndex property
CodePage property
Connected property
p. 32
p. 33
p. 34
ConnectionMode property
CurrentBaud property
p. 35
p. 36
CurrentConnectionMode property
DefaultDeviceID property
EncodingCode property
ErrorConstants
p. 37
p. 37
p. 38
HSMST3 property
p. 38
HSMST5 property
p. 39
HSMST6 property
p. 39
HSMST7 property
p. 40
HSMST8 property
p. 41
IgnoreSystemBytes property
Interleave property
p. 41
p. 42
IPAddressLocal property
IPPortRemote property
Library property
p. 36
p. 43
p. 46
p. 47
27
LinkTestTimer property
p. 47
MonitorEnabled property
MultipleOpen property
PortIsOpen property
PortType property
p. 48
p. 48
p. 49
p. 50
RetryLimit property
SecsHost property
p. 51
p. 51
SerialPort property
p. 52
SimulateMode property
T1 property
p. 54
T2 property
p. 54
T3 property
p. 55
T4 property
p. 55
p. 53
Methods
ClosePort method
p. 57
NewTransaction method
OpenPort method
p. 57
p. 58
Events
Connect event
p. 60
Disconnect event
Monitor event
p. 61
p. 61
PrimaryIn event
p. 63
PrimaryOut event
p. 65
SecondaryIn event
p. 66
SecondaryOut event p. 67
SecsError event
p. 68
SecsWarning event
p. 69
Properties
This section presents the properties of the WinSECS OLE control.
AcceptDuplicateBlocks property
Sets or returns a Boolean value which indicates whether or not the
WinSECS control accepts duplicate SECS blocks.
Applies to
wsPortTypeRS232
wsPortTypeTELNET
wsPortTypeTCPIP
Syntax
Notes
A duplicate SECS block contains exactly the same ten SECS header
bytes as the previous block. Normally, the WinSECS control discards
duplicate blocks, as is recommended by the SECS standard. If the
AcceptDuplicateBlocks property is True, the WinSECS control accepts
duplicate blocks.
Generally, you should set this property to True only if the equipment
does not properly generate SECS system bytes.
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
False
Data type
Boolean
See also
AcceptDuplicateBlocks property
29
CHAPTER 2: WINSECS CONTROL
AutoBaud property
Sets or returns a Boolean value which indicates whether or not the
WinSECS control automatically adjusts its baud rate.
Applies to
wsPortTypeRS232
Syntax
Notes
19200
9600
4800
2400
1200
3. If a framing error occurs at the 1200 baud rate, the control sets its
rate to 9600 and the AutoBaud attempt continues.
The AutoBaud feature is disabled after the first successful
transmission or reception of a SECS message. This prevents real
protocol errors from causing an undesired baud rate adjustment.
During the AutoBaud attempt, protocol errors do not count against
the RetryLimit. This prevents WinSECS from giving up on a baud rate
synchronization attempt because the RetryLimit was exceeded. This
means that you may see more handshake character transmissions by
WinSECS during the baud rate determination than would be expected
from the RetryLimit setting.
When using AutoBaud, you can read the CurrentBaud property to
determine the actual baud rate setting.
Note
The baud rates 150 and 300 (which are legal in the SECS
standard) are not included in the AutoBaud list. If you need to use
these data rates, you cannot use the AutoBaud feature.
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
True
Data type
Boolean
See also
AutoDevice property
Determines whether or not the default device ID is automatically
adjusted upon receipt of an S9F1 message.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTELNET
wsPortTypeTCPIP
Syntax
Notes
Default value
True
Data type
Boolean
See also
AutoDevice property
31
CHAPTER 2: WINSECS CONTROL
Baud property
Sets or returns the baud rate for the serial port.
Applies to
wsPortTypeRS232
Syntax
[form.]WinSECSn.Baud[ = BaudRate]
Notes
The serial port hardware must support the BaudRate value. The valid
values for BaudRate are:
19200
9600
4800
2400
1200
300
150
Setting this property to a value not in this list will cause a trappable
runtime error. You can change the value of this property at any time,
but its value takes effect only when you call the OpenPort method.
Changing this value when the port is open has no effect on the port.
To make the change effective you must first close the port using the
ClosePort method, then reopen the port with the OpenPort method.
Default value
9600
Data type
Long
See also
BaudIndex property
Sets or returns the baud rate using an index code.
Applies to
wsPortTypeRS232
Syntax
[form.]WinSECSn.BaudIndex [= BaudIndexCode ]
Notes
BaudIndexCode
150
300
1200
2400
4800
9600
19200
When you change the Baud property, the BaudIndex property also
changes. Likewise, when you change the BaudIndex property, the
Baud property changes. For example, if you set the BaudIndex
property to 5, the Baud property changes to 9600.
This property can be used to display a list of available baud rates in a
combo or list box. If you display the list in the order shown above, you
can use the ListIndex property of the list or combo box to set the
BaudIndex property.
This property is not available at design time.
Default value
Data type
Long
See also
CodePage property
Specifies the encoding scheme used by the tool to convert the SECS
Format 20 ASCII items.
Applies to
wsFormatAscii
Syntax
CodePage property
33
CHAPTER 2: WINSECS CONTROL
Notes
CodePage
Description
932
Japanese Shift-JIS
936
949
Korean
950
Default value
-1
Data type
Integer
Connected property
Determines if the communication port is currently connected.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTELNET
wsPortTypeTCPIP
Syntax
[form.]WinSECSn.Connected
Notes
Data type
See also
ConnectionMode property
Sets or returns the connection mode for HSMS communications.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.ConnectionMode[ = ConnectionModeConstant]
Notes
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Legal Values of
ConnectionModeConstant
Usage
wsConnectionModePassive
wsConnectionModeActive
wsConnectionModeAlternating
Default value
wsConnectionModeActive
Data type
Long
See also
ConnectionMode property
35
CHAPTER 2: WINSECS CONTROL
CurrentBaud property
Returns the baud rate currently in effect.
Applies to
wsPortTypeRS232
Syntax
[form.]WinSECSn.CurrentBaud
Notes
If the port is open, the CurrentBaud property returns the baud rate
currently in use for the physical port. This is not necessarily the same
as the Baud property value when the port was opened, if the
AutoBaud property was True when the OpenPort method was used. If
AutoBaud was True when the port was opened, the actual baud rate
may have been adjusted by the WinSECS control.
If the port is not open, the CurrentBaud property will return the
current value of the WinSECS Baud property.
Data type
Long
See also
CurrentConnectionMode property
Returns the HSMS connection mode currently in effect.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.CurrentConnectionMode
Notes
Data type
Long
See also
DefaultDeviceID property
Sets or returns the default SECS device ID used for primary messages.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.DefaultDeviceID[ = DeviceID]
Notes
The default device ID is used when a primary message is sent and the
DeviceID property of the transaction has not been set. Many pieces of
SECS equipment support a single SECS device ID. For these types of
equipment, if you set the default device ID, you do not need to set the
device ID for each outgoing primary message.
The value of DeviceID must be in the range 0 to 32767. Settings
outside this range will cause a trappable runtime error.
You may change the value of this property at any time; changes to the
value of this property affect subsequent use of the NewTransaction
method.
Default value
Data type
Long
See also
EncodingCode property
Specifies the encoding code used for SECS Format 22 items.
Applies to
wsFormatChar2
Syntax
[form.]WinSECSn.EncodingCode
Notes
DefaultDeviceID property
37
CHAPTER 2: WINSECS CONTROL
While sending SECS items to the tool with Format 22, the 16 bit
encoding code recorded specifies WinSECS, the encoding scheme used
by the tool. While sending SECS items to the tool with Format 22, if
WinSECS wants to determine the encoding scheme used by the tool
then it sets the value of Encoding code property to 1 (UNICODE).
Default value
Data type
ErrorConstants
Defines error codes that can be passed in events.
Notes
HSMST3 property
Sets or returns the T3 timer value for HSMS connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.HSMST3[ = TimerValue]
Notes
The T3 value specifies the amount of time to wait for a reply. This
property sets or returns the T3 reply timeout value (in seconds) for the
HSMS protocol. The value of TimerValue must be in the range of 1 to
2147483647.
You can change the value of this property at any time; its value takes
effect immediately.
Default value
45
Data type
Long
See also
HSMST5 property
Sets or returns the T5 timer value for HSMS connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.HSMST5[ = TimerValue]
Notes
The T5 value specifies the amount of time which must elapse between
successive attempts to connect to a given remote entity. This property
sets or returns the T5 connection separation timeout value (in
seconds) for the HSMS protocol. The value of TimerValue must be in
the range of 1 to 240.
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
10
Data type
Long
See also
HSMST6 property
Sets or returns the T6 timer value for HSMS connectionsHSMS
connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.HSMST6[ = TimerValue]
HSMST5 property
39
CHAPTER 2: WINSECS CONTROL
Notes
Default value
Data type
Long
See also
HSMST7 property
Sets or returns the T7 timer value for HSMS communicationsHSMS
connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.HSMST7[ = TimerValue]
Notes
The T7 value specifies the time which a TCP/IP connection can remain
in the NOT SELECTED state (i.e., no HSMS activity) before it is
considered a communications failure. This property sets or returns
the T7 not selected timeout value (in seconds) for the HSMS protocol.
The value of TimerValue must be in the range of 1 to 240.
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
10
Data type
Long
See also
HSMST8 property
Sets or returns the T8 timer value for HSMS communicationsHSMS
communicationsHSMS connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.HSMST8[ = TimerValue]
Notes
Default value
Data type
Long
See also
IgnoreSystemBytes property
Determines whether or not the SECS system bytes are used in reply
matching.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
HSMST8 property
41
CHAPTER 2: WINSECS CONTROL
Default value
False
Data type
Boolean
See also
Interleave property
Sets or returns a Boolean indicating whether or not the control should
interleave SECS blocks as a sender.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
False
Data type
Boolean
See also
IPAddressLocal property
Sets or returns the IP address of the local node for HSMS connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.IPAddressLocal[ = IPAddress]
Notes
This property sets or returns the IP address used by the local node
(the computer running WinSECS) for HSMS connections.
The IPAddress is a string of the form
XXX.XXX.XXX.XXX
Default value
0.0.0.0
Data type
String
IPAddressLocal property
43
CHAPTER 2: WINSECS CONTROL
See also
IPAddressRemote property
Sets or returns the IP address of the remote node for HSMS
connections.
Applies to
wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.IPAddressRemote[ = IPAddress]
Notes
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
255.255.255.100
Data type
String
See also
IPPortLocal property
Sets or returns the IP port number of the local node for HSMS
connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.IPPortLocal[ = PortNumber]
Notes
This property sets or returns the IP port used by the local node (the
computer running WinSECS) for HSMS connections.
You may use any legal PortNumber. Legal port numbers may vary
from one computer and network configuration to the next. You may
not use a port number in use by another process.
The combination of IPPortLocal and IPAddressLocal must be unique
for each active HSMS connection from your computer. Typically your
computer will have only one IP address, so you should choose a
different IPPortLocal number for each HSMS connection.
The port number you choose must be known to the remote entity, if
that entity attempts to establish the connection. You can change the
value of this property at any time, but its value takes effect only when
you call the OpenPort method. Changing this value when the port is
open has no effect on the port. To make the change effective you must
first close the port using the ClosePort method, then reopen the port
with the OpenPort method.
Default value
5000
Data type
Long
See also
IPPortLocal property
45
CHAPTER 2: WINSECS CONTROL
IPPortRemote property
Sets or returns the IP port number of the remote node for HSMS
connections.
Applies to
wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.IPPortRemote[ = PortNumber]
Notes
This property sets or returns the IP port used to designate the remote
node for HSMS and SECS1-TCPIP/TELNET connections.
The PortNumber you use must agree with the port number used by
the remote entity.
For HSMS, this property is used only if WinSECS attempts to
establish the HSMS connection. If the remote node establishes the
connection, the value of this property has no effect.
For SECS1-TCPIP/TELNET, this property designates a
communication endpoint, usually a terminal server that has a piece of
equipment connected to it locally, capable of communicating with
SECS1 protocol. This property, in conjunction with the
IPAddressRemote Property, are used instead of the SerialPort
property. The value of this property usually is associated with an an
individual RS232 port found on the device.
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
5000
Data type
Long
See also
Library property
Returns the library property associated with the control.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.Library
Notes
Data type
See also
LinkTestTimer property
Sets or returns the link test timer value for HSMS connections.
Applies to
wsPortTypeHSMS
Syntax
[form.]WinSECSn.LinkTestTimer[ = TimerValue]
Notes
This property sets or returns the link test timer value (in seconds) for
the HSMS protocol. The value of TimerValue must be in the range of 0
to 86400 (the number of seconds in a day).
The link test timer value determines the amount of time between link
test control messages issued by the WinSECS control. Such messages
are useful to determine whether or not the HSMS connection is intact,
even in the absence of SECS message activity.
A TimerValue of 0 disables link test messages from WinSECS.
Library property
47
CHAPTER 2: WINSECS CONTROL
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
Data type
Long
MonitorEnabled property
Sets or returns a Boolean indicating whether or not the WinSECS
control generates Monitor events.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
Default value
False
Data type
Boolean
MultipleOpen property
Sets or returns a Boolean indicating whether or not the WinSECS
control allows multiple open transactions as a sender.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
Multiple open transactions occur when the primary messages for two
or more transactions are sent before the secondary messages are
received. This condition occurs if you use the Send method two or
more times before you receive a SecondaryIn event.
Some equipment does not support multiple open transactions. If the
equipment does not support multiple open transactions, you should
set this property to False.
The value of this property has no effect on your use of the Send
method. You can initiate many Send methods before their associated
replies are received, regardless of the value of the MultipleOpen
property. If the value is True, the primary messages are sent as
rapidly as possible.
If this property is set to False, the sending of primary messages will be
suspended until there are no outstanding primary messages waiting
for replies. The WinSECS control will buffer the pending send requests
in memory, up to the limit imposed by system memory.
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Note
Default value
True
Data type
Boolean
See also
PortIsOpen property
Returns a Boolean indicating whether or not the port is open.
Applies to
wsPortTypeHSMS
PortIsOpen property
49
CHAPTER 2: WINSECS CONTROL
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.PortIsOpen
Notes
Description
True
False
Data type
Boolean
See also
PortType property
Sets or returns a number that identifies the port connection type.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.PortType[ = PortTypeConstant]
Notes
Value
Description
wsPortTypeRS232
wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
WinSECS Version 2.7
Default value
0 (wsPortTypeRS232)
Data type
Long
See also
RetryLimit property
Sets or returns the RetryLimit (RTY) value for the SECS1 data link
protocol.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.RetryLimit[ = RetryLimit]
Notes
Default value
10
Data type
Long
See also
SecsHost property
Determines whether or not the WinSECS control will act as SECS host
to the SECS equipment.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
RetryLimit property
51
CHAPTER 2: WINSECS CONTROL
wsPortTypeTELNET
Syntax
Notes
Meaning
True
False
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
True
Data type
Boolean
See also
SerialPort property
Sets or returns the name of the serial port.
Applies to
wsPortTypeRS232
Syntax
[form.]WinSECSn.SerialPort[ = PortName]
Notes
Default value
COM1
Data type
String
See also
SimulateMode property
Sets or returns a Boolean value indicating whether or not the
WinSECS control will simulate the sending and receiving of messages.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
Default value
False
Data type
Boolean
SimulateMode property
53
CHAPTER 2: WINSECS CONTROL
See also
T1 property
Sets or returns the T1 timer value.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.T1[ = TimerValue]
Notes
Default value
0.3
Data type
See also
T2 property
Sets or returns the T2 timer value.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.T2[ = TimerValue]
Notes
You can change the value of this property at any time, but its value
takes effect only when you call the OpenPort method. Changing this
value when the port is open has no effect on the port. To make the
change effective you must first close the port using the ClosePort
method, then reopen the port with the OpenPort method.
Default value
0.5
Data type
See also
T3 property
Sets or returns the T3 timer value.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.T3[ = TimerValue]
Notes
Default value
45
Data type
Long
See also
T4 property
Sets or returns the T4 timer value.
Applies to
wsPortTypeRS232
wsPortTypeTCPIP
T3 property
55
CHAPTER 2: WINSECS CONTROL
wsPortTypeTELNET
Syntax
[form.]WinSECSn.T4[ = TimerValue]
Notes
Default value
10
Data type
Long
See also
Methods
This section presents the methods of the WinSECS OLE control.
ClosePort method
Closes a physical communication port.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.ClosePort
Notes
See also
NewTransaction method
Returns a SecsTransaction object that can be used to initiate a SECS
transaction.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
[form.]WinSECSn.NewTransaction
[form.]WinSECSn.NewTransaction[(Index)]
[form.]WinSECSn.NewTransaction[(TransactionName)]
ClosePort method
57
CHAPTER 2: WINSECS CONTROL
Notes
Data type
SecsTransaction object
See also
OpenPort method
Opens a physical communication port.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
When an application is finished using the port, it should close the port
using the ClosePort method.
Note
See also
OpenPort method
59
CHAPTER 2: WINSECS CONTROL
Events
This section presents the events of the WinSECS OLE control.
Connect event
Occurs when an HSMS, TCP/IP, or Telnet link is established.
Applies to
wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Sub WinSECSn_Connect()
Notes
See also
Disconnect event
Occurs when an HSMS link, or TCP/IP connection is broken.
Applies to
wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
Meaning
ErrorCode
ErrorText
For HSMS, this event occurs when the link is broken. If the link was
broken because the remote entity sent a Separate Request message
(clean termination) ErrorCode is zero. Otherwise ErrorCode indicates
the reason for termination.
For SECS1-TCPIP or SECS1-TELNET, this event occurs when the
underlying TCPIP connection is broken.
The Disconnect event is not triggered when you use the ClosePort
method.
See also
Monitor event
Triggered when characters are sent or received over the physical port.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
Parameters
Meaning
Sent
True if bytes were sent out the port, False if bytes were
received
ByteType
Bytes
HexBytes
Description
wsByteTypeENQ
wsByteTypeEOT
wsByteTypeACK
wsByteTypeNAK
wsByteTypeLength
wsByteTypeHeader
wsByteTypeData
wsByteTypeChecksum
wsByteTypeDiscarded
wsByteTypeError
wsByteTypeSelectRequest
wsByteTypeSelectResponse
ByteTypeConstant
Description
wsByteTypeRejectRequest
PrimaryIn event
Occurs when an incoming primary SECS message is received.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Notes
Meaning
Trans
ErrorCode
ErrorText
PrimaryIn event
63
CHAPTER 2: WINSECS CONTROL
the reply you should set any desired data values for the items in the
reply message. The ReplyExpected property of the SecsTransaction
object indicates whether or not the sender expects a reply.
If the messages:message was parsed successfully, the ErrorCode is 0
and the ErrorText is a zero-length string. Otherwise the ErrorCode is
non-zero and the ErrorText contains a string describing the error.
You must check the ErrorCode value in this event handler. If the
message was not parsed successfully, you should not process the
primary message. If you return a reply in this case, it should normally
be a function zero reply.
When this event is triggered, the SecsTransaction object is not in
progress so you can change the properties of the SecsTransaction and
the objects it contains.
If the Library object contains a SecsTransaction with the same SECS
stream and function numbers as the primary message, that
SecsTransaction is used as the basis for the new SecsTransaction
object created and passed to this event. The Secondary SecsMessage
object will be as defined in the Library and will contain all SecsItem
objects defined in the Secondary SecsMessage of the Library
transaction. The Primary SecsMessage object will have the name of
the Primary SecsMessage object in the Library. The SecsItem objects
contained in the Primary SecsMessage object will be as received in the
incoming message. The names and descriptions of these SecsItem
objects will be as defined in the Library, to the extent the incoming
message matches the Library message. No error is returned if the
incoming message does not match the format of the Library message,
but the unmatched items will be unnamed.
If no match is found in the Library for the incoming stream and
function numbers, all objects in Trans are unnamed.
Examples
See also
PrimaryOut event
Occurs when a primary message, sent using the Send method, has
been transmitted or the transmission attempt failed.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Meaning
Trans
ErrorCode
ErrorText
This event passes the transaction object for which a primary message
has been sent. To determine if the message was successfully
transmitted, check the ErrorCode value in this event handler.
PrimaryOut event
65
CHAPTER 2: WINSECS CONTROL
See also
SecondaryIn event
Occurs when either a secondary message is received or a T3 timeout
occurs.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Meaning
Trans
ErrorCode
Notes
Parameters
Meaning
ErrorText
See also
SecondaryOut event
Occurs when the transmission of a secondary SECS message
completes.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
SecondaryOut event
67
CHAPTER 2: WINSECS CONTROL
Syntax
Notes
Meaning
Trans
ErrorCode
ErrorText
The object passed is the Transaction object for this SECS message.
When this event is triggered, the SecsTransaction is no longer in
progress, so you can modify the properties of the SecsTransaction
object and the objects it contains.
If ErrorCode is not zero, the transmission attempt failed. The ErrorText
parameter contains a text description of the error.
See also
SecsError event
Triggered when a communication error occurs but the control cannot
associate the error with a SecsTransaction object.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Meaning
ErrorCode
Notes
Parameters
Meaning
ErrorText
See also
SecsWarning event
Occurs when a recoverable error occurs at the data link level.
Applies to
wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET
Syntax
Meaning
ErrorCode
ErrorText
SecsWarning event
69
CHAPTER 2: WINSECS CONTROL
Notes
See also
Chapter
3:
SecsLibrary Object
The SecsLibrary object contains pre-defined SecsTransaction objects
for every message in the SECS standard. You can also add to or
modify the SecsTransaction objects in the library to suit your needs.
Use the Transaction property of the Library object to access the
SecsTransaction objects in the Library.
WinSECS uses the Library when it constructs outgoing messages or
parses incoming messages.
Properties
Description property
p. 72
Transaction property
p. 72
TransactionCount property
p. 73
Methods
AddNew method
p. 74
UseDefault method p. 74
71
Properties
This section presents the properties of the SecsLibrary object.
Description property
Sets or returns a description of the Library object.
Syntax
[form.]WinSECSn.Library.Description[ = DescriptionString ]
Notes
Data type
String
Transaction property
Returns a transaction object from the library.
Syntax
[form.]WinSECSn.Library.Transaction(TransactionName)
[form.]WinSECSn.Library.Transaction(Index)
Notes
Data type
TransactionCount property
Returns the number of SecsTransaction objects defined in the Library
object.
Syntax
[form.]WinSECSn.Library.TransactionCount
Notes
Data type
Integer, read-only
TransactionCount property
73
CHAPTER 3: SECSLIBRARY OBJECT
Methods
This section presents the methods of the SecsLibrary object.
AddNew method
Adds a new SecsTransaction object to the Library.
Syntax
[trans = ] [form.]WinSECSn.Library.AddNew(Index)
Return value
The SecsTransaction object added.
Notes
The Index must be an integer greater than zero and not greater than
TransactionCount + 1. An Index of 1 adds the new SecsTransaction
at the start of the Library. An Index of TransactionCount + 1 adds
the new SecsTransaction to the end of the Library.
The SecsTransaction added is a "blank" transaction. It contains a
Primary and Secondary SecsMessage objects, but those objects
contain only the Root and Stream SecsItem objects. The Name
property of all objects is a zero-length string. All other properties are
set to their default values.
After adding a new SecsTransaction object to the Library, set its Name
and other properties to the values you desire. You should also add any
desired SecsItem objects to the new SecsTransaction.
UseDefault method
Adds transactions to the Library object for each message in the SECS
standard.
Syntax
[form.]WinSECSn.Library.UseDefault
Notes
Chapter
4:
SecsTransaction Object
A SecsTransaction object contains both a Primary and Secondary
SecsMessage object. These SecsMessage objects are returned by the
Primary and Secondary properties of the SecsTransaction object.
For more information, see SecsTransaction object on page 7.
Properties
p. 76
ActionOnError property
p. 76
ActionOnSuccess property p. 76
AutoSystemBytes property
Description property
DeviceID property
Index property
p. 77
p. 78
p. 78
InProgress property
Name property
p. 78
p. 79
Primary property
p. 79
ReplyExpected property
Secondary property
Methods
p. 80
p. 80
SystemBytes property
Tag property
p. 77
p. 81
p. 81
p. 82
Delete method p. 82
Receive method
p. 82
Reply method
p. 82
Send method
p. 83
75
Properties
This section presents the properties of the SecsTransaction object.
ActionOnError property
Sets or returns a value that can be used to identify an error handling
procedure.
Syntax
SecsTransaction.ActionOnError [= Expression]
Notes
Default value
Empty
Data type
Variant
ActionOnSuccess property
Sets or returns a value that can be used to identify an error handling
procedure.
Syntax
SecsTransaction.ActionOnSuccess [= Expression]
Notes
Default value
Empty
Data type
Variant
AutoSystemBytes property
Sets or returns a Boolean which indicates whether or not unique
system bytes are automatically generated when a primary message is
sent.
Syntax
Notes
Default value
True
Data type
Boolean
Description property
Sets or returns a description of the SecsTransaction object.
Syntax
SecsTransaction.Description[ = DescriptionString ]
Notes
Default value
Data type
String
AutoSystemBytes property
77
CHAPTER 4: SECSTRANSACTION OBJECT
DeviceID property
Sets or returns the Device ID used in the messages:SECS messages.
Syntax
SecsTransaction.DeviceID[ = DeviceID]
Notes
Default value
Data type
Long
Index property
Returns the index of the SecsTransaction object in the library.
Syntax
SecsTransaction.Index
Notes
This property returns the index for the SecsTransaction object in the
Library. This is the index that may be used with the Transaction
property of the Library object to retrieve the SecsTransaction from the
Library.
If the SecsTransaction object is not in the Library, the value returned
is 0. If the value returned is 1 or greater, the SecsTransaction is in the
Library.
Data type
Long, read-only
InProgress property
Returns a Boolean value which indicates whether or not the
SecsTransaction object is in progress.
Syntax
SecsTransaction.InProgress
Notes
The InProgress property is True if you used the Send or Reply method
to send a primary or secondary message and the transaction is not yet
completed.
When a message is sent using the Send method, a SecsTransaction is
in progress until either the PrimaryOut event occurs (if ReplyExpected
is False) or until the SecondaryIn event occurs (if ReplyExpected is
Boolean, read-only
Name property
Sets or returns the name of the transaction.
Syntax
SecsTransaction.Name[ = TransactionName]
Notes
Default value
Data type
String
Primary property
Returns the SecsMessage object representing the primary message in
the transaction.
Syntax
SecsTransaction.Primary
Notes
Data type
Name property
79
CHAPTER 4: SECSTRANSACTION OBJECT
ReplyExpected property
Sets or returns a Boolean indicating whether or not a reply is expected
to the primary message.
Syntax
Notes
Default value
True
Data type
Boolean
Secondary property
Returns a SecsTransaction object that represents the secondary
message in the transaction.
Syntax
SecsTransaction.Secondary.[=Number]
Notes
Example
Data type
SystemBytes property
Sets or returns the system bytes.
Syntax
SecsTransaction.SystemBytes[ = SystemBytes]
Notes
Default value
Data type
Long
Tag property
Sets or returns a value that can be used to identify a SecsTransaction
object.
Syntax
SecsTransaction.Tag [= Expression]
Notes
The Tag property is not used by the WinSECS control. You can use it
to store any information about the transaction you need. This
property can be used to mark a SecsTransaction object before using
the Send method. The Tag value is retained when the PrimaryOut and
SecondaryIn events trigger. You can inspect the Tag value in these
events to help keep track of your transactions-in-progress.
Default value
Empty
Data type
Variant
SystemBytes property
81
CHAPTER 4: SECSTRANSACTION OBJECT
Methods
This section presents the methods of the SecsTransaction object.
Delete method
Deletes a transaction from the library.
Syntax
SecsTransaction.Delete
Notes
Receive method
Triggers a PrimaryIn event as if the message had been received over
the SECS port.
Syntax
SecsTransaction.Receive
Notes
Reply method
Sends the secondary message in a transaction.
Syntax
SecsTransaction.Reply
Notes
The data in the secondary (reply) message must be set before this
method is used. A SecondaryOut event is triggered when the
secondary message is sent. If an error occurs while the secondary
message is being built, a trappable error is produced. Successful
execution of the Reply method does not necessarily indicate that the
Send method
Sends the primary message in a transaction.
Syntax
SecsTransaction.Send
Notes
Chapter
5:
SecsMessage Object
A SecsMessage object represents a SECS message (either Primary or
Secondary). A SecsMessage object always contains a Root SecsItem
object. The Root SecsItem does not appear in the binary SECS
message, but is used as a parent item for the items that do appear in
the message.
Each SecsTransaction contains two SecsMessage objects, obtained
using the Primary and Secondary properties of the SecsTransaction
object.
For more information, see SecsMessage object on page 8.
Properties
p. 86
Description property
Function property
Item property
Name property
p. 87
p. 87
p. 88
RawHex property
Root property
p. 88
p. 89
Stream property
Methods
p. 86
p. 87
Length property
Raw property
p. 86
p. 90
p. 91
Build method
p. 91
Parse method
p. 91
85
Properties
This section presents the properties of the SecsMessage object.
Description property
Sets or returns a description of the SecsMessage object.
Syntax
SecsMessage.Description[ = DescriptionString ]
Notes
Default value
Data type
String
Function property
Sets or returns the SECS function number.
Syntax
SecsMessage.Function[ = Function]
Notes
Default value
Primary messages: 1
Secondary messages: 2
Data type
Integer
Item property
Returns an item object.
Syntax
SecsMessage.Item(ItemName)
SecsMessage.Item(ItemName, ItemNumber)
SecsMessage.Item( ItemNumber)
Notes
Data type
Length property
Returns the length, in bytes, of the binary data contained in the Raw
property.
Syntax
SecsMessage.Length
Notes
Data type
Name property
Sets or returns the name of the message.
Syntax
SecsMessage.Name[ = MessageName]
Item property
87
CHAPTER 5: SECSMESSAGE OBJECT
Notes
Default value
Data type
String
Raw property
Sets or returns the SECS message data as a binary memory image.
Syntax
SecsMessage.Raw[ = MessageData]
Notes
This property is useful if you want to examine the SECS message data
directly.
The value of this property is the result of the message being built
using the SecsItem objects contained in the message. A message build
is the result of a message Send. If there are no SecsItem objects in the
message (except the Root object which is always present) the Raw data
is transmitted without modification. The only way to send a headeronly SECS message is to construct a message with no SecsItems other
than the Root Item and set the Raw property to zero length array.
The binary image contains all of the SECS2 message data, but does
not include the SECS1 headers.
Default value
Empty Variant
Data type
RawHex property
Returns an ASCII representation of the Raw data, in hexadecimal
notation.
Syntax
SecsMessage.RawHex
Notes
Data type
Root property
Returns the root item for the message.
Syntax
SecsMessage.Root
Notes
The root item of a message is always a list item that represents the
complete SECS message data.
The Root item is special in a two ways:
1. It does not appear in the SECS message actually sent or received.
It serves as the parent of all SECS items at the top level in the
SECS message.
2. You cannot delete the Root item. Using the Delete method on the
Root item will cause a runtime error.
Normally, the Root item will either be empty (for a header only
message) or it will contain one SecsItem object. This is because the
SECS standard defines only messages that are either Header-only or
that contain exactly one item at the top level. If the SECS message
contains multiple items, they are always contained in a single top level
list item.
Although the SECS standard does not define messages with more
than one item at the top level, the syntax of the standard does not
prevent this. The following message is a syntactically correct SECS
message in SML notation:
S1F61
<U1 Var1>
<U2 Var2>
Notice that the two top level items are not contained in a list. The
SECS standard does not state that this is illegal, but it does go against
the implied conventions of the Standard.
WinSECS supports messages of this form and there are examples of
equipment in the field that use it. In the example above, the Root item
would contain two SecsItem objects.
Data type
Root property
89
CHAPTER 5: SECSMESSAGE OBJECT
Stream property
Sets or returns the SECS stream number.
Syntax
SecsMessage.Stream[ = StreamNumber]
Notes
Default value
Data type
Integer
Methods
This section presents the methods of the SecsMessage object.
Build method
Constructs the raw SECS message.
Syntax
SecsMessage.Build
Notes
This method builds the raw SECS message, but does not send it. You
can use this method to determine the length of the message before you
send it. The Build method updates the Length, Raw, and RawHex
properties of the SecsMessage object. SeeSECS message
construction on page 13.
The Build method can be useful for messages that require a Request/
Grant sequence. In the Request message, the size of the SECS
message to follow is normally sent. You can obtain this size
conveniently by first building the message to follow the Request/Grant
sequence using the Build method. Use the Length property of the
SecsMessage object to determine the actual size of the message. You
can then use this size in the Request message. No events (such as
PrimaryOut) are triggered by the Build method. A trappable runtime
error will occur if the build fails.
Parse method
Parses the raw SECS message
Syntax
SecsMessage.Parse
Notes
This method parses the raw SECS message and reconstructs the
contained SecsItem objects, as if the message had been received. The
Parse method updates the set of SecsItem objects contained in the
SecsMessage object.
The Parse method can be useful if you obtain a binary SECS message
in some fashion other than over the communication port. For
example, you may have a file containing a binary SECS message that
you want to parse. Read the contents of the file, then assign the Raw
property of the SecsMessage object to this binary data. Use the Parse
method to parse the message. The parse will proceed exactly as if the
message had been received over the serial port. No events (such as
PrimaryIn) are triggered by the Parse method. A trappable runtime
error will occur if the parse fails.
Build method
91
CHAPTER 5: SECSMESSAGE OBJECT
Chapter
6:
SecsItem Object
This chapter contains a reference for the SecsItem object properties
and methods. For an introduction to SecsItem objects, see SecsItem
object on page 9
A SECS item can contain either a list or a value.
A Root SecsItem object does not appear in the SECS message; it is
used as a parent for the SecsItem objects below. A header only
messages:SECS message is represented by a SecsMessage object that
contains only the Root SecsItem..
Properties
p. 94
Description property
Format property
Index property
Item property
p. 94
p. 96
p. 96
ItemCount property
Length property
Name property
NLB property
p. 97
p. 98
p. 99
p. 99
Value property
Methods
p. 97
p. 98
Parent property
Raw property
p. 94
p. 99
p. 101
AddNew method
p. 101
p. 101
93
Properties
This section presents the properties of the SecsItem object.
Description property
Sets or returns a description of the SecsItem object.
Syntax
SecsItem.Description[ = DescriptionString ]
Notes
Default value
Data type
String
Format property
Sets or returns the SECS format code for the item.
Syntax
SecsItem.Format[ = FormatConstant]
Notes
The format code governs the data representation of the item in the
SECS message as sent over the port. The WinSECS control object
defines constants that can be used for the Format property. These
constants are listed in the left column in the following table together
with valid values for the FormatConstant.
FormatConstant
Value
Description
wsFormatList
wsFormatBinary
wsFormatBoolean
wsFormatAscii
16
wsFormatJis8
17
wsFormatI2
26
wsFormatI1
25
wsFormatI8
24
wsFormatI4
28
wsFormatF8
32
wsFormatF4
36
wsFormatU8
40
wsFormatU4
44
wsFormatU2
42
wsFormatU1
41
wsFormatVar
63
wsFormatChar2
18
The SECS item format code is contained in the high 6 bits of the first
byte of the SECS item header. The low two bits of this byte indicate
the number of length bytes (NLB). The Format property contains the
value of the high 6 bits, treated as an integer. The Format property is
not affected by the value of NLB.
The wsFormatVar value is not a legal SECS format code and will never
be found in a SECS message that has been received and successfully
parsed. When a SECS message is constructed (as a result of the Send,
Receive, Reply, or Build methods), this value indicates that the SECS
format code should be derived from the type of Variant value found in
the Value property of the SecsItem.
For more information, see Data types on page 11 and Item
construction conversion process on page 14.
See the SECS standard for more information on format codes.
Example
If a SECS item is ASCII format and is 6 bytes long, the SECS item
header contains two bytes (shown in hex): 41 06. The second byte, 06,
is the length (6 characters). The first byte, 41, contains the SECS item
format code in the upper six bits and the NLB in the lower two bits.
The upper six bits have the value 010000 (binary) which means "ASCII
format", and the lower 2 bits have the value 01, which means one
length byte. Hence the first byte is 01000001 (binary) or 41 (hex). The
value of the Format property is 010000 (binary) or 16 (decimal).
Default value
wsFormatVar
Data type
Integer
Format property
95
CHAPTER 6: SECSITEM OBJECT
Index property
Returns the index for an item.
Syntax
SecsItem.Index
Notes
The index is the numeric position of the item within its parent item.
The first item within a parent item has an index of 1. The index of the
root item is 1. Reading this property for a deleted item produces a
runtime error.
Data type
Long, read-only
Item property
Returns the specified SECSItem object contained within this item.
Syntax
Notes
The SecsItem is searched recursively for an item that has the specified
name or index. Only list items contain other items, so this property is
never valid for a non-list item. If the first parameter is numeric, then it
is treated as an Index, otherwise it is treated as an ItemName. An
ItemName can be a variable or a quoted string.
If an ItemName is specified, the children of the SecsItem are searched
for a SecsItem with the specified name. See Item searching on
page 17, for a description of the search technique. The optional
Instance parameter specifies the instance (first, second, third, etc.) of
the ItemName within a given Parent item. If the Instance is specified,
the first item matching the ItemName and Instance within a single list
is returned. If the Instance is not specified, the first item with the
specified name is returned.
The Index parameter specifies the index to the desired item in the
Library, where the first item is at index 1. An Index applies only to the
immediate children of the SecsItem. If the Index parameter is
specified, the item with that index is returned. The Index must be
greater than zero and not greater than ItemCount. The Index
parameter allows you to iterate through all of the items defined in the
library.
If the specified item is not found, a trappable runtime error occurs
and a Null value is returned.
Case is not significant when searching for items, so svid will find
items named svid, Svid and SVID.
Example
Data type
ItemCount property
Returns the number of items in a SecsItem object representing a list.
Syntax
SecsItem.ItemCount
Notes
If the item is a list (format code 0), then the ItemCount property
returns the number of item objects defined in the list. If the SecsItem
is not a list, ItemCount returns 0.
Data type
Long, read-only
Length property
Returns the value of the length bytes in the SECS item header.
Syntax
SecsItem.Length
Notes
Default value
Data type
Long, read-only
ItemCount property
97
CHAPTER 6: SECSITEM OBJECT
Name property
Sets or returns the name of the item.
Syntax
SecsItem.Name[ = ItemName]
Notes
The Name property aids in selection of items from lists. If you create a
transaction based on a transaction defined in the default Library, then
all items in the transaction have names. These names are the same as
those defined in the SECS standard. If you create items using the
AddNew method, the name of the item is initially a zero length string.
An item is not required to have a name, but if it does not then you can
locate the item only by the numeric index in the Item property. If the
item has a name, you can locate the item by using the name as a
parameter to the Item property.
Case is retained in the ItemName, but is not significant when
searching for the SecsItem using the Item property.
Default value
Data type
String
NLB property
Sets or returns the number of length bytes for an item.
Syntax
SecsItem.NLB[ = NumberOfBytes]
Notes
The legal values for this property are 0, 1, 2, and 3. Setting this
property to any other value generates a runtime error. Setting this
property to 0 causes the number of length bytes to be set to the
minimum required to accommodate the item (1, 2, or 3). After parsing
a message, the NLB property for all SecsItems contained in the
SecsMessage object will have values 1, 2, or 3. Zero is not a legal value
in a SECS message.
Default value
Data type
Integer
Parent property
Returns the SECS item object that contains the SECS object.
Syntax
SecsItem.Parent
Notes
This property returns the Visual Basic constant Nothing for the Root
item. (No runtime error occurs in this case.) This property also returns
Nothing when applied to a SecsItem deleted by the Delete method. (A
runtime error does occur in this case.)
Data type
Raw property
Returns the SECS item data as a binary memory image.
Syntax
[ItemData=]SecsItem.Raw
Notes
Data type
Value property
Sets or returns the value of an item.
Syntax
SecsItem.Value [= expression]
SecsItem [= expression]
Notes
Parent property
99
CHAPTER 6: SECSITEM OBJECT
The Value property does not allow a subscript, so when working with
SECS array items in messages you have received you will need to use
a temporary variable to access the values.
Default value
Empty
Data type
Variant
Methods
This section presents the methods of the SecsItem object.
AddNew method
Adds a new item to a list item.
Syntax
Notes
The Index must be an integer greater than zero and not greater than
ItemCount + 1. An Index of 1 adds the new item at the start of the
list. An Index of ItemCount + 1 adds the new item to the end of the
list. This method automatically sets the Format property of the
SecsItem to 0 (wsFormatVar).
Delete method
Deletes an item.
Syntax
SecsItem.Delete
Notes
A deleted item does not appear in the SECS message. This is different
from an item with a value of Null or Empty. An item with a value of
Null or Empty appears in the SECS message as a zero length item. The
Root item cannot be deleted; deleting the Root item causes a runtime
error.
Duplicate method
Duplicates an item, inserting the duplicate after the item being
duplicated.
Syntax
[Item = ] SecsItem.Duplicate
Return value
The SecsItem object created.
AddNew method
101
CHAPTER 6: SECSITEM OBJECT
Notes
Appendix
A:
Examples
This chapter provides examples of WinSECS usage. If you create some
examples that you feel could benefit others, please send them to
Brooks Automation for consideration.
Transaction name display p. 104
Port test
p. 104
p. 104
p. 105
p. 106
p. 105
p. 107
p. 108
p. 110
p. 110
p. 111
p. 112
103
Port test
This example attempts to open the port and display a message
indicating whether or not the port was successfully opened.
To run this example, create a form that includes a WinSECS control
named WinSECS1. Add the following code to the form's Load event and
press F5.
On Error Resume Next
Err = 0
WinSECS1.OpenPort
If Err Then
MsgBox ("Unable to open port: " & Err.Description)
Else
MsgBox "Port opened successfully"
End If
WinSECS1.AutoBaud = True
WinSECS1.Baud = 9600
WinSECS1.SerialPort = "COM1"
elseif WinSECS1.PortType = wsPortTypeTCPIP then
' for SECS1-TCPIP ports
WinSECS1.IPAddressRemote = "255.255.255.1"
WinSECS1.IPPortRemote = 2400
elseif WinSECS1.PortType = wsPortTypeTELNET then
' for SECS1-TELNET ports
WinSECS1.IPAddressRemote = "255.255.255.1"
WinSECS1.IPPortRemote = 2008
else
' Must be HSMS...see HSMS Configure Example
endif
PrimaryOut secondaryin
This example creates a new transaction that conforms to the SECS
standard for the S1F1,S1F2 transaction. It then sends the S1F1
primary message. This code will cause the PrimaryOut and
SecondaryIn events to trigger. Each of these displays a message box
in this example.
To run this example, create a form that includes a WinSECS control
named WinSECS1. Add the following code to the form's Load event and
press F5.
Private Sub Form_Load()
Dim t As SecsTransaction
'create new empty transaction
Set t = WinSECS1.NewTransaction
' name the transaction
t.Name = "S1F1"
' name the contained messages
t.Primary.Name = "R"
t.Secondary.Name = "D"
' add an item to the Root
t.Secondary.Root.AddNew 1
' name the list item L
t.Secondary.Item(1).Name = "L"
' add an item to L
t.Secondary.Item("L").AddNew (1)
' name the item
t.Secondary.Item("L").Item(1).Name = "MDLN"
' add another item to L
t.Secondary.Item("L").AddNew (2)
' name the item
t.Secondary.Item("L").Item(2).Name = "SOFTREV"
t.Secondary.Item("MDLN").Format = wsFormatAscii
t.Secondary.Item("SOFTREV").Format = wsFormatAscii
' Set WinSECS in SimulateMode
WinSECS1.SimulateMode = True
' Send the Transaction
t.Send
End Sub
Private Sub WinSECS1_PrimaryOut(ByVal Trans As SecsTransaction,
ByVal ErrorCode As Long, ByVal ErrorText As String)
MsgBox "Sent primary message"
End Sub
Private Sub WinSECS1_SecondaryIn(ByVal Trans As
SecsTransaction, ByVal ErrorCode As Long, ByVal ErrorText As
String)
MsgBox "Received secondary message"
End Sub
New transaction
This example adds a new SecsTransaction to the Library, for a
hypothetical piece of equipment that supports an S1F63, S1F64
message pair. The SECS transaction to add has this the form:
S1F63
L,n
L,2
<SVID1>
<SVNAME1>
...
L,2
<SVIDn>
<SVNAMEn>
S1F64
L,n
L,2
<SV1>
<SVNAME1>
...
L,2
<SVn>
<SVNAMEn>
The example first selects the default library, then adds the new
transaction at a position just before the S2F1 message in the default
library. It then sets up the SecsTransaction properties, and properties
of the objects contained.
Dim NewIndex As Long
WinSECS1.Library.UseDefault
NewIndex = WinSECS1.Library.Transaction("S2F1").Index
WinSECS1.Library.AddNew NewIndex
WinSECS1.Library.Transaction(NewIndex).Name = "S1F63"
With WinSECS1.Library.Transaction("S1F63")
.Description = Description of Transaction
.Primary.Stream = 1
.Primary.Function = 63
.Secondary.Stream = 1
.Secondary.Function = 64
With .Primary
.Decription = Description of Message
.Root.AddNew (1)
.Root.Item(1).Name = "L"
.Root.Item(1).Description = Description of List
.Root.Item(1).AddNew (1)
.Root.Item(1).AddNew (2)
.Root.Item(1).Item(1).Name = "SVID"
.Root.Item(1).Item(2).Name = "SVNAME"
End With
With .Secondary
.Root.AddNew (1)
.Root.Item(1).Name = "L"
.Root.Item(1).AddNew (1)
.Root.Item(1).AddNew (2)
.Root.Item(1).Item(1).Name = "SV"
.Root.Item(1).Item(2).Name = "SVNAME"
End With
End With
Adding a secsitem
This example adds an item to a SecsItem object named MyItem which
is already contained in a list. The new item is added just after MyItem:
MyItem.Parent.AddNew(MyItem.Index + 1)
.Root.Item(1).Item(3).Item(1).Format = wsFormatAscii
.Root.Item(1).Item(3).Item(1).Value = "45"
.Root.Item(1).Item(3).Item(2).Name = "L"
For i = 1 To 12 Step 2
.Root.Item(1).Item(3).Item(2).AddNew (i)
.Root.Item(1).Item(3).Item(2).AddNew (i + 1)
.Root.Item(1).Item(3).Item(2).Item(i).Name = "TAGINFO"
.Root.Item(1).Item(3).Item(2).Item(i).Format = wsFormatAscii
.Root.Item(1).Item(3).Item(2).Item(i).Value = "LOT111"
.Root.Item(1).Item(3).Item(2).Item(i + 1).Name = "TAGINFO"
.Root.Item(1).Item(3).Item(2).Item(i + 1).Format =
wsFormatAscii
.Root.Item(1).Item(3).Item(2).Item(i + 1).Value = "PR"
Next i
End With
sx.Send
End Sub
End If
ElseIf Trans.Primary.Item(1).Item(2).Value = 0 Then 'pod
removed
If Trans.Primary.Item(1).Item(1).Value = 1 Then 'arm 1
lblStatus1 = "Idle"
ElseIf Trans.Primary.Item(1).Item(1).Value = 2 Then 'arm 2
lblStatus2 = "Idle"
End If
End If
Case "S6F11"
Select Case Trans.Primary.Item(1).Item(2).Value
'CEID value
Case 73
lblStatus1 = "Unlocked"
Case 74
lblStatus2 = "Unlocked"
Case 0
If lblStatus1 = "Buffer" Then
lblStatus1 = "Processing"
ElseIf lblStatus2 = "Buffer" Then
lblStatus2 = "Processing"
End If
Case Else
Debug.Print "CEID <> 73, 74, 0"
End Select
Case Else
Debug.Print "Message <> S100F7 or S6F11"
End Select
End Sub
Appendix
B:
Error Messages
This chapter lists the error messages that may be displayed when
errors occur in your WinSECS application. Suggestions for correcting
these errors are included. The errors are presented numerically.
Error 1001
You cannot change the Format of the Root item. The Root item Format
is always 0 (list).
The Root item is the parent item for all of the items contained in the
SECS message; the Root item must be a list item. The Root item does
not appear in the binary SECS message sent over the port.
Error 1002
Error 1003
Error 1004
A non-list item
A list item that contains no items (a zero length list)
See also Item Property, SecsItem Object
115
Error 1005
Error 1006
The item index value you have provided, index, is too small. Item
indexes must be 1 or greater.
An index of 1 selects the first item in the list, so the index value
cannot be less than 1.
Error 1007
There is no item with index index. The index must be between 1 and
ItemCount.
Error 1008
Error 1009
The item 'item name' is not defined within the parent item.
There is no item with this name. Check the spelling of the name. Also
remember that the Item property searches the SecsItem object to
which it is applied. It will search the entire message only if it is applied
either to the SecsMessage object or to the Root SecsItem object (these
are equivalent).
Error 1010
The first parameter you have provided, index, is too large. The value
must be no greater than ItemCount + 1.
The parameter you provided is a number, so WinSECS interprets it as
the index to the desired item. This index value must be not greater
than the number of items + 1.
Error 1011
You cannot set this property at this time. The transaction in which
this item is contained is in progress.
When a SecsTransaction is in progress, all properties of the
SecsTransaction and the objects it contains become read-only. This
SecsItem object is contained in an in progress SecsTransaction.
Error 1012
You cannot set this property at this time. The transaction in which
this message is contained is in progress.
When a SecsTransaction is in progress, all properties of the
SecsTransaction and the objects it contains become read-only. This
SecsMessage object is contained in an in progress SecsTransaction.
Error 1013
Error 1014
Error 1015
Error 1016
117
Error 1017
Error 1018
Error 1019
Error 1020
There are no transactions defined in the Library. You must either add
transactions you define yourself or use the UseDefault method to
create the default Library.
You have applied the Transaction property to the Library object, but
there are no SecsTransaction objects defined in the Library. You can
use the UseDefault method on the Library object to create the default
Library.
Error 1021
Error 1022
The transaction index value you have provided, index, is too small.
The index must be 1 or greater.
The transaction index passed to the Transaction property or AddNew
method must be 1 or greater. A value of 1 selects the first
SecsTransaction object.
Error 1023
Error 1024
Error 1025
Error 1026
The transaction index you provided, index, is too large. The index
must be not greater than TransactionCount + 1.
The index value must be between 1 and Library.TransactionCount.
The value 1 selects the first SecsTransaction object in the Library. The
value Library.TransactionCount selects the last SecsTransaction
object in the Library.
Error 1027
Error 1028
119
WinSECS has attempted to convert the Value to a string and this data
conversion failed. The Value cannot be represented as a string. Check
the Value property and ensure that it is a Value that can be converted
to a string representation.
Error 1029
Error 1030
Error 1031
Error attempting access of array variant value for item 'item name'.
Although the value of SecsItem appears to be defined as an array
variant, the actual array elements are either nonexistent or
inaccessible. This error will cause an ARRAY_ACCESS_ERROR.
Error 1032
See also
Object
Error 1033
Error 1034
Error 1035
Error 1036
Error 1037
121
bytes were found. You can use the RawHex property of the
SecsMessage object to examine the SECS2 message. To fix this
problem, you will have to correct the SECS message sent by the other
end of the SECS link. WinSECS cannot parse the message unless it
conforms to the SECS standard syntax.
Error 1038
Error 1039
Error 1040
The port is not open and the control is not in simulate mode. You
cannot use this method at this time.
You must either open the port using the OpenPort method or you
must put the WinSECS control in simulate mode by setting the
SimulateMode property to True.
Error 1041
The SECS port handler has given notice that a SECS message has
been sent, but the SECS control has no record of sending this
message.
Contact Brooks Automation Technical Support.
Error 1042
Error 1043
Error 1044
Error 1045
Error 1046
123
Error 1047
Error 1048
Error 1049
Error 1050
Error 1051
Error 1052
Error 1053
wsPortTypeRS232
wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET
2. An integer
Error 1054
Error 1055
Error 1056
Error 1062
Error 1063
Error 1064
125
Error 1065
Error 1066
Error 1067
Error 1068
Error 1069
Error 1072
Error 1073
Constant: wserrunknownsecondary
message.
Possible causes:
Error 1074
Error 1075
Error 1077
Error 1078
Error 1079
Error 1081
127
This is a serious error and indicates that the SECS port driver does
not have sufficient memory. You may need to increase the size of the
virtual memory available on the computer.
Error 1082
Error 1083
Error 1084
Error 1085
Error 1086
Error 1087
Error 1088
Error 1089
Error 1090
Error 1091
Error 1092
Error 1093
Error 1094
129
First determine if the SECS link to the equipment is intact. This error
indicates that the equipment did not respond to a request to transmit
a message. A disconnected cable or equipment is off line, can cause
this error.
If the link is intact, check the value of the RetryLimit property. If it is
less than 3, try setting it to 3 or more. Some equipment cannot
respond rapidly if it is busy. The product of RetryLimit and T3
determines the amount of time the equipment has to respond.
Error 1095
Error 1096
The WinSock DLL installed on your system does not support version
1.1. You must upgrade to version 1.1.
WinSECS uses certain WinSock features that are not present in
versions earlier than 1.1. You must obtain and install a more recent
version of the WinSock layer. Windows NT version 3.51 ships with the
proper version of WinSock. Your WinSock software has probably been
replaced by an older version.
Error 1097
Error 1098
Error 1099
The WinSock layer reports that the Local IP address used is not
supported on your computer.
You have used a value for the IPAddressLocal property which is not
valid for this computer. In other words, this is not the address of this
machine. Determine your actual IP address and use that value as the
IPAddressLocal property.
Error 1100
Error 1101
Error 1102
The WinSock layer reports that this local port type is not supported.
Contact Brooks Automation Technical Support.
Error 1103
The WinSock layer reports that this local port number is not
supported.
Contact Brooks Automation Technical Support.
Error 1104
You are using two ports in Passive or Alternating mode with the same
combination of IP address and Port number. This is not allowed.
Each port must have a unique combination of IP Address and Port
number.
Error 1105
WinSock reports that the local IP address used is not allowed on this
machine.
The WinSock layer has rejected the IP Address you have entered.
Verify that the local IP address of your machine matches the
IPAddressLocal property.
Error 1106
Error 1107
Error 1108
131
Error 1109
Error 1111
Error 1112
Error 1113
Error 1114
Error 1115
Error 1117
Error 1118
Error 1119
Error 1120
Error 1121
133
Error 1122
Error 1123
WinSock reports that the other side of the socket has shut down.
WinSECS will attempt to reconnect.
The remote HSMS entity has shut down its network connection. This
may be the result of an error detected at the remote entity. The
connection will be restarted, assuming the remote entity is willing.
Error 1124
Error 1125
The transaction index value you have provided, index, is too small.
Transaction indexes must be 1 or greater.
An index of 1 selects the first transaction in the library, so the index
value cannot be less than 1.
Error 1126
Error 1127
Error 1128
Error 1129
Error 1130
Error 1131
Error 1132
Error 1133
135
Error 1134
Error 1135
Error 1136
Error 1137
Error 1138
The Index passed as an argument to the Raw property for the item
was invalid.
The error typically means that the index being used to access data in
the raw property of the item is invalid. In Visual Basic, the Ubound
and Lbound function can be used to determine what indexes are valid.
Appendix
C:
Software Support
This section explains what to do when you have questions about, or
need assistance with, Brooks Automation software products.
What is Software Support?
p. 138
p. 140
p. 141
137
Comments
Your name, company and site or If you are a Brooks Automation employee, value added
location
reseller (VAR), or distributor, please indicate who the end
customer is, so that the issue can be logged under the
appropriate customer account. Provide any additional
information requested by the Software Support engineer.
Telephone number
E-mail address
Version information
If you are not sure about this information, see your System
Administrator.
Contact Information
Telephone
978-262-7970
<Product name>-support@brooks.com
(For example: Xsite-support@brooks.com)
Do not use your e-mail system's reply function
to send a message back. The return address
may not be the correct address for Software
Support.
Fax
978-262-2509
Attn.: <Product name> Software Support
(For example: Xsite Software Support)
Brooks Automation
Attn.: <Product name> Software Support
(For example:
Brooks Automation
Xsite Software Support
15 Elizabeth Drive
Chelmsford, MA 01824 USA)
Hours of operation
Call tracking
Escalation
Your issues and satisfaction are important to us. If you feel the issue
requires escalation, please contact the Software Support manager. If
this is a critical problem, you may request a Priority 1 (P1) response.
Other services
Brooks Automation offers additional support services and enhanced
versions of products to qualified customers.
Dial-in support
Other services
141
APPENDIX C: SOFTWARE SUPPORT
Index
A
AcceptDuplicateBlocks property
WinSECS controls 29
BaudIndex property
WinSECS controls 32
ActionOnError property
SecsTransaction objects 76
binary messages
constructing 15
ActionOnSuccess property
SecsTransaction objects 76
binary recipes
downloading 109
AddNew method
SecsLibrary objects 74
block numbers
unexpected 136
book
revision history ix
array items
converting 15
arrays
one-dimensional requirement 120
types 12
variants 12
AutoBaud property
avoiding baud rate mis-match 133
changing 31
WinSECS controls 30
AutoDevice property
WinSECS controls 31
AutoSystemBytes property
SecsTransaction objects 77
characters
discarding at data link level 134
RS-232 133
sending over communication ports 61
checksums
SECS1 135
Baud property
invalid values 123
WinSECS controls 32
ClosePort method
using while transaction in progress 127
WinSECS controls 57
baud rates
adjusting 30
invalid 123
mis-match 133
obtaining 36
property that controls 30
serial port 32
143
D
data link level
discarding characters 134
recoverable errors 69
data types 11
debugging
Visual Basic 2
WinSECS 2
DefaultDeviceID property
reading 31
WinSECS Version 2.7
WINSECS COM REFERENCE
device IDs
adjusting 31
DeviceID property
invalid values 124
SecsTransaction objects 78
dialogs
See modal dialogs.
document
revision history ix
CurrentConnectionMode property
WinSECS controls 36
Description property
SecsItem objects 94
SecsLibrary objects 72
SecsMessage objects 86
SecsTransaction objects 77
Connected property
HSMS ports 134
WinSECS controls 33
CurrentBaud property
WinSECS controls 36
Delete method
SecsItem objects 101
SecsTransaction objects 82
Disconnect events
WinSECS controls 61
connections
failures 132
HSMS 132 133
problems with 132
refusing 131
resetting 134
unspecified destination addresses 131
WinSECS controls 37
Connect events
WinSECS controls 60
ConnectionMode property
WinSECS controls 35
144
drivers
communication 135
SECS 129
Duplicate method
Root item problems 135
SecsItem objects 101
E
error handling procedures
identifying 76
error messages 115
ErrorConstants
WinSECS controls 38
errors
codes, defining 37 38
communication 68
data link level 69
internal logic 120
internal SECS library 128
memory 127
memory allocation 120
events
blocking with modal dialogs 22
button click 23
Connect 60
defining error codes to be passed in 37 38
2006 Brooks Automation, Inc.
Disconnect 61
Monitor 48, 61, 129
PrimaryIn 21, 63, 82
PrimaryOut 21, 65, 106
resulting from receipt of primary messages 21
resulting from Reply method 21
resulting from Send method 21
resulting from unsuccessful receipts of SECS1
messages 21
SecondaryIn 21, 66, 106
SecondaryOut 21, 67
SecsError 21, 68
SecsWarning 69
storing 22
system, creating 128
F
file descriptors
running out of 131
format codes 115
determining 11
illegal 121 122
obtaining 94
specifying 14
U8 125
Format property
determining type of SECS item array 12
SecsItem objects 11, 94
updating 14
forms
See modal forms.
function numbers 127
Function property
SecsMessage objects 86
setting to even values 123
valid values 117
G
GEM (Generic Equipment Model)
WinSECS and 1
H
High-speed SECS Message Services
See HSMS.
HSMS communication
breaking 61
connection mode 36
establishing 60
IP address of local nodes 43
IP address of remote nodes 44
IP Port number of local nodes 45
IP Port number of remote nodes 46
link test timers 47
links 2
ports, configuring 111
T3 timers 38
T5 timers 39
HSMS connections 132
closing 133
supported by WinSECS 2
HSMS messages
rejecting 133
HSMS ports
connecting to 134
HSMST3 property
invalid values 126
WinSECS controls 38
HSMST5 property
invalid values 126
WinSECS controls 39
HSMST6 property
inadequate 132
invalid values 126
WinSECS controls 39
HSMST7 property
inadequate 132
invalid values 126
WinSECS controls 40
HSMST8 property
inadequate 133
invalid values 126
WinSECS controls 41
I
IgnoreSystemBytes property
use when secondary messages are not received
129
WinSECS controls 41
images
binary memory, item data as 99
index codes
setting baud rates using 32
Index property
INDEX
145
SecsItem objects 96
SecsTransaction objects 78
InProgress property
effect on secondary messages 20
SecsTransaction objects 78
installing WinSECS 2
instance numbers 19
Interleave property
WinSECS controls 42
internal logic errors 120
IP addresses
local nodes 43
maximum length 126
remote nodes 44
unique 131
unsupported 130 131
IP Port numbers 45 46
IPAddressLocal property
invalid 131
invalid values 132
unsupported 130
WinSECS controls 43
IPAddressRemote property
invalid values 132
WinSECS controls 44
IPPortLocal property
invalid values 132
WinSECS controls 45
IPPortRemote property
invalid values 132
WinSECS controls 46
item arrays
one-dimensional requirement 120
item headers
constructing 15
length 97
NLB value 121
Item property
invalid input 116
invalid parameters 123
invalid Variant values 116
SecsItem objects 17, 96
SecsMessage objects 87
ItemCount property
SecsItem objects 97
146
items
attempting to locate 115
constructing 14
converting 11 12
data, as binary memory images 99
deleted 123
deleting 101
duplicating 101
format 11, 14, 119
format codes 11, 94
headers 15, 97, 121
length 15
names 98, 116
obtaining 87
Root 115, 127, 135
searching for 17
values 99
L
Length property
SecsItem objects 97
SecsMessage objects 87
updating 14 15
library
adding SecsTransaction objects to 108
customizing 4
deleting transactions from 82
initializing 4
restrictions on SecsTransaction objects in 117
118
transaction templates 2
Library property
WinSECS controls 47
Library.TransactionCount 118 119
link test timers
obtaining 47
valid values 127
LinkTestTimer property
WinSECS controls 47
M
memory
allocation failures 120
virtual, increasing 131
memory images
binary, item data as 99
messages
N
Name property
SecsItem objects 98
SecsMessage objects 87
SecsTransaction objects 79
networks
availability 130
components 130
NewTransaction method
invalid input 119
WinSECS controls 57
NLB (number of length in bytes) 115, 121
NLB property
SEC item header length 15
SecsItem objects 98
number of length in bytes
See NLB.
O
objects
initiating transactions 57
OLE automation objects 4
OpenPort method
WinSECS controls 58
P
Parent items
instance numbers 19
Parent property
SecsItem objects 99
Passive mode 131
PortIsOpen property
WinSECS controls 49
ports
See communication ports.
PortType property
invalid values 124
WinSECS controls 50
primary messages
building 53
default SECS device ID 37
even function number requirements 127
events occurring after transmission 21, 65
events occurring upon receipt of 63
expecting replies to 80
generating unique system bytes 77
object names 19
INDEX
147
PrimaryIn events
resulting from receipt of primary messages 21
triggering 82
WinSECS controls 63
PrimaryOut events
resulting from Send method, ReplyExpected False
21
resulting from Send method, ReplyExpected True
21
triggering 106
WinSECS controls 65
148
Primary property
SecsTransaction objects 79
properties
AcceptDuplicateBlocks 29
ActionOnError 76
ActionOnSuccess 76
AutoBaud 30 31, 133
AutoDevice 31
AutoSystemBytes 77
Baud 32, 123
BaudIndex 32
Connected 33, 134
ConnectionMode 35
CurrentBaud 36
CurrentConnectionMode 36
DefaultDeviceID 31, 37
Description 72, 77, 86, 94
DeviceID 78, 124
Format 11 12, 14, 94
Function 86, 117, 123
HSMST3 38, 126
HSMST5 39, 126
HSMST6 39, 126, 132
HSMST7 40, 126, 132
HSMST8 41, 126, 133
IgnoreSystemBytes 41, 129
Index 78, 96
InProgress 20, 78
Interleave 42
IPAddressLocal 43, 130 132
IPAddressRemote 44, 132
IPPortLocal 45, 132
IPPortRemote 46, 132
Item 17, 87, 96, 116, 123
ItemCount 97
R
Raw property 87
illegal values 136
invalid arguments 136
SecsItem objects 99
updating 14
RawHex property
examining SECS2 messages 122
SecsMessage objects 88
updating 14
Receive method
SecsTransaction objects 82
recipes
binary, downloading 109
multi-block, sending 109
replies
expecting 80
2006 Brooks Automation, Inc.
matching 41
receiving 105
reply messages
See replies.
Reply method
events resulting from 21
SecsTransaction objects 82
ReplyExpected property
events resulting when False 21
events resulting when True 21
SecsTransaction objects 80
RetryLimit property
exceeding 129
invalid values 124
WinSECS controls 51
revision history of book ix
Root items
attempting to change format 115
attempting to duplicate 135
deleting 127
problems duplicating 135
Root property
SecsMessage objects 89
RS-232 characters 133
RS-232 communication 104
RTY
See RetryLimit property. 51
S
S1F1 messages
example reply 64
primary 106
receiving 110
sending 105
S1F13 transactions 64
SECS formats
invalid 125
S1F14 transactions 64
S1F2 messages
SecsItem objects that represent 9
SECS hosts
WinSECS controls acting as 51
S9F1 messages
adjusting device IDs on receipt of 31
secondary messages
defining in simulate mode 53
events occurring upon receipt 66
events occurring upon transmission 67
hiding, in Visual Basic 23
SECS items
See items.
SECS standard 4
SECS stream numbers 90
INDEX
149
SECS transactions
See transactions. 4
SECS1 blocks
checksum problems 135
duplicate 136
unexpected block numbers 136
unexpected first block 136
SECS1 communication
links 2
ports 105
valid transport mediums 2
SECS1 data link protocol
RTY value 51
SECS1 messages
events resulting from 21
SECS2 messages
examining 122
SECS2 standard 2
SecsError events
after unsuccessful message receipt 21
WinSECS controls 68
SecsHost property
WinSECS controls 51
SecsItem objects
characteristics 4, 92
converting 14
Delete method 101
Description property 94
Duplicate method 101
Format property 11, 94
Index property 96
Item property 17, 96
ItemCount property 97
Length property 97
Name property 98
NLB property 98
Parent property 99
properties 10, 94
Raw property 99
root for SecsMessage objects 8, 85
Value property 11, 99
SecsLibrary objects
AddNew method 74
characteristics 4
Description property 72
Transaction property 72
TransactionCount property 73
UseDefault method 74, 118
150
SecsMessage objects
characteristics 4
constructing 13
Description property 86
Function property 86, 123
Item property 87
Length property 87
Name property 87
RawHex property 88
Root property 89
Stream property 90
translating into binary form 13
updating properties 14
SecsTransaction objects
accessing in library 6, 71 73
ActionOnError property 76
ActionOnSuccess property 76
adding to library 74, 108
applying properties to deleted 125
AutoSystemBytes property 77
blank 20
characteristics 4
creating 19
Delete method 82
Description property 77
DeviceID property 78
identifying 81
in progress 117
Index property 78
initiating transactions with 57
InProgress property 78
Name property 79
names 119
Primary property 79
problems associating errors with 68
Receive method 82
Reply method 82
ReplyExpected property 80
restrictions 117 118
Secondary property 80
Send method 83
SystemBytes property 81
Tag property 24, 81
templates 4
use when receiving primary messages 63
SecsWarning events
WinSECS controls 69
semaphores
creating 128
SEMI standards 1
2006 Brooks Automation, Inc.
Stream property
SecsMessage objects 90
valid values 117
system bytes
examining 81
generating unique 77
setting 81
using in reply matching 41
system events
creating 128
system requirements 2
system resources
exhausting while attempting to create semaphores
128
exhausting while attempting to create system
events 128
exhausting while attempting to open ports 128
SystemBytes property
SecsTransaction objects 81
T
T1 property
T2 timers
timeouts 134
T3 timers
HSMS communication 38
obtaining 55
timeouts 66, 127, 129
stream 9 messages 21
T2 property
invalid values 124
WinSECS controls 54
simulate mode
setting 122
T1 timers
obtaining 54
timeouts 135
T3 property
invalid values 124
WinSECS controls 55
sockets
connection failures 132
problems creating 131
shutting down 134
SerialPort property
specifying 128
WinSECS controls 52
SimulateMode property
WinSECS controls 53
T4 property
invalid values 124
WinSECS controls 55
T4 timers
obtaining 55
timeouts 135
T5 timers
HSMS communication 39
T6 timers
timeouts 132
T7 timers
timeouts 132
T8 timers
timeouts 133
Tag property
SecsTransaction object 24
SecsTransaction objects 81
TCP/IP
connections, breaking 61
enabling 130
loading properly 133
technical support 137
timers
link test 47, 127
T1 54, 135
T2 134
T3 38, 55, 127, 129
T4 55, 135
T5 39
INDEX
151
T6 132
T7 132
transaction indexes
converting 118
invalid 119, 134
valid values 134
transaction objects
representing SECS messages 2
Value property
converting 120
SecsItem objects 11, 99
Variant data type
array 12
problems 13
Variant values
invalid 116, 119
variants
arrays 12
converting type 11
Float 11
item formats 11
WinSECS Version 2.7
WINSECS COM REFERENCE
Visual Basic
debugging environment 2
hiding secondary messages 23
programming environment for SECS interfaces 22
TransactionCount property
SecsLibrary objects 73
UseDefault method
SecsLibrary objects 74, 118
VB Toolbox
incorporating WinSECS controls 2
vbLong 11
Transaction property
applying to SecsTransaction objects 118
invalid input 118
invalid Variant values 119
SecsLibrary objects 72
transactions 57
adding to library 108
allowing multiple open 48
converting indexes 118
deleting 82
in progress 117
initiating 57
names 79, 104
records 129
simplifying creation of 4
simultaneous outstanding 84
templates 2
using ClosePort method while in progress 127
152
W
window handles 127
Windows-compatible Semiconductor Equipment Communications Standard
See WinSECS
WinSEC library
See library.
WinSECS
as Visual Basic OLE custom control 2
data types 11
debugging feature 2
error messages 115
message construction 13
messages 2
objects 2
OLE automation objects derived from 4
WinSECS controls
adding into Visual Basic applications 3
adding to Visual Basic applications 2
appearance 3
AutoBaud property 30
AutoDevice property 31
Baud property 32
BaudIndex property 32
ClosePort method 57
Common Dialog 22
communication supported by 2
Connect events 60
Connected property 33
ConnectionMode property 35
constructing SecsMethod objects 13
CurrentBaud property 36
CurrentConnectionMode property 36
default message library 4
2006 Brooks Automation, Inc.
DefaultDeviceID property 37
design considerations 23
Disconnect events 61
ErrorConstants 38
HSMST3 property 38
HSMST5 property 39
HSMST6 property 39
HSMST7 property 40
HSMST8 property 41
IgnoreSystemBytes 41
Interleave property 42
IPAddressLocal property 43
IPAddressRemote property 44
IPPortLocal property 45
IPPortRemote property 46
Library property 47
LinkTestTimer property 47
Monitor events 61
MonitorEnable property 48
MultipleOpen property 48
NewTransaction method 57
OpenPort method 58
PortIsOpen property 49
PortType property 50
PrimaryIn events 63
PrimaryOut events 65
RetryLimit property 51
SecondaryIn events 66
SecondaryOut events 67
SecsError events 68
SecsHost property 51
SecsWarning events 69
SerialPort property 52
SimulateMode property 53
storing events 22
T1 property 54
T2 property 54
T3 property 55
T4 property 55
WinSECS Help
setting up 112
WinSock DLL 130
WinSock layer
out of buffers 131
out of file descriptors 131
reporting network availability 130
reporting network problems 130 132, 134
uninitialized 130
WinSock library (WSOCK32.DLL)
problems locating 133
INDEX
153
154