Win Secs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 164

WinSECS 2.

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.

Brooks Automation, Inc.


15 Elizabeth Drive
Chelmsford, MA 01824
Printed: September 2006

Restricted Rights Legend


If Licensee is or acts on the behalf of a U.S. Government agency, use of the accompanying
software is governed by the Software License Agreement which, (including the Exhibits and
Schedules thereto), constitutes the entire agreement between the parties and is binding on
Government users in accordance with the policy stated at Federal Acquisition Regulation (FAR) [48
CFR] 12.212 (for non-defense agencies) or Defense FAR Supplement (DFARS) [48CFR 227.7202.1]
(for defense agencies).

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.

CELLworks, STATIONworks, FACTORYworks, CELLman and CELLguide are registered trademarks of


Brooks Automation, Inc. in the United States and/or other countries.
CELLtalk, WinClient, TOM, FASTcontroller, Remote Controller, Xsite and E!F Integration Framework
are trademarks of Brooks Automation, Inc. in the United States and/or other countries.
All other trademarks and registered trademarks contained herein are the property of their respective
owners.

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

CurrentBaud property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36


CurrentConnectionMode property . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
DefaultDeviceID property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
EncodingCode property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
ErrorConstants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
HSMST3 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
HSMST5 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
HSMST6 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
HSMST7 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
HSMST8 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
IgnoreSystemBytes property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Interleave property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
IPAddressLocal property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
IPAddressRemote property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
IPPortLocal property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
IPPortRemote property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
Library property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
LinkTestTimer property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
MonitorEnabled property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
MultipleOpen property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
PortIsOpen property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
PortType property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
RetryLimit property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
SecsHost property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
SerialPort property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
SimulateMode property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
T1 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
T2 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
T3 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
T4 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55
Methods
ClosePort method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
NewTransaction method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
OpenPort method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
Events
Connect event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
Disconnect event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Monitor event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
PrimaryIn event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
PrimaryOut event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
SecondaryIn event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
SecondaryOut event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
SecsError event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
SecsWarning event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69

iv WinSECS Version 2.7

WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

vi WinSECS Version 2.7

WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

2.7 September 2006 Added CodePage property and EncodingCode

property in Properties section of WinSECS OLE


Control. Updated T3 property and HSMST3
property in Properties section of WinSECS OLE
Control. Updated Format property in the
Properties section of SecsItem Object.
2.5 February 2003

None.

2.5 November 2002

Formatting changes and minor edits (no content


changes).

2.5 October 2001

Converted to new formatting. No other major


changes.

ix

WinSECS Version 2.7

x WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

About This Book


This book describes the WinSECS Active X control, and provides an
alphabetical listing of its objects, properties, methods, and events.
Information included in this book
Notation conventions

p. xi

p. xi

Information included in this book


The first chapter of this book includes an overview of the objects that
make up WinSECS, SECS message construction, searching, parsing,
and data types. Later sections contain information about using:

The SecsLibrary object, which contains message templates that


help you to construct SECS messages.

SecsTransaction objects, which represent a primary and


secondary SECS message sequence.

SecsMessage objects, which represent a SECS message.


SecsItem objects, which contain the lists or values within a SECS
message.

Examples and error codes.

Notation conventions
WinSECS documentation uses the following typographic conventions:
Convention

Example

Description

Monospace font

Sample code

Used for code, replies and filenames.

Apostrophe in sample code SomeComment An apostrophe is used to indicate a line of


code comment.
A space with an
underscore

code _
moreCode

A space with an underscore indicates


continuation of a line of code on the next
line.

xi

WinSECS Version 2.7

xii WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Adding WinSECS to your Visual Basic application p. 3


Instructions for Visual Basic 6.0 p. 3
Incorporating the WinSECS control in your application
Keeping the .oca file available p. 3
WinSECS objects

p. 3

p. 4

SecsLibrary object: the message library p. 4


SecsTransaction object p. 7
SecsMessage object
SecsItem object

p. 8

p. 9

Data types p. 11
Array items p. 12
Potential conversion problems

p. 13

SECS message construction p. 13


Item construction conversion process p. 14
Binary message construction process p. 15
Item searching

p. 17

SECS message parsing


Event sequences

p. 19

p. 21

Issues when using Visual Basic p. 22


Event blocking with modal dialogs p. 22
Handling secondary messages in Visual Basic

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

WinSECS Version 2.7

2 WINSECS COM REFERENCE

To run WinSECS you must have the system setup described in the
WinSECS ReadMe. Follow the installation instructions in that
document before proceeding.

2006 Brooks Automation, Inc.

Adding WinSECS to your Visual Basic application


There are a few simple steps to add WinSECS to your Visual Basic
application.

Instructions for Visual Basic 6.0


f To add WinSECS to your Visual Basic application:
1. From the Project menu, choose Components. The Components
dialog box displays a list of the available custom controls, forms,
and insertable objects.
2. From the Controls menu, click the FASTech WinSECS Control
check box and choose the OK button to close the Components
dialog box. The FASTech WinSECS control, as shown below,
appears in your project toolbox.

Incorporating the WinSECS control in your application


To incorporate the WinSECS control in your application, double click
on it or drag. The control will be placed on your form.
Once you have the control on the form, use standard VB coding
practices to build the interface by filling in the desired Event Handlers
and setting the control Properties.
During runtime, the control is invisible.

Keeping the .oca file available


If you prepare an executable under Visual Basic that will be
distributed to other machines, make sure that the WinSECS.oca file is
available to the executable (in the same directory as WinSECS.ocx).

Adding WinSECS to your Visual Basic application


3
CHAPTER 1: INTRODUCTION TO WINSECS

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

A set of SecsTransaction objects. The Message


Library supplied with WinSECS contains
templates for the entire SECS standard.

SecsTransaction

Represents an Order or Reply pair, such as S1F1,


S1F2. Every SecsTransaction consists of a Primary
and a Secondary SecsMessage object.

SecsMessage

Represents a single (Primary or Secondary) SECS


message, such as S1F1. Consists of a Root
SecsItem object and SecsItem objects for the
message content.

SecsItem

Represents an item in a SECS message, such as


MDLN.

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.

SecsLibrary object: the message library


The WinSECS control is supplied with a default Message Library
(SecsLibrary object) which contains the entire SECS standard. This
default SecsLibrary object contains a set of pre-defined templates of
SecsTransaction objects for the entire SECS standard. The items
contained in the primary and secondary messages of each SECS
transaction are already created for you.
You can use the default library, which contains all of the messages in
the SECS standard, or you can customize it with transactions you
define yourself. In addition to picking pre-defined message templates
from the default Library, the Message Library can be customized to
suit your needs. You can copy the Library and include only those
messages that are common to the applications that you develop. You
can modify messages to suit your application. You can also add new,
non-standard messages to the Library.
The use of the Library is not required, but it does simplify the creation
of a SECS transaction. The Library lets you define those messages
supported by your equipment. You can also modify the
SecsTransaction objects in the library to suit your needs. When you
WinSECS Version 2.7

4 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

use the NewTransaction method in preparation for sending a message,


you can specify a library transaction to duplicate. This saves you the
effort of constructing the SecsTransaction object manually each time
you want to use it.
For example, the S1F1,F2 transaction in the SECS standard is defined
in this library as follows:
S1,F1 Are you there request (R)
S1,F2 On Line Data (D)
L,2
1. <MDLN>
2. <SOFTREV>

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 object: the message library


5
CHAPTER 1: INTRODUCTION TO WINSECS

You access the SecsTransaction objects in the Library using the


Transaction Property of the Library object. This property accepts
either the name of the SecsTransaction object or its index in the
Library, as shown in the following figure:

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.

WinSECS Version 2.7

6 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

The following properties and methods are associated with


SecsTransaction objects:

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

To send a primary message, you must create a new SecsTransaction


object using the NewTransaction method of the WinSECS control
object. When a primary SECS message is received, WinSECS creates a
new SecsTransaction object automatically and passes it to the
PrimaryIn event handler of the WinSECS control.
For more information on syntax of SecsTransaction objects, see the
reference chapter SecsTransaction Object on page 75.

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)

WinSECS Version 2.7

8 WINSECS COM REFERENCE

SecsItem
Name = L
SecsItem
Name = MDLN
SecsItem
Name = SOFTREV

2006 Brooks Automation, Inc.

The following properties and methods are associated with


SecsMessage objects:

Description property

Build method

Function property

Parse method

Item property

Length property

Name property

Raw property

RawHex property

Root property

Stream property

For more information on syntax of SecsMessage objects, see the


reference chapter SecsItem Object on page 93.

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

A header only messages:SECS message is represented by a


SecsMessage object that contains only the Root SecsItem.
The following properties and methods are associated with SecsItem
objects:

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.

WinSECS Version 2.7

10 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

SECS item format

vbNull, vbEmpty Item is zero length in SECS message


vbLong

wsFormatI1, wsFormatI2, wsFormatI4,


wsFormatU1, wsFormatU2, wsFormatBoolean

vbSingle

wsFormatF4

vbDouble

wsFormatF8, wsFormatI8, wsFormatU4,


wsFormatU8

vbString

wsFormatBinary, wsFormatAscii, wsFormatJis8

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:

For incoming messages, the SECS array item is converted to an

array Variant. The type of each element in the array is the same
and is governed by the rules above.

For outgoing messages, the type of the SECS item array is

determined by the Format property. However, the Format property


may not be wsFormatList, wsFormatAscii, wsFormatJis8, or
wsFormatBinary. SECS does not allow arrays of those types,
because the values in the array must be resolvable to a numeric
value.

WinSECS Version 2.7

12 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Potential conversion problems


Although the Variant data type does a good job representing most of
the SECS data formats, there are a few problem areas:
Integer representations

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

When sending a Boolean item, the value of the item is converted to a


four-byte integer and the low byte of the integer is sent. You should
make sure that the low byte is zero if you intend a False value, and
non-zero if you do not. A safe practice is to use the Visual Basic
keywords True and False.

SECS message construction


Message construction is the process of translating a SecsMessage
object into the binary form that is actually sent over the port. During
message construction, the properties of the SecsMessage object (and
the SecsItem objects contained) can change. If message construction
completes successfully, the binary message then becomes scheduled
for transmission over the port. Successful completion of the Send or
Reply method does not mean that the message has been transmitted.
It just indicates that the construction was successful and the message
has been scheduled for transmission. When the message is
successfully sent over the port, the PrimaryOut or SecondaryOut
event is triggered. This event notifies your application that the
transmission is complete.
SECS messages are constructed when you use the Send, Reply, or
Build methods. The construction is done by WinSECS and requires no
interaction from the user.
The WinSECS control constructs a primary SecsMessage object when
the Send method is used. The WinSECS control constructs a
secondary SecsMessage object when the Reply method is used. When

SECS message construction


13
CHAPTER 1: INTRODUCTION TO WINSECS

the Build method is used, whatever SecsMessage object it is applied to


is constructed. The following steps occur during message
construction:
1. Each SecsItem object is converted to its binary value, according to
the item construction conversion rules (discussed in the following
section, Item construction conversion process on page 14).
2. The Format and Length properties for each SecsItem object in the
message are updated to reflect the result of the message
construction (see Item construction conversion process on
page 14).
3. The binary message is constructed using the converted values for
each item, according to the binary message construction rules
(discussed in the section Binary message construction process
on page 15).
4. The Raw, RawHex, and Length properties of the SecsMessage
object are updated to reflect the result of the message construction
(see Binary message construction process on page 15).

Item construction conversion process


The following steps occur during item construction:

1. Determine format code for item


If you specify any format code for the item other than wsFormatVar,
that format code is used for the item. If you have specified
wsFormatVar, the format code is determined from the type of the
Value. If the Value is an array, wsFormatI4 is used. Otherwise, the
item format is determined as follows:
Value type

VarType

SECS format used

vbInteger

wsFormatI2

vbLong

wsFormatI4

vbSingle

wsFormatF4

vbDouble

wsFormatF8

vbCurrency

wsFormatF8

vbBoolean

11

wsFormatBoolean

vbByte

17

wsFormatU1

All others

WinSECS Version 2.7

14 WINSECS COM REFERENCE

wsFormatAscii

2006 Brooks Automation, Inc.

2. Convert value of item to format


Conversion of the Value to the desired output format is done using the
standard conversion rules for Variant data. If this conversion fails for
any SecsItem within the message, message construction is
unsuccessful.
Array items are converted like other items, except that the conversion
happens for each element of the array. Arrays in SECS can contain
only numeric or Boolean values (even though Variant arrays in Visual
Basic can also contain strings and other arrays). An error will result if
an array item contains an element that cannot be converted to a
numeric value.
If the value of an item is Null, the SECS format code for the item is
determined as for any other item. This means that if the Format
property is wsFormatVar, the SECS format code is ASCII.

3. Create binary SECS data


The binary SECS data is created from the converted value.

4. Update length property of item


The length of the item is the number of bytes in the binary
representation created. For numeric values, this will be a multiple of
the length implied by the format code. For string values (including
formats wsFormatAscii, wsFormatJis8, and wsFormatBinary) the
length is the number of bytes in the string.
If the value of an item is Null, the SECS item generated is of length
zero.

Binary message construction process


The following steps occur during binary message construction:

1. The SECS item header is constructed.


The SECS item header contains:

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).

SECS message construction


15
CHAPTER 1: INTRODUCTION TO WINSECS

2. If the item is a list, each item in the list is constructed.


(See the previous discussion about the Item construction conversion
process on page 14.)

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.

WinSECS Version 2.7

16 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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)

when applied to the SecsItem named waf will fail.

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)

will return the circled item.

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.

WinSECS Version 2.7

18 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

If you give an Instance number as the second parameter to the Item


Property, it applies within a given Parent item: it is the instance of the
item within a list, not the instance within the entire search. In the
figure below,
waf.Item(X, 2)

will return the circled item.

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.

SECS message parsing


SECS message parsing occurs when a SecsTransaction object is
created with SecsMessage and SecsItem objects corresponding to the
structure of the SECS message received. For Primary messages,
WinSECS assigns names to the new objects using the names from the
SecsTransaction with the same Stream and Function in the Library.
For Secondary messages, WinSECS assigns names to the new objects
using the InProgress property of the SecsTransaction object. Parsing
is done by WinSECS and requires no interaction from the user.

SECS message parsing


19
CHAPTER 1: INTRODUCTION TO WINSECS

The following steps occur when a SECS message is received:


Determine type of
message

1. If the value of the Function property is odd, the message is a


primary message. If it is even, it is a secondary message.

Determine type of
transaction

2. If the message is a Primary message, the WinSECS control


searches the Library for the first transaction with a primary
message with matching Stream and Function values. If such a
transaction is found, it is copied and used for parsing the message.
If a matching transaction is not found, a blank SecsTransaction
object is created.
3. If the message is Secondary, the list of InProgress transactions is
searched. The message is matched against the InProgress
transactions based on either the system bytes (if
IgnoreSystemBytes is False), or against the DeviceID, Stream, and
Function (if IgnoreSystemBytes is True). If a matching transaction
is found, it is removed from the list of InProgress transactions by
setting its InProgress property to False. Otherwise a blank
transaction is created. This transaction is used in parsing.

Parse message items

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

WinSECS Version 2.7

20 WINSECS COM REFERENCE

7. If the parse is the result of an incoming message (instead of the


Parse method), the resulting SecsTransaction object is passed to
the PrimaryIn or SecondaryIn event.

2006 Brooks Automation, Inc.

Event sequences
When the Send or Reply methods are used, events described in the
following tables can occur:

Note WinSECS does not automatically send stream 9 messages.


These messages are the responsibility of the users. However, if
AutoDevice property of the WinSECS control is set to True WinSECS
will use the S9F1 message to adjust its DefaultDeviceID property.
Event Resulting from Send Method, ReplyExpected False
Event

Condition

PrimaryOut

Triggered when the primary message is either


successfully sent or the send attempt fails

Events Resulting from Send Method, ReplyExpected True


Event

Condition

PrimaryOut

Triggered when the primary message is either


successfully sent or the send event fails. The
SecondaryIn event will later trigger if ErrorCode is
zero.

SecondaryIn Triggered when the secondary message is either


received, a T3 timeout occurs, or the reply was
partially received.
Event Resulting from Reply Method
Event

Condition

SecondaryOut

Triggered when the secondary (reply) message is


either successfully sent or the send attempt fails

Events Resulting from Receipt of a Primary Message


Event

Condition

PrimaryIn

Triggered when a primary message is successfully


received. ErrorCode is zero if the message is parsed
without error, otherwise it is non-zero.

Events Resulting from Unsuccessful Receipt of Any Message at SECS1 Level


Event

Condition

SecsError

Triggered when an incoming message cannot be


received because of SECS1 level errors

Event sequences
21
CHAPTER 1: INTRODUCTION TO WINSECS

Issues when using Visual Basic


Visual Basic is the programming environment for SECS interfaces
using the WinSECS OLE control. There are two issues you should
keep in mind while building your programs in this environment:

Event blocking with modal dialogs


Handling secondary messages

Event blocking with modal dialogs


Visual Basic (and other OLE control containers) will not accept Events
when a modal dialog is displayed. Such dialogs are displayed by the
MsgBox function and the Common Dialog control. ( Other custom
controls can display modal dialogs as well.) This means that the
Event procedures, such as the PrimaryIn Event, will not be triggered.
This condition will persist until the modal dialog is closed. The
WinSECS control reacts to this condition by storing the Events. When
the modal dialog box is closed, Visual Basic informs the WinSECS
control that it is now able to process Events. WinSECS then issues all
of the Events that it stored while the dialog was displayed. Hence, the
Events are not lost, but they are delayed until the dialog box is closed.
This behavior can have adverse effects in your application. If you
display a modal dialog, your application will not be able to process
incoming messages until the dialog is closed. In fact, none of the
Visual Basic code in your application will run until the dialog box is
closed. You can see that this may well cause reply timeouts if the
equipment issues a primary message while your application is
displaying a modal dialog.
How can you avoid this problem? The simple answer is not to use
modal dialogs. Interestingly, this problem does not occur with modal
forms. In the case of the MsgBox function, it is fairly simple to
construct a Visual Basic modal form that does the same job. This
becomes more difficult with the Common Dialog control. Creating
these dialogs as modal forms is possible, but it is a bigger job. You are
faced with the decision to code a modal form to do the job, disable the
dialog when your application is communicating with the equipment,
or to use some more elaborate application level change to avoid the
problem.
There are other times when Visual Basic cannot process Events.
These include
1. When a breakpoint is reached in the Visual Basic debugger.
2. When an untrapped error causes Visual Basic to display an error
dialog.
3. When a modal dialog is displayed by any control or by the MsgBox
function.

WinSECS Version 2.7

22 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Handling secondary messages in Visual Basic


Consider a simple application that will display the value of the
chamber pressure in a plasma etcher and update that value each time
the user clicks a button. To accommodate this need, you create a form
with a text box to contain the pressure and a button. In the button
click event, you want to write code to query the etcher for the chamber
pressure and display the value in the text box. Also suppose that we
can ask the etcher for the chamber pressure using an S1F3
transaction, with SVID = 15. If the WinSECS control is named
WinSECS1, the button is named PressureButton, and the text box is
named PressureText, then you want to write the following code:
Sub PressureButton_Click ( )
Dim Trans As SecsTransaction
Set Trans = WinSECS1.NewTransaction("S1F3")
Trans.Primary.Item("SVID") = 15
'... send the primary and get the reply
PressureText = Trans.Secondary.Item("SV")
End Sub

The problem is that there is no way to ask the WinSECS control to


process the complete transaction in one line. The "send the primary
and get the reply" part of this code won't work. (Actually you could do
it by checking the InProgress property of the SecsTransaction object in
a loop, but that's not the right way!) Why didn't we design the
WinSECS control so you could do this? The answer of course is that
in the world of SECS communication you must be prepared to deal
with other events while this transaction is in progress. It's perfectly
legal for the equipment to send an alarm report while your transaction
is in progress. You probably also want to be able to handle user
commands while this transaction is in progress. Remember that a
SECS transaction may take many seconds to complete. You don't
want your application to "hang" while the equipment processes your
request. That's why the Send method does not complete immediately.
This lets your application go off and do other things while the SECS
communication is in progress. So, a better way to code this
application is:
Sub PressureButton_Click ( )
Dim Trans As SecsTransaction
Set Trans = WinSECS1.NewTransaction("S1F3")
Trans.Primary.Item("SVID") = 15
Trans.Send
End Sub
Private Sub WinSECS1_SecondaryIn(ByVal Trans As _
SecsTransaction, ByVal ErrorCode As Long, ByVal ErrorText As
String)
PressureText = Trans.Item("SV")
End Sub

Issues when using Visual Basic


23
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

WinSECS Version 2.7

24 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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.

Issues when using Visual Basic


25
CHAPTER 1: INTRODUCTION TO WINSECS

WinSECS Version 2.7

26 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

WinSECS Version 2.7

28 WINSECS COM REFERENCE

p. 69

2006 Brooks Automation, Inc.

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

[form.]WinSECSn.AcceptDuplicateBlocks[ = { True | False }]

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

IgnoreSystemBytes Property, PortIsOpen Property, OpenPort Method,


PortType Property

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

[form.]WinSECSn.AutoBaud[ = { True | False }]

Notes

The WinSECS control uses the following algorithm when


automatically adjusting its baud rate:
1. The initial baud rate used is that specified by the Baud property.
2. If a data link protocol error occurs while a handshake character
(ENQ, EOT, ACK, or NAK) is expected at the SECS1 level, the
control adjusts its baud rate to the next setting in the list below:

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.

When using a WinSECS control to talk to another WinSECS control,


you should use the AutoBaud feature on only one of the controls for
best results.

WinSECS Version 2.7

30 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Baud Property, CurrentBaud Property, OpenPort Method,


PortIsOpen Property, PortType Property

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

[form.]WinSECSn.AutoDevice[ = { True | False }]

Notes

The S9F1 message is issued by the equipment when it receives a


message with an incorrect device ID. If this property is set to True, the
WinSECS control automatically sets the default device ID to the
correct value, as reported in the SECS1 header of the S9F1 message.
Set this property to True only if the equipment supports a single SECS
device ID. You can change the value of this property at any time;
changes to the value of this property affect the handling of any
subsequent S9F1 messages.
You can determine the default device ID in use at any time by reading
the DefaultDeviceID property.

Default value

True

Data type

Boolean

See also

DefaultDeviceID Property, DeviceID Property, SecsHost Property

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

AutoBaud Property, BaudIndex Property, CurrentBaud Property,


OpenPort Method, PortIsOpen Property, PortType Property

BaudIndex property
Sets or returns the baud rate using an index code.

Applies to

wsPortTypeRS232

Syntax

[form.]WinSECSn.BaudIndex [= BaudIndexCode ]

WinSECS Version 2.7

32 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Notes

The BaudIndex property is an alternative to the WinSECS control's


Baud property setting. The following table shows the relationship
between Baud and BaudIndex property values.
Baud Rate

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

AutoBaud Property, Baud Property, CurrentBaud Property,


OpenPort Method, PortIsOpen Property, PortType Property

CodePage property
Specifies the encoding scheme used by the tool to convert the SECS
Format 20 ASCII items.

Applies to

wsFormatAscii

Syntax

[form.]WinSECSn.Codepage [ = valid Code Page]

CodePage property
33
CHAPTER 2: WINSECS CONTROL

Notes

The CodePage property tells WinSECS the encoding scheme used by


the tool to interpret character strings. A value -1 indicates WinSECS
to use active code page for interpreting character strings. A value
other than -1 indicates WinSECS to use an alternate code page for
interpreting character strings.
The following table lists some of the valid windows pages.

CodePage

Description

932

Japanese Shift-JIS

936

Simplified Chinese GBK

949

Korean

950

Traditional Chinese Big5

If the value of the CodePage property is set to an invalid code page


then WinSECS throws a SECSError event at run time when it
attempts to carry out a conversion with the code page.

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

If the port is closed, the Connected property returns False.


If the port was opened with PortType = wsPortTypeRS232, the
Connected property returns True.
If the port was opened with PortType = wsPortTypeHSMS, the
Connected property returns True if the HSMS port is currently in the
Connected state and False otherwise.
If the port was opened with PortType = wsPortTypeTCPIP or
wsPortTypeTELNET, the Connected property returns True when a
valid connection has been established with a remote device (usually a
terminal server).

WinSECS Version 2.7

34 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

When using HSMS or SECS1 over TCPIP/TELNET, SECS message


transmissions will fail if the Connected property is False.
When using HSMS or SECS1 over TCPIP/TELNET (but not RS232),
the Connect event will fire when WinSECS sets the Connected
property to True (seeConnect event on page 60).
This property is read only at runtime and not available at design time.

Data type

Boolean (read only)

See also

Connect Event, ConnectionMode Property, OpenPort Method,


PortType Property

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

The remote entity establishes the


HSMS connection.

wsConnectionModeActive

WinSECS establishes the HSMS


connection.

wsConnectionModeAlternating

The connection mode alternates


between Passive and Active until a
connection is established.

Default value

wsConnectionModeActive

Data type

Long

See also

Connect Event, Connected Property, CurrentConnectionMode


Property,
OpenPort Method, PortType Property

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

AutoBaud Property, Baud Property, BaudIndex Property,


OpenPort Method, PortIsOpen Property, PortType Property

CurrentConnectionMode property
Returns the HSMS connection mode currently in effect.

Applies to

wsPortTypeHSMS

Syntax

[form.]WinSECSn.CurrentConnectionMode

Notes

If the port is open, the CurrentConnectionMode property returns the


HSMS connection mode currently in use. This is not necessarily the
same value as the ConnectionMode property when the port was
opened, if the ConnectionMode property was
wsConnectionModeAlternating when the OpenPort method was used.
The CurrentConnectionMode property will return the value of the
connection mode actually used when the connection was established.
If the port is not open, the CurrentConnectionMode property will
return the current value of the ConnectionMode property.
The value returned by this property will be one of the
ConnectionModeConstants, as described in ConnectionMode
property on page 35.

Data type

Long

See also

Connect Event, Connected Property, ConnectionMode Property,

WinSECS Version 2.7

36 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

OpenPort Method, PortType Property

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

AutoDevice Property, DeviceID Property, SecsHost Property

EncodingCode property
Specifies the encoding code used for SECS Format 22 items.

Applies to

wsFormatChar2

Syntax

[form.]WinSECSn.EncodingCode

Notes

The EncodoingCode property is read-only. WinSECS sets its value to


the value of code page used for Format 22 SECS items. While receiving
SECS items from the tool with Format 22, the 16 bit encoding code
received specifies WinSECS, the encoding scheme used by the tool.

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

Integer [read only]

ErrorConstants
Defines error codes that can be passed in events.

Notes

Several WinSECS events pass an ErrorCode as a parameter. Some of


these error codes are defined as constants by the WinSECS control.
These error codes are those that may be useful to test in your
application, allowing you to take corrective action in your program.
You can view available ErrorConstants by using the Object Browser in
Visual Basic. Rrefer to your Visual Basic User Manual for instructions
on how to select an ErrorConstant (from the WinSecsLib) using the
Object Browser. You can view a short description of the error, or click
a button to get more information about the ErrorConstant.
Error codes and constants are defined in Appendix B, Error
Messages.

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

WinSECS Version 2.7

38 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

See also

Connect Event, Connected Property, ConnectionMode Property,


HSMST5 Property, HSMST6 Property, HSMST7 Property,
HSMST8 Property, OpenPort Method, PortType Property

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

Connect Event, Connected Property, ConnectionMode Property,


HSMST3 Property, HSMST6 Property, HSMST7 Property,
HSMST8 Property, OpenPort Method, PortType Property

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

The T6 value specifies the time which a control transaction can


remain open before it is considered a communications failure. This
property sets or returns the T6 control 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

Data type

Long

See also

Connect Event, Connected Property, ConnectionMode Property,


HSMST3 Property, HSMST5 Property, HSMST7 Property,
HSMST8 Property, OpenPort Method, PortType Property

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

Connect Event, Connected Property, ConnectionMode Property,


HSMST3 Property, HSMST5 Property, HSMST6 Property,
HSMST8 Property, OpenPort Method, PortType Property

WinSECS Version 2.7

40 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

HSMST8 property
Sets or returns the T8 timer value for HSMS communicationsHSMS
communicationsHSMS connections.

Applies to

wsPortTypeHSMS

Syntax

[form.]WinSECSn.HSMST8[ = TimerValue]

Notes

The T8 value specifies the maximum time between successive bytes of


a single HSMS message which may elapse before it is considered a
communications failure.This property sets or returns the T8 network
intercharacter timeout value (in seconds) for the HSMS protocol. The
value of TimerValue must be in the range of 1 to 120.
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

See also

Connect Event, Connected Property, ConnectionMode Property,


HSMST3 Property, HSMST5 Property, HSMST6 Property,
HSMST7 Property, OpenPort Method, PortType Property

IgnoreSystemBytes property
Determines whether or not the SECS system bytes are used in reply
matching.

Applies to

wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

[form.]WinSECSn.IgnoreSystemBytes[ = { True | False }]

Notes

If this property is False, an incoming secondary message is matched


to its SecsTransaction object by examining the system bytes. The
system bytes of the incoming secondary message are compared to the
system bytes of all in-progress SecsTransactions. The incoming
secondary message is matched to the first SecsTransaction object that
is in progress and has matching system bytes.

HSMST8 property
41
CHAPTER 2: WINSECS CONTROL

If this property is True, the matching is performed using the DeviceID,


DeviceStream,and Function properties. The DeviceID and Stream
properties of the incoming secondary message are compared to the
DeviceID and Stream properties of all in-progress SecsTransactions. A
match is successful if the DeviceID and Stream properties match, and
the Function of the incoming message is either zero or one greater
than the in-progress transaction.
You should set this property to True only if the equipment does not
reliably set the system bytes in reply messages to those received in the
primary message.
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, OpenPort Method, PortIsOpen


Property,
PortType Property

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

[form.]WinSECSn.Interleave[ = { True | False }]

Notes

Interleaving means that blocks from one SECS message may be


alternated with blocks from another SECS message. This behavior is
desirable if the equipment supports long messages because it allows
short messages to be interspersed with longer messages.
Many equipment types do not support interleaving. Set this property
to True only if the equipment supports interleaved blocks.
The WinSECS control always supports interleaved blocks as a
receiver.

WinSECS Version 2.7

42 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

MultipleOpen Property, OpenPort Method, PortIsOpen Property,


PortType Property

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

Alternatively, you may use a host name string as the IP address.


WinSECS will resolve this host name to the IP address automatically.
This feature will work only if your network supports host name
resolution.
You may not choose this address at random. It must correspond to an
IP address that is assigned to your computer. If you do not know your
IP address you can look in the Control Panel, under the Network topic.
Examine the properties of the TCP/IP service.
On NT systems, the value 0.0.0.0 is interpreted by the operating
system as equivalent to your actual IP address.
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.0.0.0

Data type

String

IPAddressLocal property
43
CHAPTER 2: WINSECS CONTROL

See also

Connect Event, Connected Property, ConnectionMode Property,


IPAddressRemote Property, IPPortLocal Property, IPPortRemote
Property,
OpenPort Method, PortType Property

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

This property sets or returns the IP address used to designate the


remote node (the remote HSMS entity, or terminal server connected
via RS232 to a SECS1 entity) for HSMS and SECS1 -TCPIP/TELNET
connections.
The IPAddress is a string of the form
XXX.XXX.XXX.XXX

Alternatively, you may use a host name string as the IP address.


WinSECS will resolve this host name to the IP address automatically.
This feature will work only if your network supports host name
resolution.
You may not choose this address at random. It must correspond to
the IP address of the remote computer to which you intend to
establish an HSMS connection. If you do not know the IP address of
the remote computer you should check with your network
administrator.
For HSMS, the IP address of the remote device is used only when the
ConnectionMode is wsConnectionModeActive or
wsConnectionModeAlternating. In Passive mode, the remote entity
establishes the connection. In that case the remote entity must
connect to the IP address you specify in the IPAddressLocal property.
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 IPPortRemote
Property, are used instead of the SerialPort property.

WinSECS Version 2.7

44 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Connect Event, Connected Property, ConnectionMode Property,


IPAddressLocal Property, IPPortLocal Property, IPPortRemote
Property,
OpenPort Method, PortType Property

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

Connect Event, Connected Property, ConnectionMode Property,

IPPortLocal property
45
CHAPTER 2: WINSECS CONTROL

IPAddressLocal Property, IPAddressRemote Property,


IPPortRemote Property, OpenPort Method, PortType Property

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

Connect Event, Connected Property, ConnectionMode Property,


IPAddressLocal Property, IPAddressRemote Property, IPPortLocal
Property,
OpenPort Method, PortType Property

WinSECS Version 2.7

46 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Library property
Returns the library property associated with the control.

Applies to

wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

[form.]WinSECSn.Library

Notes

When your application starts, the Library is initially empty, meaning it


contains no SecsTransaction objects. The Library property will always
return a SecsLibrary object, even though that object may contain no
SecsTransactions. You add SecsTransaction objects to the Library
using the AddNew or UseDefault methods for the Library object.
The Library is useful to store transactions that you use in more than
one location in your code. If you add SecsTransaction objects to the
Library, you can create a new copy of a transaction by specifying the
transaction name or index in the NewTransaction method.
This property is read only at runtime and not available at design time.

Data type

SecsLibrary object, read only

See also

SecsLibrary Object, SecsTransaction Object

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

[form.]WinSECSn.MonitorEnabled[ = { True | False }]

Notes

If this property is True, Monitor events are triggered when characters


are sent or received over the physical port. If you change this property
when the port is open, the change will be effective immediately. You do
not have to close and reopen the port.

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

WinSECS Version 2.7

48 WINSECS COM REFERENCE

[form.]WinSECSn.MultipleOpen[ = { True | False }]

2006 Brooks Automation, Inc.

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

The MultipleOpen property ensures that a WinSECS control


does not generate a new primary message if one is already
outstanding from the WinSECS control. However, it does not prevent
new primary messages from being created and sent from the other
side of the link. For example, if the other end of the SECS link sends a
primary message to WinSECS, you can still use the Send method to
send a primary message while this primary message, sent from the
other side, is outstanding. The new primary message will be sent
immediately, even though there is a primary message waiting for a
secondary message at the other end of the SECS link.

Default value

True

Data type

Boolean

See also

Interleave Property, OpenPort Method, PortIsOpen Property,


PortType Property

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

The PortIsOpen property has the following return values:


Return Value

Description

True

The port is open

False

The port is closed.

This property is not available at design time and is read-only at


runtime.

Data type

Boolean

See also

Connected Property, OpenPort Method, PortType Property

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

The legal values for PortTypeConstant are:


PortTypeConstant

Value

Description

wsPortTypeRS232

SECS1 RS232 port

wsPortTypeHSMS

HSMS (Ethernet) port

wsPortTypeTCPIP

SECS1 via TCPIP

wsPortTypeTELNET

SECS1 via TELNET

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

50 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Default value

0 (wsPortTypeRS232)

Data type

Long

See also

Connected Property, General Properties, HSMS Properties,


OpenPort Method, PortIsOpen Property

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

Although the SECS standard specifies a maximum value of 31 for this


property, the WinSECS control allows any value in the range 0 to
32767. A value of zero is permitted, but may result in send failures
when line contention occurs.
The product of the RetryLimit and T2 properties specifies the length of
time WinSECS will attempt to initiate sending of a SECS message.
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

OpenPort Method, PortIsOpen Property, T2 Property

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

[form.]WinSECSn.SecsHost[ = { True | False }]

Notes

The value of this property determines whether the WinSECS control


will act as the SECS host or the SECS equipment. This setting governs
line contention at the SECS1 level and the value of the R bit in the
SECS1 header.
Value

Meaning

True

The WinSECS control, acting as the host, talks to the


equipment. If there is line contention, line control is
relinquished. The R bit in outgoing messages is set.

False

The WinSECS control, acting as the equipment, talks to the


host. If there is line contention, line control is expected. The
R bit in outgoing messages is cleared.

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

OpenPort Method, PortIsOpen Property, PortType Property

SerialPort property
Sets or returns the name of the serial port.

Applies to

wsPortTypeRS232

Syntax

[form.]WinSECSn.SerialPort[ = PortName]

Notes

For serial ports (PortType property is wsPortTypeRS232), this property


sets or returns the name of the serial port. The PortName returned is
used when you call the OpenPort method.
This property is ignored if the PortType property is wsPortTypeHSMS,
wsPortTypeTCPIP, or 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

52 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Default value

COM1

Data type

String

See also

OpenPort Method, PortIsOpen Property, PortType Property

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

[form.]WinSECSn.SimulateMode[ = { True | False }]

Notes

This property indicates whether or not the WinSECS control is in


simulate mode, a mode in which the WinSECS control simulates the
transmission and reception of messages. Simulate mode is useful for
equipment simulation and for testing the logic in an application.
When the SimulateMode property is True, the Send method builds the
primary message object and then triggers the PrimaryOut event as if
the primary message had been sent over the port. If the ReplyExpected
property is False, the transaction is complete. If the ReplyExpected
property is True, the WinSECS control then builds the secondary
message object, parses the secondary message object, and triggers the
SecondaryIn event as if the secondary message had been received over
the port.
When the SimulateMode property is True, the Reply method builds the
secondary message object and then triggers the SecondaryOut event.
When you use simulate mode, secondary messages are defined in the
transaction containing the primary message. You construct your
primary message in the normal fashion, and you must also construct
the desired secondary message by setting the Message and Item
properties to the values you desire in the secondary message.
You may change the value of this property at any time. Changing the
value of this property affects subsequent use of the Send method, but
does not affect messages that are in progress.

Default value

False

Data type

Boolean

SimulateMode property
53
CHAPTER 2: WINSECS CONTROL

See also

Receive Method, Send Method

T1 property
Sets or returns the T1 timer value.

Applies to

wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

[form.]WinSECSn.T1[ = TimerValue]

Notes

This property sets or returns the T1 inter-character timeout value (in


seconds) for the SECS1 data link protocol. The value of TimerValue
must be in the range of 0.1 to 10. While you may specify more than
one digit of precision, the precision of the time is 0.1 seconds.
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.3

Data type

Single (4 byte floating point)

See also

OpenPort Method, PortIsOpen Property, RetryLimit Property,


T2 Property, T3 Property, T4 Property

T2 property
Sets or returns the T2 timer value.

Applies to

wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

[form.]WinSECSn.T2[ = TimerValue]

Notes

This property sets or returns the T2 protocol timeout value (in


seconds) for the SECS1 data link protocol. The value of TimerValue
must be in the range of 0.2 to 25. While you can specify more than one
digit of precision, the precision of the time is 0.1 seconds.

WinSECS Version 2.7

54 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Single (4 byte floating point)

See also

OpenPort Method, PortIsOpen Property, RetryLimit Property,


T1 Property, T3 Property, T4 Property

T3 property
Sets or returns the T3 timer value.

Applies to

wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

[form.]WinSECSn.T3[ = TimerValue]

Notes

The T3 value specifies the amount of time allowed between sending


the last block of a primary message and receiving the first block of the
corresponding secondary message. This property sets or returns the
T3 reply timeout value (in seconds) for the SECS1 data link 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

OpenPort Method, PortIsOpen Property, RetryLimit Property,


T1 Property, T2 Property, T4 Property

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

The T4 property sets the amount of time between the successful


receipt a block in a multi-block message, and eh successful receipt the
subsequent block of the same message. This property sets or returns
the T4 reply timeout value (in seconds) for the SECS1 data link
protocol. The value of TimerValue must be in the range of 1 to 120.
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

OpenPort Method, PortIsOpen Property, RetryLimit Property,


T1 Property, T2 Property, T3 Property

WinSECS Version 2.7

56 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Closes the physical communication port opened with the OpenPort


method. The ClosePort method is called automatically when the
WinSECS control is unloaded.
The ClosePort method does not generate an error if it is called when
the port is not open. It is good practice to use the ClosePort method in
the Unload event of your main form in Visual Basic.
Messages that are scheduled for transmission through the port after
you call the ClosePort method, will be discarded.
Closing the port will cause an HSMS connection to be terminated.

See also

OpenPort Method, PortIsOpen Property

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

Use this method to create a new SecsTransaction object, in


preparation for starting a SECS transaction.
If you do not supply an argument to this method, a new default
SecsTransaction is created. This transaction contains primary and
secondary SecsMessage objects and each of these message objects
contains a root SecsItem object. All objects of the SecsTransaction are
unnamed and their properties are assigned default values.
If you provide an argument to this method, a new SecsTransaction
object is created by copying the specified SecsTransaction from the
Library. If the parameter is an index number, the transaction at the
specified index in the Library is copied and returned. The first
transaction in the Library is at index 1. If the argument is a string, the
first transaction in the Library with a matching name is copied and
returned.
When a transaction is copied, all of the SecsItems defined in the
Library transaction are also copied. With the exception of the Raw and
Length properties, the properties of the new SecsTransaction object
are the same as those of the Library transaction. The Raw property for
a new Transaction is always a zero length string. The Length property
is always zero.

Data type

SecsTransaction object

See also

Library Property, SecsTransaction Object

OpenPort method
Opens a physical communication port.

Applies to

wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

[form.]WinSECOpenPort Method, p. 2-49Sn.OpenPort

Notes

Opens a physical port for SECS communication. Before the port is


opened, the properties related to the communication parameters for
the port are used to configure the port. Once the port is open,
changing these properties has no effect on the operation of the port.
To make changes to port configuration effective, you must close the
port and reopen it.

WinSECS Version 2.7

58 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

When an application is finished using the port, it should close the port
using the ClosePort method.

Note

In an HSMS connection, WINsock will keep the port open even


after the application has exited. Because of this behavior, use the
ClosePort method to explicitly close the port.
When an RS-232 port is successfully opened, it is immediately ready
for communication.
When an HSMS port is successfully opened it is not ready for
communication until an HSMS link is established. Completion of the
connection is indicated by the Connect event. After this event is
triggered, the Connected property will be True and the port will be
ready for communication.
When either a SECS1-TCPIP or SECS1-TELNET port is successfully
opened, it is not ready for communication until its remote device
accepts its connection. As with HSMS, completion of the connection is
indicated by the Connect event. After this event is triggered, the
Connected property will be True and the port will be ready for
communication.

See also

ClosePort Method, Connect Event, Connected Property, PortIsOpen


Property

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

For HSMS, this event occurs when an HSMS link is successfully


established.
For SECS1-TCP/IP or SECS1-TELNET, this event occurs whenever
the connection is established for the first time or re-established after a
detected break.
After this event occurs the Connected property will be True until a
Disconnect event occurs.
When an HSMS port is opened, the link is not fully established until a
Connect event occurs. Likewise a Connect event cannot occur until
the port is opened. The sequence of events should be: open, connect,
send. The Send and Reply methods cannot be used successfully until
the Connect event is received (and the Connected property is True).

See also

Connected Property, Disconnect Event, Event Sequences,


OpenPort Method, PortIsOpen Property, PortType Property

WinSECS Version 2.7

60 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Disconnect event
Occurs when an HSMS link, or TCP/IP connection is broken.

Applies to

wsPortTypeHSMS
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

Notes

Sub WinSECSn_Disconnect(ByVal ErrorCode As Long, ByVal


ErrorText As String)
Parameters

Meaning

ErrorCode

Zero if the Disconnect occured because a Separate


Request Control message was received from the remote
entity (HSMS only) . Non-zero otherwise. See
ErrorConstants.

ErrorText

A string containing a text description of the error. If the


ErrorCode is zero, ErrorText is a zero-length string ("").

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

Connect Event, Connected Property, Event Sequences, OpenPort


Method,
PortIsOpen Property, PortType Property

Monitor event
Triggered when characters are sent or received over the physical port.

Applies to

wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

Sub WinSECSn_Monitor(ByVal Sent As Boolean, ByVal ByteType As


Long ByVal, Bytes As Variant, ByVal HexBytes As String)
Disconnect event
61
CHAPTER 2: WINSECS CONTROL

Notes

Parameters

Meaning

Sent

True if bytes were sent out the port, False if bytes were
received

ByteType

A numeric code specifying the type data.

Bytes

Binary data sent or received. The data is stored as an


array of bytes. The length of the array is the number of
bytes sent or received.

HexBytes

ASCII Hex representation of the data.

This event is triggered only if the MonitorEnabled property is True.


Processing monitor events can consume processing time in your
application, disable Monitor events for best performance.
Monitor events are generated only for data sent or received on the
physical port (not for simulated messages resulting when
SimulateMode is True).
The ByteType parameter will be one of the values in the list below
ByteTypeConstant

Description

wsByteTypeENQ

ENQ control byte

wsByteTypeEOT

EOT control byte

wsByteTypeACK

ACK control byte

wsByteTypeNAK

NAK control byte

wsByteTypeLength

SECS1 length byte

wsByteTypeHeader

Block header bytes

wsByteTypeData

SECS2 message data

wsByteTypeChecksum

SECS1 checksum bytes

wsByteTypeDiscarded

Unexpected data, will be discarded by


WinSECS

wsByteTypeError

Data received with an error reported


by the operating system

wsByteTypeSelectRequest

HSMS Select Request control message

wsByteTypeSelectResponse

HSMS Select Response control


message

wsByteTypeLinkTestRequest HSMS Link Test Request control


message
wsByteTypeLinkTestRespons HSMS Link Test Response control
e
message

WinSECS Version 2.7

62 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

ByteTypeConstant

Description

wsByteTypeRejectRequest

HSMS Reject Request control message

wsByteTypeSeparateRequest HSMS Separate Request control


message
The type wsByteTypeDiscarded marks bytes that were unexpected by
WinSECS. For example, when using SECS1, the control may expect a
control character at a particular moment. If it receives some other
character it will report it as ByteTypeDiscarded.
The type wsByteTypeError marks bytes that were incorrectly received
by the computer hardware. For example, bytes received with a framing
error are reported as ByteTypeError.
WinSECS follows these rules when issuing Monitor events (when
MonitorEnabled is True):
Each byte sent or received over the physical port is reported in a
Monitor event exactly once.
All bytes reported in the Monitor event are of the same type
(determined by the ByteType parameter).

PrimaryIn event
Occurs when an incoming primary SECS message is received.

Applies to

wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

Notes

Sub WinSECSn_PrimaryIn (ByVal Trans As SecsTransaction, ByVal


ErrorCode As Long, ByVal ErrorText As String )
Parameters

Meaning

Trans

The SecsTransaction object for which the primary


message has been received.

ErrorCode

Zero if the message was successfully received, non-zero


otherwise. See ErrorConstants.

ErrorText

A string containing a text description of the error. If the


ErrorCode is zero, ErrorText is a zero-length string ("").

The SecsTransaction object is passed as a parameter. If the


Transaction has a secondary message defined, you can return the
secondary (reply) message using the Reply method. Before you return

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

The following example replies to an S1F1 message with an S1F2


message. There are no data items in the S1F2 message (a SECS host
replies with a zero length list).
Private Sub WinSECS1_PrimaryIn(ByVal Trans As SecsTransaction,
ByVal ErrorCode As Long, ByVal ErrorText As String)
If Trans.Primary.Stream = 1 Then
If Trans.Primary.Function = 1 Then
Trans.Reply
End If
End If
End Sub

The following example adds support for the S1F13,14 transaction as


defined in the default Library. We set the value of COMMACK to 0,
indicating successful establishment of communications.
Private Sub WinSECS1_PrimaryIn(ByVal Trans As SecsTransaction,
ByVal ErrorCode As Long, ByVal ErrorText As String)
Select Case Trans.Primary.Stream
Case 1

WinSECS Version 2.7

64 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Select Case Trans.Primary.Function


Case 1
Trans.Reply
Case 13
Trans.Primary.Item("COMMACK") = 0
Trans.Reply
End Select
End Select
End Sub

See also

Connect Event, Connected Property, ErrorConstants, Event


Sequences,
OpenPort Method, PortIsOpen Property, PortType Property,
PrimaryOut Event, Raw Property, RawHex Property,
SecondaryIn Event, SecondaryOut Event

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

Sub WinSECSn_PrimaryOut(ByVal Trans As SecsTransaction,


ByVal ErrorCode As Long, ByVal ErrorText As String)
Parameters

Meaning

Trans

The SecsTransaction object for which the primary


message send attempt has completed.

ErrorCode

Zero if the message was successfully sent, non-zero


otherwise. See ErrorConstants.

ErrorText

A string containing a text description of the error. If


the ErrorCode is zero, ErrorText is a zero-length string
("").

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

If the message was transmitted successfully, the ErrorCode is 0 and


the ErrorText is a zero-length string. Otherwise, the ErrorCode is nonzero, the ErrorText contains a string describing the error, and the
transaction is no longer in progress even if the ReplyExpected
property is True.
This event is triggered when the primary message is transmitted, but
before the secondary (reply) message has been received. Therefore,
you should not use the item objects in this transaction to examine the
data returned in the reply message because the item objects have not
yet been set to the values returned in the secondary (reply) message.
If the ReplyExpected property is True and ErrorCode is zero, the
SecsTransaction object is still in progress when this event is triggered.
In this case, all of the properties of the SecsTransaction object and the
objects it contains are read-only.
You can use this event to display the SECS message data sent. The
primary SecsMessage object's Raw property returns the actual data
sent; the RawHex property returns a text version of this data.

See also

Connect Event, Connected Property, ErrorConstants, Event


Sequences,
OpenPort Method, PortIsOpen Property, PortType Property,
PrimaryIn Event, Raw Property, RawHex Property,
SecondaryIn Event, SecondaryOut Event

SecondaryIn event
Occurs when either a secondary message is received or a T3 timeout
occurs.

Applies to

wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

WinSECS Version 2.7

66 WINSECS COM REFERENCE

Sub WinSECSn_SecondaryIn(ByVal Trans As SecsTransaction,


ByVal ErrorCode As Long, ByVal ErrorText As String)
Parameters

Meaning

Trans

The SecsTransaction object for which the secondary


has been received.

ErrorCode

Zero if the message was received and parsed


successfully, non-zero otherwise. See ErrorConstants.

2006 Brooks Automation, Inc.

Notes

Parameters

Meaning

ErrorText

A string containing a text description of the error. If the


ErrorCode is zero, ErrorText is a zero-length string ("").

The SecondaryIn event is triggered whenever a secondary message is


successfully received, when a T3 timeout error occurs, or when the
secondary message was partially received. If the message was
successfully received and parsed, 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 it is not
zero, the secondary message was not successfully received.
The ErrorCode is non-zero if the message cannot be parsed or if it
cannot be matched to an outstanding primary 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.
Any data in the secondary message can be retrieved from the item
objects contained in the transaction object.
The SecsItem objects contained in the Secondary SecsMessage object
will be as received in the incoming message. The names and
descriptions of these SecsItem objects will be as defined in the
SecsMessage object, to the extent the incoming message matches. No
error is returned if the incoming message does not match the format
of the Secondary SecsMessage object, but the unmatched items will be
unnamed.

See also

Connect Event, Connected Property, ErrorConstants,


Event Sequences, OpenPort Method, PortIsOpen Property,
PortType Property, PrimaryIn Event, PrimaryOut Event,
Raw Property, RawHex Property, SecondaryOut Event

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

Sub WinSECSn_SecondaryOut(ByVal Trans As SecsTransaction,


ByVal ErrorCode As Long, ByVal ErrorText As String)
Parameters

Meaning

Trans

The SecsTransaction object for which a secondary


message send attempt has completed.

ErrorCode

Zero if the send was successful, non-zero


otherwise. See ErrorConstants.

ErrorText

A string containing a text description of the error.


If the ErrorCode is zero, ErrorText is a zero-length
string ("").

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

Connect Event, Connected Property, ErrorConstants, Event


Sequences,
OpenPort Method, PortIsOpen Property, PortType Property,
PrimaryIn Event, PrimaryOut Event, Raw Property, RawHex Property,
SecondaryIn Event

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

WinSECS Version 2.7

68 WINSECS COM REFERENCE

Sub WinSECSn_SecsError(ByVal ErrorCode as Long, ByVal ErrorText


as String)
Parameters

Meaning

ErrorCode

A non-zero numeric code for the error. See


ErrorConstants.

2006 Brooks Automation, Inc.

Notes

Parameters

Meaning

ErrorText

A string containing a text description of the error. If


the ErrorCode is zero, ErrorText is a zero-length
string ("").

The ErrorText parameter contains a string describing the error. This


event is triggered when the control cannot associate a transaction
with the communication error. For example, errors at the SECS1 level
will cause this event. This event is also triggered if a primary message
is received, but the message is not a valid SECS2 message.
The SecsError event is not triggered when a trappable error occurs
during a call to a WinSECS property or method. For example, setting
the Baud property to 100 will cause a trappable runtime error, but the
SecsError event will not be triggered.

See also

Connect Event, Connected Property, ErrorConstants, Event


Sequences,
OpenPort Method, PortType Property, PrimaryIn Event,
PrimaryOut Event, SecondaryIn Event, SecsWarning Event

SecsWarning event
Occurs when a recoverable error occurs at the data link level.

Applies to

wsPortTypeHSMS
wsPortTypeRS232
wsPortTypeTCPIP
wsPortTypeTELNET

Syntax

Sub WinSECSn_SecsWarning(ByVal ErrorCode as Long, ByVal


ErrorText as String)
Parameters
Parameters

Meaning

ErrorCode

A non-zero numeric code for the warning. See


ErrorConstants.

ErrorText

A string containing a text description of the warning.


If the ErrorCode is zero, ErrorText is a zero-length
string ("").

SecsWarning event
69
CHAPTER 2: WINSECS CONTROL

Notes

The ErrorText parameter contains a string describing the warning.


This event occurs on the expiration of any of the timeouts associated
with the data link protocol (e.g., T1, T2). Other events that will cause
warnings are a checksum error, bad character received on a serial
port, and other recoverable error conditions.

See also

Connect Event, Connected Property, ErrorConstants, Event


Sequences,
OpenPort Method, PortType Property, PrimaryIn Event, PrimaryOut
Event,
SecondaryIn Event, SecsError Event

WinSECS Version 2.7

70 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

The description property is not used by the WinSECS control, but


allows you to add descriptive text to the Library object for
documentation purposes.

Data type

String

Transaction property
Returns a transaction object from the library.

Syntax

[form.]WinSECSn.Library.Transaction(TransactionName)
[form.]WinSECSn.Library.Transaction(Index)

Notes

The SecsTransaction object returned by this property is a member of


the Library. You cannot use the Send, Receive, Reply, Build, or Parse
methods with transactions returned by this property. If you want to
use these methods, you must use the NewTransaction method of the
SECS control to make a copy of the desired transaction.
If the argument is a number, the transaction at the specified index in
the Library is returned. The first transaction in the Library is at index
1. The Index must be between 1 and the TransactionCount, inclusive.
If the argument is a string, the first transaction in the Library with a
matching name is returned.
Case is not significant in the TransactionName string, so s1f1 will
find SecsTransactions named S1F1, S1f1, and s1f1.

Data type

WinSECS Version 2.7

72 WINSECS COM REFERENCE

SecsTransaction object, read-only.

2006 Brooks Automation, Inc.

TransactionCount property
Returns the number of SecsTransaction objects defined in the Library
object.

Syntax

[form.]WinSECSn.Library.TransactionCount

Notes

You can use this property to iterate through the SecsTransaction


objects in the Library. For example, the last SecsTransaction in the
Library for a control named WinSECS1 is obtained by the expression
WinSECS1.Library.Transaction(WinSECS1.Library.TransactionCount
)

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

The Library object is initially empty (contains no transactions). You


can add transactions either using the AddNew method or the
UseDefault method. The UseDefault method creates a library that
contains all of the messages in the SEMI E5-95 standard.
The UseDefault method deletes any transactions currently in the
Library and replaces them with the default transactions. To build a
custom Library based on the default library, use the UseDefault
method to create a library containing the default transaction, then
modify the Library using the AddNew method.

WinSECS Version 2.7

74 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

The ActionOnError property is not used by the WinSECS control. You


can use it to store any information about the transaction you need
and is identical in this respect to the Tag property. This property can
be used to specify a desired action when an error occurs when using
the Send or Reply method with this transaction. This property will be
available in the PrimaryOut, SecondaryOut, or SecondaryIn event,
and it can be used to select the desired action in that event procedure.

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

The ActionOnSuccess property is not used by the WinSECS control.


You can use it to store any information about the transaction you
need, and it is identical in this respect to the Tag property. This
property can be used to specify a desired action when the Send or
Reply method completes successfully. This property will be available
in the PrimaryOut, SecondaryOut, or SecondaryIn event. It can also
be used to select the desired action in that event procedure.

Default value

Empty

Data type

Variant

WinSECS Version 2.7

76 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

SecsTransaction.AutoSystemBytes[= { True | False }]

Notes

When a primary SECS message is sent, the system bytes in the


message should differ from the system bytes of the open transactions
on the port. In general, unique system bytes are generated by treating
the system bytes as a counter; the counter value is incremented on
each send attempt.
If this property is True, the SECS control handles automatically
generates system bytes using this counter scheme. If this property is
False, the SECS control uses the value of the primary message's
SystemBytes property.
You should set this property to False only if the equipment has special
requirements for the system bytes. Transactions in the Library
initially have this property set to True.

Default value

True

Data type

Boolean

Description property
Sets or returns a description of the SecsTransaction object.

Syntax

SecsTransaction.Description[ = DescriptionString ]

Notes

The Description property is not used by the WinSECS control, but


allows you to add descriptive text to the SecsTransaction object for
documentation purposes.

Default value

Zero length string

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

When a SECS message is received you can read this property to


determine the device ID received in the message. When you create a
new transaction, the DeviceID property is initialized to the
DefaultDeviceID of the SECS control. The legal range for the DeviceID
property is 0 to 32767.

Default value

The default device ID of the SECS control

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

WinSECS Version 2.7

78 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

True). After using the Send method on a SecsTransaction object, the


InProgress property of that object becomes True. It will remain True
until one of the following events occur:

PrimaryOut event triggers with ErrorCode not zero


PrimaryOut event triggers with ReplyExpected property of the
SecsTransaction object set to False

SecondaryIn event triggers


Data type

Boolean, read-only

Name property
Sets or returns the name of the transaction.

Syntax

SecsTransaction.Name[ = TransactionName]

Notes

If a SecsTransaction in the Library is not named, you can access it


only by its index number. Case is retained in the TransactionName,
but is not significant when searching for the transaction using the
Transaction property of the Library object.

Default value

Zero length string ("")

Data type

String

Primary property
Returns the SecsMessage object representing the primary message in
the transaction.

Syntax

SecsTransaction.Primary

Notes

A SecsTransaction object always contains a primary SecsMessage


object. Use this property to obtain the SecsMessage object
representing the primary message.

Data type

SecsMessage object, read-only

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

SecsTransaction.ReplyExpected[= { True | False }]

Notes

This property corresponds to the W bit in the primary SECS message


header. When a primary message is received, you can check this
property to determine whether or not the sender expects a reply. When
a primary message is sent, the W bit in the SECS message header is
set if this property is True. If this property is False, the W bit is
cleared.
The W bit is always zero in secondary messages sent by WinSECS.
For messages sent using the Send method, this property determines
when a transaction is no longer in progress. If this property is True,
the transaction is in progress until the secondary message is received
(unless an error is reported in the PrimaryOut event). If this property
is False, the transaction is in progress until the primary message is
sent (i.e., when the PrimaryOut event is triggered).

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

A SecsTransaction object always contains a secondary SecsMessage


object (even if the ReplyExpected property is False).

Example

The following example sets the Stream property of the secondary


SecsMessage object to 1:
Trans.Secondary.Stream = 1

Data type

WinSECS Version 2.7

80 WINSECS COM REFERENCE

SecsMessage object, read-only

2006 Brooks Automation, Inc.

SystemBytes property
Sets or returns the system bytes.

Syntax

SecsTransaction.SystemBytes[ = SystemBytes]

Notes

Under normal conditions, it is unnecessary to examine the system


bytes. However, if the AutoSystemBytes property is False, you must
set the system bytes to the desired value before you can use the Send
method.
You can change the value of the SystemBytes before the Reply method
is used to send a secondary message. This change is rarely desirable
because it violates the SECS standard, which states that the system
bytes in a secondary message must match those in the primary
message.
The most significant byte of this property is the first system byte in the
SECS header. The least significant byte is the last system byte in the
SECS header.

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

This method produces a trappable runtime error if the transaction


object does not reside in the Library (i.e., was created with
NewTransaction).

Receive method
Triggers a PrimaryIn event as if the message had been received over
the SECS port.

Syntax

SecsTransaction.Receive

Notes

This method is useful for testing or simulation. It causes the Primary


message to be built and then it triggers the PrimaryIn event as if this
message had been received over the communication port. See Message
Construction.
You cannot use the Receive method with a SecsTransaction object
contained in the Library. To use the Receive method, you must create
a new SecsTransaction object using the NewTransaction method.

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

WinSECS Version 2.7

82 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

reply transmission will be successful. You must check the ErrorCode


value in the SecondaryOut event to determine if the transmission was
successful.
You cannot use the Reply method with a SecsTransaction object
contained in the Library.
This method affects the value of the properties in the Secondary
SecsMessage object and the SecsItem objects it contains.
Once the secondary message has been successfully scheduled for
transmission, the transaction is marked as InProgress. The properties
of the contained SecsMessage and SecsItem objects become read-only.
They remain read-only until the transmission of the message has
completed, either successfully or unsuccessfully.

Send method
Sends the primary message in a transaction.

Syntax

SecsTransaction.Send

Notes

This method constructs the binary messages:SECS message for the


primary message in the transaction and schedules it to be sent. A
trappable runtime error occurs if the binary message cannot be
constructed. The most common reason for failure is a data conversion
error.
You cannot use the Send method with a SecsTransaction object
contained in the Library. To use the Send method, you must create a
new SecsTransaction object using the NewTransaction method.
This method causes the Primary SecsMessage object to be built. The
result of the message construction is contained in the Raw property of
the Primary SecsMessage object after the Send method completes
successfully. See Message Construction.
Once the primary message has been successfully scheduled for
transmission, the transaction is marked as in progress and the
InProgress property is set to True. The properties of the
SecsTransaction object and the contained SecsMessage and SecsItem
objects become read-only. They remain read-only until the transaction
has completed, either successfully or unsuccessfully.
If the Send method completes without error, the PrimaryOut event will
trigger after the primary message has been sent (or the transmission
attempt fails). The SecsTransaction object will be returned in this
event. If the ErrorCode is 0 for this event and the ReplyExpected
property is True, then the SecondaryIn event will eventually also
trigger.
The data in the primary message must be set before this method is
used. If an error occurs during message construction, a trappable
error is produced and the ErrorCode is non-zero. Successful execution
Send method
83
CHAPTER 4: SECSTRANSACTION OBJECT

of the Send method does not necessarily indicate that the


transmission will be successful. You must check the ErrorCode value
passed to the PrimaryOut event to determine if the transmission was
successful.
There is no limit to the number of simultaneous outstanding SECS
transactions. The use of a second Send method before a reply is
received to the first will cause multiple outstanding SECS
transactions, if MultipleOpen is True. The secondary (reply) message
is obtained in the SecondaryIn event function. The transaction object
to which the SecondaryIn event relates is passed in the SecondaryIn
event.

WinSECS Version 2.7

84 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

The Description property is not used by the WinSECS control, but it


allows descriptive text to be added to a SecsMessage object for
documentation purposes.

Default value

Zero length string.

Data type

String

Function property
Sets or returns the SECS function number.

Syntax

SecsMessage.Function[ = Function]

Notes

The value of Function must be between 0 and 255, inclusive. You


cannot set the Function of a primary message to an even value, nor
can you set the Function of a secondary message to an odd value.
Generally, the value of the Secondary message is one greater than that
of the Primary message, although the WinSECS control does not
enforce this convention.

Default value

Primary messages: 1
Secondary messages: 2

Data type

WinSECS Version 2.7

86 WINSECS COM REFERENCE

Integer

2006 Brooks Automation, Inc.

Item property
Returns an item object.

Syntax

SecsMessage.Item(ItemName)
SecsMessage.Item(ItemName, ItemNumber)
SecsMessage.Item( ItemNumber)

Notes

This property is a shortcut for searching the Root item in a message.


These two statements are equivalent:
Set MyItem = Trans.Primary.Item("SVID")
Set MyItem = Trans.Primary.Root.Item("SVID")

See the Item property of the SecsItem object.

Data type

SecsMessage object, read-only

Length property
Returns the length, in bytes, of the binary data contained in the Raw
property.

Syntax

SecsMessage.Length

Notes

The length returned by this property is the number of bytes in the


SECS2 message data. This length does not include the SECS1 header
bytes. This property is valid only after the message has either been
successfully built or parsed, or after the Raw property is set. For
outgoing messages, this property is valid after the Send method is
issued. For incoming messages, this property is valid after the
PrimaryIn or SecondaryIn event is triggered. This property is also set
by the Build method.

Data type

Long, read only

Name property
Sets or returns the name of the message.

Syntax

SecsMessage.Name[ = MessageName]

Item property
87
CHAPTER 5: SECSMESSAGE OBJECT

Notes

If you create a transaction based on a Library transaction, the name of


each message contained in the transaction is initialized to the name
defined in the Library message. If you create a transaction without
using a Library transaction, the names of the message objects are
initially zero length strings.

Default value

Zero length string ("")

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

Variant (array of BYTE)

RawHex property
Returns an ASCII representation of the Raw data, in hexadecimal
notation.

Syntax

SecsMessage.RawHex

Notes

This property is useful for diagnostic display of the bytes contained in


a SECS message. Each byte in the Raw data is expanded to three
characters, the first two are the value of the byte, in hexadecimal
notation, and the third is a space character. The length of the string
returned by the RawHex property is always three times the length of
the Raw property.

WinSECS Version 2.7

88 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Data type

String, read only

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

SecsItem object, read only

Root property
89
CHAPTER 5: SECSMESSAGE OBJECT

Stream property
Sets or returns the SECS stream number.

Syntax

SecsMessage.Stream[ = StreamNumber]

Notes

The StreamNumber must be non-negative and less than 128. A stream


number of zero is not allowed by the SECS standard, but will not
generate a runtime error.

Default value

Data type

Integer

WinSECS Version 2.7

90 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

A Header-only messages:SECS message is represented by a


SecsMessage object that contains only the Root SecsItem
See also, SECS message parsing on page 19.

WinSECS Version 2.7

92 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Delete method p. 101


Duplicate method

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

The Description property is not used by the WinSECS control, but


allows descriptive text to be added to the SecsItem object for
documentation purposes.

Default value

Zero length string.

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

SECS item list

wsFormatBinary

SECS binary item

wsFormatBoolean

SECS Boolean item


(one byte, zero = False, non-zero = True)

wsFormatAscii

16

SECS ASCII item

wsFormatJis8

17

SECS JIS8 item

wsFormatI2

26

SECS signed integer item, 2 bytes

wsFormatI1

25

SECS signed integer item, 1 byte

WinSECS Version 2.7

94 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

wsFormatI8

24

SECS signed integer item, 8 bytes

wsFormatI4

28

SECS signed integer item, 4 bytes

wsFormatF8

32

SECS floating point item, 8 byte IEEE format

wsFormatF4

36

SECS floating point item, 4 byte IEEE format

wsFormatU8

40

SECS unsigned integer item, 8 bytes

wsFormatU4

44

SECS unsigned integer item, 4 bytes

wsFormatU2

42

SECS unsigned integer item, 2 bytes

wsFormatU1

41

SECS unsigned integer item, 1 bytes

wsFormatVar

63

SECS format inferred from Variant data type

wsFormatChar2

18

SECS 2 byte character item

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

SecsItem.Item ( ItemName [, Instance ] )


SecsItem.Item ( Index )

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.

WinSECS Version 2.7

96 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Example

If a SecsItem object named L contains three items named SVID,


then
L.item("SVID") ' returns the first item named SVID
L.item("SVID", 1 ) ' returns the first item named SVID
L.item("SVID", 2 ) ' returns the second item named SVID
L.item("SVID", 3 ) ' returns the third item named SVID
Similarly, if a variable named dev is defined, then if
dev="svid"
L.item(dev) ' returns the first item named SVID

Data type

SecsItem Object, read-only

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

For list items (Format = wsFormatList) the Length property returns


the number of items in the SECS list. For non-list items (Format does
not equal wsFormatList) the Length property returns the number of
bytes in the SECS item. This property is set by the WinSECS control
as a result of the Send, Reply, Receive, or Build methods, or when a
message is received.

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

Zero length string ("")

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

WinSECS Version 2.7

98 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

SecsItem object, read only

Raw property
Returns the SECS item data as a binary memory image.

Syntax

[ItemData=]SecsItem.Raw

Notes

The data is Read-only.


This property is useful if you want to examine the SECS item data
directly.
The value of this property is the result of the item being built or
parsed. Items are built when the message in which they are contained
is built.
The binary image contains all of the item data, but does not include
the item headers.

Data type

Variant (array of BYTE)

Value property
Sets or returns the value of an item.

Syntax

SecsItem.Value [= expression]
SecsItem [= expression]

Notes

The value is the default property of a SecsItem object, so either form


shown above can be used. A zero length item is represented by either
a Null or Empty value. If you want to send a zero length item, set
Value to Null. When you receive a message, this property will be Null if
a zero length item was received.

Parent property
99
CHAPTER 6: SECSITEM OBJECT

When a SECS message is constructed (using the Send, Reply, Receive,


or Build methods) the Value is converted to the type specified by the
Format property (see Item construction conversion process on
page 14). This conversion might produce an error. For example, the
value "Friday" cannot be converted to the format wsFormatI4. This
error is produced when the SECS message is built, not when the Value
property is set.
The expression can be an array. If an array is used, it must be onedimensional. Given a SecsItem object named MyItem, the following
example creates a SECS array item of I4 values:
MyItem.Format = wsFormatI4
MyItem.Value = array ( 1, 2, 3 )

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

WinSECS Version 2.7

100 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Methods
This section presents the methods of the SecsItem object.

AddNew method
Adds a new item to a list item.

Syntax

[Item = ] SecsItem.AddNew (Index)


Return value
The SecsItem object created.

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

Item duplication is useful for SECS messages that have repeating


items. When an item is duplicated, a copy of the item is inserted in the
parent list, at the position just after the item being duplicated. The
properties of the duplicated item are also copied. If the item is a list,
the item objects contained in the list are also duplicated.
The duplicated item is completely independent of the item that was
duplicated. You can change its properties without affecting the
original item.

WinSECS Version 2.7

102 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Set hsms port type p. 104


Set rs-232 port type

p. 104

Message transaction example


SECS1 port configuration
PrimaryOut secondaryin

p. 105
p. 106

Send method substitution


New transaction

p. 105

p. 107

p. 108

Download binary recipe p. 109


S1F1 message received
Adding a secsitem

p. 110

p. 110

HSMS port configuration p. 111


Building a new message

p. 111

Reading data from a message not defined in your library

p. 112

103

Transaction name display


This example displays the names of all transactions in the default
library.
Dim i As Integer
WinSECS1.Library.UseDefault
List1.Clear
For i = 1 To WinSECS1.Library.TransactionCount
List1.AddItem WinSECS1.Library.Transaction(i).Name
Next i

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

Set hsms port type


The code below sets the port type of a WinSECS control named
Stepper1 to HSMS:
Stepper1.PortType = wsPortTypeHSMS

Set rs-232 port type


This example sets the WinSECS1 control to use RS-232 communication
over the COM1 port:
WinSECS1.PortType = wsPortTypeRS232
WinSECS1.SerialPort = "COM1"

WinSECS Version 2.7

104 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Message transaction example


This example simulates the sending of an S1F1 message and the
receipt of the reply message.
To run this example, create a form that includes a WinSECS control
named WinSECS1. Add the following code and form's Load event.
Dim t As SecsTransaction
WinSECS1.Library.UseDefault
WinSECS1.SimulateMode = True
Set t = WinSECS1.NewTransaction("S1F1")
t.Send
Add the following code to the WinSECS1 control PrimaryOut
event:
Debug.Print "Sent S1F1: " & Trans.Primary.RawHex
Add the next code to the WinSECS1 control SecondaryIn event:
Debug.Print "Received S1F2: " & Trans.Secondary.RawHex
Press F5 to run the example. Watch the results in the Visual
Basics Debug window.

SECS1 port configuration


The following example configures the port for SECS1 communication.
Variations are also illustrated to demonstrate SECS1 over three
supported media.
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.
WinSECS1.PortType = wsPortTypeRS232 ' this is the default
' Properties that apply to all port types
WinSECS1.AutoDevice = True
WinSECS1.IgnoreSystemBytes = False
WinSECS1.DefaultDeviceID = 0
WinSECS1.MultipleOpen = True
WinSECS1.SimulateMode = False
' Properties that apply to all SECS1 port types
WinSECS1.AcceptDuplicateBlocks = False
WinSECS1.Interleave = False
WinSECS1.RetryLimit = 10
WinSECS1.SecsHost = True
WinSECS1.T1 = 0.3
WinSECS1.T2 = 0.5
WinSECS1.T3 = 45
WinSECS1.T4 = 45
' Properties that apply to the SECS1 communications medium
if WinSECS1.PortType = wsPortTypeRS232 Then
' for SECS1-RS232 ports

Message transaction example


105
APPENDIX A: EXAMPLES

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

WinSECS Version 2.7

106 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Send method substitution


The following function may be used in place of the Send method,
providing support for a hypothetical piece of equipment which
requires that the first two bytes of the SECS system bytes implement a
counter and the second two bytes are zero. The function also allows
an optional DeviceID parameter. If present, the DeviceID in the
outgoing message is set to the DeviceID passed.
To use this example, include the code below in a module. Call the
SendCustomSystemBytes() function instead of the Send method,
passing the SecsTransaction object you want to send.
Sub SendCustomSystemBytes(Trans As SecsTransaction, Optional
DeviceID As Variant)
Static CustomBytes As Long ' custom system bytes
CustomBytes = CustomBytes + 65538
Trans.AutoSystemBytes = False
Trans.SystemBytes = CustomBytes
If Not IsMissing(DeviceID) Then
Trans.DeviceID = DeviceID
End If
Trans.Send
End Sub

Send method substitution


107
APPENDIX A: EXAMPLES

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"

WinSECS Version 2.7

108 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Download binary recipe


This example provides a function that downloads a binary recipe. The
recipe data is passed to the function as the RecipeData parameter.
This function first builds the S7F3 message and checks whether it will
be a multi-block message or not. If it is, the function issues the S7F1
transaction to request permission to send a multi-block recipe. We
loop waiting for the reply message in this sample, which is not
recommended practice but keeps the example simple. In production
code you should separate the logic into handlers for the SecondaryIn
event.
Sub RecipeDownload(PPID As Long, RecipeData As String)
Dim Trans As SecsTransaction
Dim Request As SecsTransaction
Set Trans = WinSECS1.NewTransaction("S7F3")
Trans.Primary.Item("PPID") = PPID
Trans.Primary.Item("PPBODY") = RecipeData
Trans.Primary.Build
If Trans.Primary.Length > 244 Then ' Multi-block
Set Request = WinSECS1.NewTransaction("S7F1")
Request.Primary.Item("PPID") = PPID
Request.Primary.Item("Length") = Trans.Primary.Length
Request.Send
Do While Request.InProgress
DoEvents ' NOT recommended in production apps!
Loop
If Request.Secondary.Item("GRANT") <> 0 Then Exit Sub
End If
Trans.Send
Do While Trans.InProgress
DoEvents ' NOT recommended in production apps!
Loop
End Sub

Download binary recipe


109
APPENDIX A: EXAMPLES

S1F1 message received


This example returns the proper type of S1F2 message, when an S1F1
message is received. The SECS standard requires that the SECS host
responds with a zero length list, while the equipment responds with
the message as defined in the default Library. In this example, when
an S1F1 message is received in the PrimaryIn event, the SecsHost
property of the control determines whether or not to reply with a zero
length list.
A zero length list in SECS consists of the byte sequence (in hex) 01 00.
The first byte is the item format, which is list format with 1 length
byte. The second byte is the length byte, with value 0.
Private Sub WinSECS1_PrimaryIn(ByVal Trans As SecsTransaction,
ByVal ErrorCode As Long, ByVal ErrorText As String)
If Trans.Primary.Stream = 1 And Trans.Primary.Function = 1 Then
If WinSECS1.SecsHost Then
Trans.Secondary.Root.Item(1).Delete
Trans.Secondary.Raw = Chr$(1) & Chr$(0)
Else
Trans.Secondary.Item("MDLN") = "Model1"
Trans.Secondary.Item("SOFTREV") = "Rev1.1"
End If
Trans.Reply
End If
End Sub

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)

WinSECS Version 2.7

110 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

HSMS port configuration


This example configues the port for HSMS communication, using the
default values of all properties related to HSMS
Properties that apply to all port types
WinSECS2.DefaultDeviceID = 0
WinSECS2.MultipleOpen = True
WinSECS2.SimulateMode = False
WinSECS2.PortType = wsPortTypeHSMS
Properties that apply to HSMS ports
WinSECS2.HSMST3 = 45
WinSECS2.HSMST5 = 10
WinSECS2.HSMST6 = 5
WinSECS2.HSMST7 = 10
WinSECS2.HSMST8 = 5
WinSECS2.IPAddressLocal = 0.0.0.0
WinSECS2.IPAddressRemote = 255.255.255.100
WinSECS2.IPPortLocal = 5000
WinSECS2.IPPortRemote = 5000

Building a new message


The following example shows how to build a message that is not
defined in your library:
Private Sub pod1_arrived_Click()
Dim sx As SecsTransaction
Dim i As Integer
Let i = 1
Set sx = FormTester.WinSecs1.NewTransaction("S100F7")
With sx.Primary
.Root.AddNew (1)
.Root.Item(1).Name = "L"
.Root.Item(1).AddNew (1)
.Root.Item(1).AddNew (2)
.Root.Item(1).AddNew (3)
.Root.Item(1).Item(1).Name = "ARM_ID"
.Root.Item(1).Item(1).Value = 1
.Root.Item(1).Item(1).Format = wsFormatU1
.Root.Item(1).Item(2)._ Name = "Pod Arrived"
.Root.Item(1).Item(2).Value = 1
.Root.Item(1).Item(2).Format = wsFormatU1
.Root.Item(1).Item(3)._ Name = "L"
.Root.Item(1).Item(3).AddNew (1)
.Root.Item(1).Item(3).AddNew (2)
.Root.Item(1).Item(3).Item(1).Name = "TagSn"

HSMS port configuration


111
APPENDIX A: EXAMPLES

.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

Reading data from a message not defined in your library


The following example shows how you can read in data from a
message that is not defined in your library:
Private Sub WinSecs1_PrimaryIn(ByVal Trans As SecsTransaction,
ByVal ErrorCode As Long, ByVal ErrorText As String)
Dim AsText As Boolean
Dim MyItem As Integer
If ErrorCode Then
AsText = False
lDisplay "PrimaryIn error [" & ErrorCode & "]: " &
ErrorText & "Message follows."
Else
AsText = MenuText.Checked
End If
lDisplayMessage AsText, Trans, Trans.Primary, True If
MenuAutoReply.Checked Then
On Error Resume Next
Trans.Reply
If Err Then
MsgBox "Unable to reply. Reason: " & Error$
End If
End If
Select Case Trans.Name
Case "S100F7"
If Trans.Primary.Item(1).Item(2).Value = 1 Then 'pod arrived
If Trans.Primary.Item(1).Item(1).Value = 1 Then 'arm 1
lblStatus1 = "Buffer"
ElseIf Trans.Primary.Item(1).Item(1).Value = 2 Then 'arm
2
lblStatus2 = "Buffer"

WinSECS Version 2.7

112 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Reading data from a message not defined in your library


113
APPENDIX A: EXAMPLES

WinSECS Version 2.7

114 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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.

See also Root Property, SecsMessage Object

Error 1002

Illegal format code. Use one of the format codes defined in


FormatConstants.
The format code must be one of the codes defined by the SECS
standard or the special value wsFormatVar. When you set the format
code, you can use one of the following:
1. FormatConstant defined by the WinSECS control
2. Number defined in the SECS standard

See also Format Property, SecsItem Object

Error 1003

Illegal NLB value. NLB must be 0, 1, 2, or 3.


The SECS standard allows the NLB (number of length bytes) value to
be 1, 2, or 3. The value 0 instructs WinSECS to use the minimum
number required to contain the length.

See also NLB Property, SecsItem Object

Error 1004

There are no items contained in the list.


The property you used is attempting to locate an item, but there are
no items in the parent item being searched. This error occurs if you
apply the Item property to:

A non-list item
A list item that contains no items (a zero length list)
See also Item Property, SecsItem Object

115

Error 1005

Unable to convert the item index to long integer.


The Item property accepts a number or a string as its first parameter.
In this case, you have used a number. The control attempted to
convert this number to a four-byte integer but the conversion attempt
failed. Check the type value of the first parameter to the Item property.

See also Item Property, SecsItem Object

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.

See also Item Property, SecsItem Object

Error 1008

The first parameter to the Item property must be either a number or a


string.
The Variant value you passed to the Item property is not a number
and cannot be converted to a string.
Legal examples are:
Item(2) ' 2 is a number
Item("SVID") ' "SVID" is a string

The following code will produce an error


Item(Array(1,2)) ' the parameter is neither a number nor a
string

See also Item Property, SecsItem Object

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).

See also Item Property, SecsItem Object, Item Property, SecsMessage


Object

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.

WinSECS Version 2.7

116 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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.

See also InProgress Property, SecsTransaction Object, Event


Sequences

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.

See also InProgress Property, SecsTransaction Object, Event


Sequences

Error 1013

The Stream property must be between 0 and 127 inclusive.


The SECS message header reserves 7 bits for the stream number. For
this reason the SECS stream number must be within this range.

See also Stream Property, SecsMessage Object

Error 1014

The Function property must be between 0 and 255 inclusive.


The SECS message header reserves 8 bits for the function number.
For this reason the SECS function number must be within this range.

See also Function Property, SecsMessage Object

Error 1015

You cannot set this property at this time. The transaction is in


progress.
When a SecsTransaction is in progress, all properties of the
SecsTransaction and the objects it contains become read-only. This
SecsTransaction object is in progress.

See also InProgress Property, SecsTransaction Object, Event


Sequences

Error 1016

This transaction is contained in the library. This method is not


available for transactions in the library. You should create a new
transaction, using the NewTransaction method of the SECS control.
You cannot use the Send, Reply, or Receive methods with a
SecsTransaction object contained in the Library. Create a new
SecsTransaction object using the NewTransaction method, then apply
this method to the new SecsTransaction object.

See also NewTransaction Property, WinSECS control object

APPENDIX B: ERROR MESSAGES

117

Error 1017

There is no primary message defined for this transaction.


This error should not occur; if it does, please contact
Brooks Automation Technical Support.

Error 1018

There is no secondary message defined for this transaction.


This error should not occur; if it does, please contact
Brooks Automation Technical Support.

Error 1019

This transaction is not contained in the Library. This method is


available only for transactions in the library.
This method is used for managing the SecsTransaction objects
contained in the Library. It is not applicable to SecsTransaction
objects that are not contained in the Library.

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.

See also Transaction Property, SecsLibrary Object, Use Default


Method, SecsLibrary Object

Error 1021

Unable to convert the transaction index to long integer.


The Transaction property accepts a number or a string as its
parameter. In this case, you have used a number. The control has
attempted to convert this number to a four-byte integer, but the
conversion attempt failed. Check the type value of the parameter for
the Transaction property.

See also Transaction Property, SecsLibrary Object

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.

See also Add New Method, SecsLibrary Object, Transaction Property,


SecsLibrary Object

Error 1023

There is no transaction with index index.


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.

WinSECS Version 2.7

118 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

See also Transaction Property, SecsLibrary Object, TransactionCount


Property, SecsLibrary Object

Error 1024

The parameter to the Transaction property must be either a number


or a string.
The Variant value you passed to the Transaction property is not a
number and cannot be converted to a string. Legal examples are:
WinSECS1.Library.Transaction(2) ' 2 is a number
WinSECS1.Library.Transaction("S1F3") ' "S1F3" is a string

The following code will produce an error:


WinSECS1.Library.Transaction(Array(1,2))

See also Transaction Property, SecsLibrary Object

Error 1025

Transaction name is not found in the Library.


There is no SecsTransaction object in the Library whose name
matches name.

See also Transaction Property, SecsLibrary Object

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.

See also Transaction Property, SecsLibrary Object

Error 1027

The parameter to the NewTransaction method must be a string or an


integer.
The parameter you passed is not a string and cannot be converted to a
number.

See also NewTransaction Method, WinSECS control object

Error 1028

Constant: wserrstringconversion Unable to convert item 'item name'


value to string. The SECS item format for this item is a string type
(format code format code). The conversion of the Value property to
string type failed. Possible cause is that the Value is an array.
The Format property for this item specifies a string type
(wsFormatAscii, wsFormatBinary, or wsFormatJis8). You have either
explicitly specified this format using the Format property or the
Format property value is wsFormatVar and WinSECS has selected a
string representation of the Value based on the VarType of the Value.

APPENDIX B: ERROR MESSAGES

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.

See also Value Property, SecsItem Object

Error 1029

Internal logic error.


Contact Brooks Automation Technical Support.

Error 1030

Constant: wserrmultidimensionalarray The Value for item 'item name' is


an array with more than one dimension. If a Value is an array, it must
be one-dimensional.
The SECS standard supports items that are arrays, but such item
arrays must be one-dimensional. There is no provision in the SECS
standard to represent multi-dimensional arrays in a SECS item.
The Value property is a Variant type and is capable of containing
multi-dimensional arrays. You must change the Value to a single
dimension array.

See also Value Property, SecsItem Object

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

Constant: wserrnumericconversion Error in numeric conversion of item


'item name'. The reason for this error is that the Value property cannot
be converted to the specified item format.
The Format property specifies that this SecsItem is a numeric
quantity, but WinSECS is unable to convert the Value to a number.
For example, if the Format property is wsFormatI4 and the Value
property is "Friday", this error will result.

See also
Object

Error 1033

Format Property, SecsItem Object, Value Property, SecsItem

Memory allocation failed.


The operating system has reported that there is insufficient memory
for the operation. You may need to provide more virtual memory or
add physical memory.
Use the operating system utilities to examine the memory usage of
your system. If the memory usage figure reported by the operating
system indicates that there should be sufficient memory, contact
Brooks Automation Technical Support. A memory allocation failure
can result from a bug in WinSECS or in some other part of your
application (such as another OLE custom control).

WinSECS Version 2.7

120 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Error 1034

Constant: wserrlisttooshort A list header in the incoming SECS message


specified that the list contains specified number items, but only actual
number were found in the list. The error was detected at offset decimal
offset in the SECS message.
The SECS message received is improperly formatted. A SECS list
header specified that specified number of items were to be found in the
list. When WinSECS counted the items, it found only actual number of
items. You can examine 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.

See also RawHex Property, SecsMessage Object

Error 1035

Constant: wserrzeronlb The number of length bytes in a SECS item


header is zero. This is not a legal value. The error was detected at
offset decimal offset in the SECS message.
The two least significant bits in a SECS item header contain the
number of length bytes (NLB). The SECS standard requires that the
value of these bits be (binary) 01, 10, or 11. A value of (binary) 00 is
illegal. 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.

See also RawHex Property, SecsMessage Object

Error 1036

Constant: wserrillegalformatcodein A format code with value format code


value (decimal) was found in a SECS item header. This is not a legal
format code. The value of the byte containing this format code is byte
value (hex). The error was detected at offset decimal offset in the SECS
message.
The SECS standard specifies a certain set of legal format codes. The
value format code value is not among these legal values. 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.

See also RawHex Property, SecsMessage Object

Error 1037

Constant: wserrendsinlengthbyte The SECS message ends within an


item header length field. The error was detected at offset decimal offset
in the SECS message.
The number of length bytes in a SECS item header are specified by the
NLB field of the first byte of the SECS item header. The end of the
SECS message was encountered before the specified number of length

APPENDIX B: ERROR MESSAGES

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.

See also RawHex Property, SecsMessage Object

Error 1038

Constant: wserrendsindata The SECS message ends within an item data


field. The error was detected at offset decimal offset in the SECS
message.
The number of data bytes in a SECS item are specified by the length
bytes of the SECS item header. The end of the SECS message was
encountered before the specified number of data 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.

See also RawHex Property, SecsMessage Object

Error 1039

Constant: wserrnotmultiple A SECS item was received with a format


code that indicates a data length of specified length bytes, but the
length of the item is actual length bytes. The item length must be an
even multiple of the size implied by the format code. The error was
detected at offset decimal offset in the SECS message.
For numeric values, the SECS format code implies the number of data
bytes in the item. For example, the format code wsFormatI4 implies
that the data bytes will be a multiple of 4 bytes in length. The SECS
item being parsed has a format code that implies a data length of
specified length bytes, but the length bytes in the item header specify
that the item contains actual length bytes. The actual length is not an
even multiple of the specified length. 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.

See also RawHex Property, SecsMessage Object

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.

See also SimulateMode Property, WinSECS control object, OpenPort


Method, WinSECS control object

WinSECS Version 2.7

122 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

You cannot set the Function property of a Primary SecsMessage object


to an even value.
The SECS standard requires that primary messages have odd function
values. The WinSECS control relies on this convention to determine if
an incoming message is a primary or secondary message. WinSECS
will not allow you to set the Function property of the Primary message
to an even value.

See also Primary Property, SecsTransaction Object, Function


Property, SecsMessage Object

Error 1043

You cannot set the Function property of a Secondary SecsMessage


object to an odd value.
The SECS standard requires that secondary messages have even
function values. The WinSECS control relies on this convention to
determine if an incoming message is a primary or secondary message.
WinSECS will not allow you to set the Function property of the
Secondary message to an odd value.

See also Secondary Property, SecsTransaction Object, Function


Property, SecsMessage Object

Error 1044

This item is deleted and no longer contained in a parent item.


Once an item is deleted, it no longer has a parent. The following code
will cause an error of this type:
Dim Trans as SecsTransaction
Dim MyItem as SecsItem
Set Trans = WinSECS1.NewTransaction("S1F1")
Set MyItem = Trans.Secondary.Item("MDLN")
MyItem.Delete
MyItem.Parent.Name = "Ln" ' Error! No parent.

See also Delete Method, SecsItem Object

Error 1045

The second parameter to the Item property must be a number.


The (optional) second parameter to the Item property specifies the
instance of the item. A value of 1 selects the first instance, 2 the
second, and so on. This parameter must be a numeric quantity.

See also Item Property, SecsItem Object

Error 1046

The Baud value baud is invalid.


The SECS standard does not allow this value of the Baud property.

APPENDIX B: ERROR MESSAGES

123

See also Baud Property, WinSECS control object

Error 1047

The DeviceID must be between 0 and 32767.


The SECS standard reserves 15 bits for the device ID within the
SECS1 message header. The DeviceID property must lie within this
range.

See also DeviceID Property, SecsTransaction Object

Error 1048

The RetryLimit must be a positive integer.


Change the RetryLimit property.

See also RetryLimit Property, WinSECS control object

Error 1049

The T1 value must be between 0.1 and 10.0 inclusive.


This range of values is specified by the SECS standard.

See also T1 Property, WinSECS control object

Error 1050

The T2 value must be between 0.2 and 25.0 inclusive.


This range of values is specified by the SECS standard.

See also T2 Property, WinSECS control object

Error 1051

The T3 value must be between 1 and 120 inclusive.


This range of values is specified by the SECS standard.

See also T3 Property, WinSECS control object

Error 1052

The T4 value must be between 1 and 120 inclusive.


This range of values is specified by the SECS standard.

See also T4 Property, WinSECS control object

Error 1053

The PortType value value is invalid. This property must be 0 (RS-232),


1 (HSMS), 2 (TCPIP), or 3 (TELNET).
When you set the PortType, you specify a constant or an integer:
1. A PortTypeConstant (defined by the WinSECS control)

wsPortTypeRS232

wsPortTypeHSMS

wsPortTypeTCPIP

wsPortTypeTELNET

2. An integer

WinSECS Version 2.7

124 WINSECS COM REFERENCE

0 to specify an RS-232 port

2006 Brooks Automation, Inc.

1 to specify an HSMS port

2 to specify an TCPIP port

3 to specify an TELNET port

See also PortType Property, WinSECS control object

Error 1054

Constant: wserri4range The value of item 'item name' is outside the


legal range for SECS format format. The integer value is value. The
legal range for this format is min value to max value.
The specified format is capable of representing numbers in the range
min value to max value. The value specified by the Value property of
the SecsItem lies outside this range. Conversion of the value to the
specified format would result in loss of data.

See also Value Property, SecsItem Object

Error 1055

Constant: wserru4range The value of item 'item name' is outside the


legal range for SECS format format. The legal range for this format is
min value to max value.
The specified format is capable of representing numbers in the range
min value to max value. The value specified by the Value property of
the SecsItem lies outside this range. Conversion of the value to the
specified format would result in loss of data.

See also Value Property, SecsItem Object

Error 1056

Constant: wserru8range The value of item 'item name' is negative, but


its format code is U8. The U8 format cannot represent negative values.
Conversion of this value to the U8 format would result in loss of data.

See also Format Property, SecsItem Object


Value Property, SecsItem Object

Error 1062

The serial port name must be less than maximum characters.


You must use a shorter port name.

Error 1063

The port is already open.


You must use the ClosePort method before you can open the port
again.

See also ClosePort Method, WinSECS control object

Error 1064

This SecsTransaction object has been deleted from the library.


You have applied this property to a SecsTransaction object that has
been deleted from the Library. This property is applicable only to
SecsTransaction objects that are contained in the Library.

APPENDIX B: ERROR MESSAGES

125

See also Delete Method, SecsTransaction Object, UseDefault Method,


SecsLibrary Object

Error 1065

The HSMST3 value must be between 1 and 120 inclusive.


This is the range of values specified by the HSMS standard.

See also HSMST3 Property, WinSECS control

Error 1066

The HSMST5 value must be between 1 and 120 inclusive.


This is the range of values specified by the HSMS standard.

See also HSMST5 Property, WinSECS control

Error 1067

The HSMST6 value must be between 1 and 120 inclusive.


This is the range of values specified by the HSMS standard.

See also HSMST6 Property, WinSECS control

Error 1068

The HSMST7 value must be between 1 and 120 inclusive.


This is the range of values specified by the HSMS standard.

See also HSMST7 Property, WinSECS control

Error 1069

The HSMST8 value must be between 1 and 120 inclusive.


This is the range of values specified by the HSMS standard.

See also HSMST8 Property, WinSECS control

Error 1072

The IP address is too long.


The maximum allowed length is max length characters.

See also IPAddressLocal Property, WinSECS control,


IPAddressRemote Property, WinSECS control

Error 1073

Constant: wserrunknownsecondary
message.

Received unexpected secondary

Possible causes:

The equipment has sent an even function number as a primary


message.

The equipment sent a reply to a Primary with ReplyExpected =


False.

The T3 timeout expired before the equipment sent the reply


message.

WinSECS Version 2.7

126 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

The SECS standard requires that primary (order) messages have an


even function number. If a primary message is received with an even
function number, WinSECS will assume that it is a secondary (reply)
message. WinSECS will search for the matching primary, which will
not exist in this case.
SECS messages contain a bit (the W-bit) in the header that indicates
that a primary message expects a reply. If this bit is not set, the
equipment should not return a reply message. If the equipment does
return a reply message, WinSECS will not be able to find the matching
primary and this error will result.
If the T3 timeout period elapses before the secondary message is
received, WinSECS will fail the transaction. If the equipment later
returns the desired reply, WinSECS will no longer have a record of the
original primary and this error will result. The corrective action in this
case may be to increase the T3 timeout period.

See also T3 Property, WinSECS control

Error 1074

The port number must be greater than zero.


Change Port number.

See also IPPortLocal Property, WinSECS control, IPPortRemote


Property, WinSECS control

Error 1075

The link test timer value must be a positive integer.


Change the test timer value.

See also LinkTestTimer Property, WinSECS control

Error 1077

The window handle for this process is NULL.


Probable cause is that the application is terminating.
Contact Brooks Automation Technical Support.

Error 1078

The ClosePort method was used while this transaction was in


progress. Transaction canceled.
This is an informational error, indicating that there were messages
scheduled for transmission when the port was closed. This does not
indicate a problem in your application, but may result in T3 timer
errors on the other end of the SECS link if any of the discarded
messages were secondary (reply) messages.

Error 1079

The Root item cannot be deleted.


It is not possible to delete the Root item of a SecsMessage object. You
have applied the Delete method to the root item.

Error 1081

Out of memory in SECS interface library.

APPENDIX B: ERROR MESSAGES

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

Internal SECS library error ErrorNumber:


This error message is a funnel for SECSDSS errors (the driver). If you
receive this message, there may be unexpected TCP/IP or network
level errors.
Contact Brooks Automation Technical Support.

Error 1083

No port name was specified.


The SerialPort property may not be a zero length string. Set the
SerialPort property to a valid port name on your computer.

See also SerialPort Property, WinSECS control

Error 1084

The serial port name specified does not exist.


The operating system reports that the port you have specified with the
SerialPort property does not exist on this computer.

See also SerialPort Property, WinSECS control

Error 1085

The maximum allowed number of ports are already open.


The WinSECS process limit on the number of open serial ports has
been reached. You cannot open additional serial ports within this
process. To use additional serial ports, you must start another
process. For example, if you are using Visual Basic, you must write a
second VB application. This second application will allow you to open
additional ports.

Error 1086

System resources were exhausted trying to open the port.


Some system limitation has been reached. There may be insufficient
memory.

Error 1087

System resources were exhausted trying to create a semaphore.


WinSECS was unable to create a semaphore object for the port. There
may be insufficient memory.

Error 1088

System resources were exhausted trying to create a system event.


WinSECS was unable to create an event object for the port. There may
be insufficient memory.

Error 1089

An attempt was made to close a port that is not open.


This error originates from SECSDSS (the driver).
Contact Brooks Automation Technical Support

WinSECS Version 2.7

128 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Error 1090

An attempt was made to open a port that is already open.


A serial port has been opened by another application or WinSECS
control. Select a different serial port, or close the application or
WinSECS control that opened the serial port you wish to use.

See also Serial Port Property

Error 1091

The SECS driver has no record of this transaction.


Contact Brooks Automation Technical Support.

Error 1092

The operating system reported an error on the attempt to open the


port. The port may be in use by another process.
The operating system has denied access to the port. The most likely
cause is that the port is in use by another process. Other possible
causes are lack of proper permissions for the port or use of
communication parameters (such as the baud rate) that are not
supported by your hardware configuration.

Error 1093

Constant: wserrt3timeout A secondary message was not received within


the T3 (reply) timeout period.
WinSECS has successfully sent a primary message, but the secondary
message was not received within the period specified by the T3
property (or the HSMST3 property for HSMS ports).
The first thing to check is whether or not the equipment should send a
reply to this primary message. If the equipment is not expected to
send a reply, you should set the ReplyExpected property of the
SecsTransaction object to False.
If a reply is expected, you should check the health of the equipment
and the status of the SECS cable. If the equipment is operating
properly and the cabling is intact, you may need to increase the T3 or
HSMST3 property value.
If you are not able to solve the problem using the steps above, you
should obtain a record of the traffic on the port. You can do this by
using the Monitor event. Some equipment do not handle system bytes
properly, and such misuse can cause this error. The system bytes in
the secondary message must match those in the primary message. If
you find that the equipment does not handle system byte property,
you may need to set the IgnoreSystemBytes property to True. This
should be a last resort, because it can lead to unreliable
communication.

See also T3 Property, WinSECS control, HSMST3 Property, WinSECS


control, ReplyExpected Property, SecsTransaction object,
IgnoreSystemBytes Property, WinSECS control

Error 1094

Constant: wserrrty The RetryLimit was exceeded on an attempt to send


a SECS message.

APPENDIX B: ERROR MESSAGES

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.

See also T2 Property, WinSECS control, RetryLimit Property,


WinSECS control

Error 1095

The operating system has reported that the networking components


are not ready.
Check your network settings and verify that TCP/IP support is
enabled.
We suggest using one of the standard TCP/IP utilities on your
computer (such as TELNET) to verify that your TCP/IP configuration
is correct. Until you can use these utilities successfully, you will not
get anywhere with WinSECS in HSMS mode.

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

The WinSock layer reports that it is not initialized.


Check your network settings and verify that TCP/IP support is
enabled.
If your settings are correct but you are still having WinSock problems,
contact Brooks Automation Technical Support.

Error 1098

The WinSock layer reports that the network is down.


Check your network settings and verify that TCP/IP support is
enabled.
Use one of the standard TCP/IP utilities on your computer (such as
TELNET) to verify that your TCP/IP configuration is correct. Until you
can use these utilities successfully, you will not get anywhere with
WinSECS in HSMS mode.

Error 1099

WinSECS Version 2.7

130 WINSECS COM REFERENCE

The WinSock layer reports that the Local IP address used is not
supported on your computer.

2006 Brooks Automation, Inc.

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.

See also IPAddressLocal Property, WinSECS control

Error 1100

The WinSock layer is out of file descriptors for this process.


You have attempted to open more HSMS ports for this process than
the operating system allows. Try using a second process.

Error 1101

The WinSock layer is out of buffers.


Probable cause is a low memory condition. Try increasing your virtual
memory limits.

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

WinSock reports that a connection attempt was refused.


An attempt to connect to the remote HSMS entity was unsuccessful.
This is probably because the remote entity is not listening on this
combination of IP Address and Port number. Check that the remote
entity is up and that your IP Address and Port settings are correct.

Error 1107

WinSock reports that a destination address was not specified in a


connection attempt.
Contact Brooks Automation Technical Support.

Error 1108

WinSECS was unable to create a socket using the Remote/Local IP


address and Remote/Local IP port specified.
Make sure these are valid values for your machine.

APPENDIX B: ERROR MESSAGES

131

You have used a value for the IPAddressRemote, IPAddressLocal,


IPPortRemote, or IPPortLocal property which is not valid. Either the
Local IP Address/IP Port is invalid for this is invalid host, or your are
using a Remote IP Address/IP Port that doesnt exist.. If you are using
a host name for the IP Address, make certain that this host name is
valid for your network and that host name resolution is operating
properly on your network.

See also IPAddressLocal Property, WinSECS control,


IPAddressRemote Property, WinSECS control, IPPortLocal Property,
WinSECS control, IPPortRemote Property, WinSECS control

Error 1109

WinSock reports that a connection attempt has been made on a


socket that is already connected.
Contact Brooks Automation Technical Support.

Error 1111

WinSock reports that it is unable to connect to the Remote host


specified.
The probable cause is that you are trying to connect to a remote IP
Address that is not on your local subnet and there is no route
available to reach this node. Check with your network administrator
to gain access to the remote address.

Error 1112

Constant: wserrconnectionlost The HSMS connection has been lost.


The network connection has been lost unexpectedlyand is not the
result of a disconnect request from the remote HSMS entity. The
network may recover. If it does, the HSMS connection will
automatically be established again (assuming the remote HSMS entity
is still live).

Error 1113

Constant: wserrhsmst6 An HSMS T6 (control transaction) timeout has


occurred. This may indicate problems with the network or the remote
equipment.
A T6 timeout is the result of a reply timeout on a control message,
such as select and link test. This error may be the result of problems
with the remote entity, network errors, or slow network response. In
the case of slow network response, you may want to increase the
HSMST6 value.

See also HSMST6 Property, WinSECS control

Error 1114

Constant: wserrhsmst7 An HSMS T7 timeout has occurred. This may


indicate problems with the network or the remote equipment.
This is the period between establishment of the TCP/IP connection
and the receipt of an HSMS select request from the remote HSMS
entity. This error might result from problems with the remote entity,
network errors, or slow network response. In the case of slow network
response, you may want to increase the HSMST7 value.

WinSECS Version 2.7

132 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

See also HSMST7 Property, WinSECS control

Error 1115

Constant: wserrhsmst8 An HSMS T8 (network intercharacter) timeout


has occurred. This may indicate problems with the network or the
remote equipment.
This can occur if the SECS data are transmitted in multiple TCP/IP
network packets. This timeout occurs if successive packets are
received in a time longer than HSMST8. This may be because of
problems with the remote entity, network errors, or slow network
response. In the case of slow network response, you may want to
increase the HSMST8 value.

See also HSMST8 Property, WinSECS control

Error 1117

Constant: wserrhsmsreject An HSMS message was rejected. This may


indicate problems with the network or the remote equipment.
This error indicates that the remote HSMS entity has rejected a
message transmitted by this node. This is normally the result of lack
of state synchronization between the local and remote entities. This
should be a transient problem that will correct itself.

Error 1118

Constant: wserrdisconnectlocal The HSMS connection was closed by


your program's request.
You have closed the port using the ClosePort method.

Error 1119

Constant: wserrdisconnectremote The HSMS connection was closed


because a SEPARATE message was received.
The remote HSMS entity has done a clean termination of the HSMS
connection. Either the remote HSMS entity has shut down or it has
terminated the link with the intention of starting it up again.

Error 1120

Constant: wserrbadchar An RS-232 character was received with an


error indication from the UART.
This may indicate a baud rate mis-match, or noise on the line.
If the problem is a baud rate mis-match, you may want to consider
using the AutoBaud feature. If there is no baud mis-match and this
error occurs frequently, you should consider shortening the RS-232
cable, or using a shielded cable.

See also AutoBaud Property, WinSECS control

Error 1121

The WinSock library (WSOCK32.DLL) was not found.


Make sure TCP/IP is loaded properly on your computer if you wish to
use HSMS.
You have not installed TCP/IP support on your computer. You must
install the TCP/IP network support to use HSMS.

APPENDIX B: ERROR MESSAGES

133

Error 1122

WinSock reports that a connection has been reset by the remote


HSMS entity. WinSECS will attempt to reconnect.
The remote HSMS entity has reset 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 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

Constant: wserrnotconnected The HSMS port is not connected. No


SECS message transmission is possible until the HSMS connection is
established.
You have attempted to send a SECS message, but the HSMS port is
not in the connected state. If this is a passive connection, the remote
HSMS entity has not yet initiated the connection. If it is an active
connection, the remote HSMS entity is either not available or the
connection has not completed.
When using HSMS, you cannot send a SECS message unless the
Connected property is True.

See also Connected Property, WinSECS control, Connect Event,


WinSECS control

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

There is no transaction with index index.


Change the index to a number between 1 and TransactionCount.

See also NewTransaction Method

Error 1127

Constant: wserrcharacterdiscarded A character was discarded at the


data link level.
An incoming bad character was reported by the operating system.
This can be the result of noise on the line or a mis-matched baud rate.
A retry will occur at the data link level.

Error 1128

Constant: wserrt2timeout The T2 timeout period was exceeded.


A T2 timeout has expired. This means that either the communication
is broken between the host and equipment or that the value for the T2
property is too small.

WinSECS Version 2.7

134 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

See also T2 Property

Error 1129

Constant: wserrt1timeout The T1 timeout period was exceeded.


A T1 timeout has expired. This means that either the communication
is broken between the host and equipment or that the value for the T1
property is too small.

See also T1 Property

Error 1130

Constant: wserrt4timeout The T4 timeout period was exceeded.


A T4 timeout has expired. This means that either the communication
is broken between the host and equipment or that the value for the T4
property is too small.

See also T4 Property

Error 1131

Constant: wserrcommabort The communication driver on your


computer has aborted. To recover you must close and reopen the port.
The communication driver software that handles the serial ports on
your computer has aborted. This means that an error condition has
occurred from which the driver software cannot recover.
The reason for this error depends on the driver. The driver software is
installed to match your hardware configuration and so is not
necessarily the same from one computer to the next. In our testing we
have been able to cause this error only on a baud rate mismatch
between the equipment and the computer. If this is the problem you
should either use the AutoBaud feature or make certain that the baud
rates are matched. If this is not the problem you should contact the
supplier of your communication driver to determine the conditions
under which an abort can occur.

Error 1132

Constant: wserrchecksum The checksum for a SECS1 block does not


equal the sum of the data bytes received.
This error may be the result of line noise. If it occurs regularly, you
should check the binary data sent from the equipment to determine if
it is using the proper checksum values. You may also want to install
shielded cables.

Error 1133

The Duplicate method cannot be used on the Root item.


There is always exactly one Root item for a SecsMessage object. Its
purpose is to be the Parent SecsItem object for those items that are at
the top level of the SECS message. It is illegal to duplicate this
SecsItem. However, it is legal to duplicate one of the SecsItem objects
at the top level of the SECS message. Such items are children of the
Root item. The Root item does not appear in the SECS message sent or
received over the port.

See also Root Property

APPENDIX B: ERROR MESSAGES

135

Error 1134

A duplicate SECS1 block was detected and discarded.


A duplicate SECS1 block is one where the 10 header bytes are exactly
the same as those received in the previous block.
Normally this indicates that the sender has resent the block because
of a T2 timeout, but the receiver (WinSECS) had not rejected the
previous block. This is not an error under these conditions.
A duplicate block may also be received because the sender does not
manage system bytes properly. If this is the case (and only in this
case), you should disable duplicate block detection.

See also AcceptDuplicateBlocks

Error 1135

A SECS1 block was received with an unexpected block number.


The block number in the SECS1 header is unexpected. This will occur
if the equipment has sent (for example) blocks numbered 1, 3. Block
numbers must be sequential.

Error 1136

A SECS1 block was received with a block number indicating it is the


first block, but the first block was not expected at this time.
The block number in the SECS1 header is unexpected. This will occur
if the equipment has sent (for example) blocks numbered 1, 2, 1.
Block numbers must be sequential.

Error 1137

An illegal value has been entered into the Raw property.


The data passed to set the Raw property was not valid. WinSECS was
unable to convert this data to a byte representation. Make sure the
data passed contains Bytes whose values are between 0 and 255.

See also Raw Property, SecsMessage Object

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.

See also Raw Property, SecsItem Object

WinSECS Version 2.7

136 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

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

Before you call p. 139


How to contact Software Support
Other services

p. 140

p. 141

137

What is Software Support?


Software Support is a group of trained, technical professionals who
answer questions and help you when you need assistance with
products developed by Brooks Automation.
Coverage

The Software Support department is available for:

Customers using products covered under the ninety (90) day


warranty.

Products covered by current maintenance contracts.


To arrange for additional product maintenance, contact your sales
representative or send an e-mail message to ssgorders@brooks.com.
For more information about coverage, see How to contact Software
Support on page 140.
What you can expect

The Software Support department provides:

What you cannot expect

Courteous and professional service


Expertise with Brooks Automation products
Prompt and accurate answers to product issues
Customer advocates in the engineering process

These services are not available through Software Support:

Custom application support


System administration
Support for third party products
Product training
Support for sample code
Capacity planning and sizing models

Services not available from Software Support may be obtained


through our Consulting Services Organization. For information about
additional services, contact your sales representative.
Web-based support

WinSECS Version 2.7

138 WINSECS COM REFERENCE

In addition to the Software Support department, Brooks Automation


offers web-based support for its products. This includes online access
to current product information, documentation, release notes,
product alerts, supported configuration information, and frequently
asked questions (FAQs). Visit us at www.brooks.com.

2006 Brooks Automation, Inc.

Before you call


Please be prepared to provide a detailed description of the problem
and the sequence of events necessary to reproduce it. Make a note of
any measures you have taken to resolve the problem. If you need to
call for help while working through a problem, try to be near a
computer that is ready to run the application.
Gather and be prepared to provide the information in the table below.
Type of information

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

Where to reach you during business hours.

E-mail address

If you prefer to be contacted electronically, please give your


e-mail address.

Name of the product

If you are not sure of the product name:


For UNIX products, look at the expl file for the product
set.
On a PC, refer to the ReadMe file included with the
release.

Version information

To obtain version information for:


APC Platform, from the main menu of an application,
choose Help > About. Click the Additional tab to see
version information about all product components.
FACTORYworks (UNIX components), enter <product
name> -help at the command line to obtain version
information.
CELLworks, run the CELLversions script to display the
file containing version information. For more information,
see the CELLworks Installation Guide.
An ActiveX control on a PC, select its .OCX file in the File
Manager or Windows Explorer and press ALT+ENTER.
Click the Version tab to display the file version number.
A dynamic-link library on a PC, select the .DLL file in the
File Manager or Windows Explorer and press
ALT+ENTER. Click the Version tab to display the file
version number.

Type of hardware; operating


system and version; amount of
RAM

If you are not sure about this information, see your System
Administrator.

Before you call


139
APPENDIX C: SOFTWARE SUPPORT

How to contact Software Support


The Software Support department can be reached by phone, e-mail,
fax, or mail.
Reporting Method

Contact Information

Telephone

978-262-7970

E-mail

<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)

Mail

Brooks Automation
Attn.: <Product name> Software Support
(For example:
Brooks Automation
Xsite Software Support
15 Elizabeth Drive
Chelmsford, MA 01824 USA)

Hours of operation

Software Supports current operating hours are:


Monday through Friday (except company holidays)
8:00 AM - 8:00 PM, Eastern Standard Time.
If all Software Support engineers are busy when you telephone, please
leave a voice mail message. Your call will be returned by the first
available engineer.
If you need assistance during non-business hours, you can send an email or fax, or leave a voice mail message that details your question. A
Software Support engineer will contact you during regular business
hours.

Call tracking

Brooks Automation uses computer-based call tracking of all problem


reports. The Software Support engineer assigned to the issue will
provide you with a service request (SR) number to reference the issue
within the Brooks Automation support system.

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.

WinSECS Version 2.7

140 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Other services
Brooks Automation offers additional support services and enhanced
versions of products to qualified customers.
Dial-in support

Brooks Automation understands your need for high availability


manufacturing software solutions. Software Support offers dial-in
service connecting to your test or production systems to help resolve
critical issues if you have set up access and signed a remote access
agreement with Brooks Automation. Contact your sales representative
or the Software Support manager for additional details.

Free upgrades and bug


fixes

Brooks Automation may issue modified or enhanced versions of


products. Customers who have a current maintenance contract are
eligible to receive this software per the terms of the
Brooks Automation Software License Agreement.

Other services
141
APPENDIX C: SOFTWARE SUPPORT

WinSECS Version 2.7

142 WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

Index
A

setting using index code 32

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

Alternating mode 131

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

Boolean data type


drawbacks 13
buffers
running out of 131
Build method
constructing SecsMessage objects 14
button click events 23

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

Common Dialog controls 22


communication drivers
problems 135
communication errors
problems associating 68
communication ports

143

attempting to close 125, 128


closing 57
configuring 111
connection types 50
determining if connected 34
determining if open 49
invalid values 124
maximum allowed 128
monitoring traffic on 129
numbers 127
opening 104, 128 129
RS-232 104
SECS1 105
sending characters over 61
types, setting 104
unavailble 122
unsupported numbers 131
unsupported types 131

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

WinSECS Version 2.7


WINSECS COM REFERENCE

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

2006 Brooks Automation, Inc.

adding support for 24


binary, constructing 15
constructing 13, 111
creating 2
illegal length 121 122
improperly formatted 121
modifying 2
names 87
parsing 19
S1F1 64, 105 106, 110
S1F2 9
S9F1 31
SECS1 21
SECS2 122
simulating 53
steps taken after receiving 20
transaction objects 2
transmitting when port is closed 127
undefined, reading data from 112
WinSECS control having no record of sent 123
methods
AddNew 74
Build 14
ClosePort 57, 127
Delete 82, 101
Duplicate 101, 135
NewTransaction 57, 119
OpenPort 58
Receive 82
Reply 21, 82
Send 21, 83, 107
UseDefault 74, 118
modal dialogs
blocking events with 22
displaying 22
modal forms
creating modal dialogs as 22
Monitor events
generating 48
monitoring traffic on port 129
WinSECS controls 61
MonitorEnabled property
WinSECS controls 48
MultipleOpen property
WinSECS controls 48

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

SecsTransaction objects representing 79


sending 83
suspending sending 49
undefined 118

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

WinSECS Version 2.7


WINSECS COM REFERENCE

Length 14 15, 87, 97


Library 47
LinkTestTimer 47
MonitorEnabled 48
MultipleOpen 48
Name 79, 87, 98
NLB 15, 98
Parent 99
PortIsOpen 49
PortType 50
Primary 79
Raw 14, 87, 99, 136
RawHex 14, 88, 122
read-only when transaction in progress 117
ReplyExpected 21, 80
RetryLimit 51, 124, 129
Root 89
Secondary 80
SecsHost 51
SerialPort 52, 128
SimulateMode 53
Stream 90, 117
SystemBytes 81
T1 54, 124
T2 54, 124
T3 55, 124
T4 55, 124
Tag 24, 81
Transaction 72, 118 119
TransactionCount 73
Value 11, 99, 120

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

InProgress property effect on 20


not received within T3 timeout period 129
object names 19
SecsTransaction objects representing 80
sending 82
undefined 118
unexpected 127
W bit 80
Secondary property
SecsTransaction objects 80
SecondaryIn events
resulting from Send method, ReplyExpected True
21
triggering 106
WinSECS controls 66
SecondaryOut events
resulting from Reply method 21
WinSECS controls 67
SECS (Semiconductor Equipment Communication Standard)
WinSECS and 1
SECS arrays
See arrays.
SECS blocks
duplicate 29
interleaving 42
SECS cables
checking 129
SECS devices
connecting multiple 2
default IDs 37
IDs 2
SECS drivers
transaction records 129

S1F13 transactions 64

SECS formats
invalid 125

S1F14 transactions 64

SECS function numbers 86

S1F2 messages
SecsItem objects that represent 9

SECS hosts
WinSECS controls acting as 51

S9F1 messages
adjusting device IDs on receipt of 31

SECS interface library


memory errors 127

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

WinSECS Version 2.7


WINSECS COM REFERENCE

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.

Semiconductor Equipment Communication Standard


See SECS.
Send method
events resulting from 21
SecsTransaction objects 83
substitution method 107
serial ports
name restrictions 125
obtaining names 52
specifying 128

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

software support 137

T1 timers
obtaining 54
timeouts 135

T3 property
invalid values 124
WinSECS controls 55

sockets
connection failures 132
problems creating 131
shutting down 134

invalid values 124


WinSECS controls 54

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

W bits 80, 127

vbDouble data type


drawbacks 13

TransactionCount property
SecsLibrary objects 73

UseDefault method
SecsLibrary objects 74, 118

VB Toolbox
incorporating WinSECS controls 2

Visual Basic applications


adding WinSECS controls to 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

WinSECS Version 2.7


WINSECS COM REFERENCE

2006 Brooks Automation, Inc.

You might also like