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

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

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Length property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AutoSystemBytes property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 TransactionCount property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ActionOnSuccess property . . . Stream property . . . . . . . . . . . . . . . . . . . . . . . . . . Description property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Properties Description property . . . . . . . . . . . 75 Properties ActionOnError property . . . . . . . . . . . . . . . Root property . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 SecsTransaction Object SecsMessage Object Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 76 77 77 78 78 78 79 79 80 80 81 81 Methods Delete method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reply method . . . . . . . . . . . . . . . . . . 91 CONTENTS v . . . Tag property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Receive method . . . . . . . . . . . . . . . . . . Secondary property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .SecsLibrary Object Chapter 3 . . . . . . Item property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ReplyExpected property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . InProgress property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DeviceID property . . . . . . . . 86 86 87 87 87 88 88 89 90 Methods Build method . . . . . . Name property . . . . . . . . . . . . . . . . . . . . . . . . . Raw property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 UseDefault method . . . . . . . . . . . . . . . . . . Primary property . . . . . . . . . . . . . 73 Methods AddNew method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 82 82 83 Chapter 5 . . . . Name property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Function property . 91 Parse method . . . . . . . . . . . . . . . . . . . . . . . . . 85 Properties Description property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RawHex property . . . . SystemBytes property . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Transaction property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index property . . . . . . . . . . . . . . . . . . . . Send method . . . . . . . . .

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.

A space with an underscore code _ moreCode A space with an underscore indicates continuation of a line of code on the next line. Apostrophe in sample code ’ SomeComment An apostrophe is used to indicate a line of code comment. replies and filenames.About This Book This book describes the WinSECS Active X control. and provides an alphabetical listing of its objects. • SecsItem objects. which represent a primary and secondary SECS message sequence. parsing. and events. methods. SECS message construction. properties. • SecsTransaction objects. and data types. which represent a SECS message. which contains message templates that help you to construct SECS messages. xi . xi Information included in this book The first chapter of this book includes an overview of the objects that make up WinSECS. Information included in this book Notation conventions p. which contain the lists or values within a SECS message. • SecsMessage objects. Later sections contain information about using: • The SecsLibrary object. Notation conventions WinSECS documentation uses the following typographic conventions: Convention Example Description Monospace font Sample code Used for code. • Examples and error codes. searching. xi p.

7 xii WINSECS COM REFERENCE © 2006 Brooks Automation. .WinSECS Version 2. Inc.

22 Handling secondary messages in Visual Basic p. To use WinSECS you must first understand these standards. 15 Item searching p. 23 1 . 3 Incorporating the WinSECS control in your application Keeping the .1 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). 11 Array items p. 4 SecsTransaction object p. 3 p.oca file available p. WinSECS also facilitates communication with Generic Equipment Model (GEM)-compliant manufacturing equipment. 14 Binary message construction process p. 8 p. 12 Potential conversion problems p. 9 Data types p. 13 SECS message construction p. 22 Event blocking with modal dialogs p. 2 Adding WinSECS to your Visual Basic application p. 3 Instructions for Visual Basic 6. 13 Item construction conversion process p. 4 SecsLibrary object: the message library p. These standards are established by the Semiconductor Equipment and Materials International (SEMI) standards committee. 21 Issues when using Visual Basic p. 7 SecsMessage object SecsItem object p. 17 SECS message parsing Event sequences p.0 p. 3 WinSECS objects p. Overview of WinSECS p. 19 p.

Each device is identified by its SECS device ID. and TELNET transport mediums) and Highspeed SECS Message Services (HSMS) equipment connections. SecsTransaction object. TCPIP. . Once you have the control on the form. Follow the installation instructions in that document before proceeding. You can pick messages from this Library. 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. The WinSECS control is added to a Visual Basic program by incorporating it into the VB Hotbox. In a WinSECS application. time-outs.7 2 WINSECS COM REFERENCE To run WinSECS you must have the system setup described in the WinSECS ReadMe. You can copy and modify this Library to include only those messages that are common to the applications that you develop. and SecsItem object. receive. The SECS message parsing and construction services that WinSECS provides allow you to create or modify messages at run time. and add them to your application. etc. WinSECS provides simple diagnosis and resolution of even the toughest protocol problems. You can use multiple WinSECS controls in an application for interfaces over multiple ports. The WinSECS Library contains predefined transaction templates for all messages in the SECS standard. WinSECS consists of the WinSECS control and four OLE objects that are derived from the control: SecsLibrary object.Overview of WinSECS Brooks Automation supplies WinSECS as a Visual Basic OLE custom control. SECS messages are represented by transaction objects. The WinSECS control supports SECS1 (including RS-232. This capability facilitates development of interfaces that can be easily tweaked or updated in response to changing conditions on the factory floor. and create messages that comply with the SECS2 standard and are communicated across the SECS1 or HSMS links. Inc. You can also add new. © 2006 Brooks Automation. Installing WinSECS WinSECS Version 2. When this feature is combined with Visual Basic’s debugging environment. You can connect multiple SECS devices on each port. WinSECS allows you to send. SecsMessage object. modify them. 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. non-standard messages to the Library. You double click or drag it from the toolbox and drop it on a Visual Basic form.

Incorporating the WinSECS control in your application To incorporate the WinSECS control in your application.ocx). The FASTech WinSECS control. click the FASTech WinSECS Control check box and choose the OK button to close the Components dialog box. use standard VB coding practices to build the interface by filling in the desired Event Handlers and setting the control Properties. Keeping the . choose Components. double click on it or drag. as shown below. Adding WinSECS to your Visual Basic application 3 CHAPTER 1: INTRODUCTION TO WINSECS . During runtime. appears in your project toolbox.oca file available If you prepare an executable under Visual Basic that will be distributed to other machines. The control will be placed on your form.oca file is available to the executable (in the same directory as WinSECS. 2. Once you have the control on the form. the control is invisible. Instructions for Visual Basic 6. From the Project menu.0 f To add WinSECS to your Visual Basic application: 1. forms. and insertable objects. make sure that the WinSECS.Adding WinSECS to your Visual Basic application There are a few simple steps to add WinSECS to your Visual Basic application. From the Controls menu. The Components dialog box displays a list of the available custom controls.

such as S1F1. which contains all of the messages in the SECS standard.7 4 WINSECS COM REFERENCE © 2006 Brooks Automation. You can copy the Library and include only those messages that are common to the applications that you develop. You can also modify the SecsTransaction objects in the library to suit your needs. These objects are described in more detail in the sections that follow. SecsItem Represents an item in a SECS message. You can use the default library. . Every SecsTransaction consists of a Primary and a Secondary SecsMessage object. SecsTransaction Represents an Order or Reply pair. When you WinSECS Version 2. The OLE automation objects derived from WinSECS are: SECS Object Description SecsLibrary A set of SecsTransaction objects. SecsLibrary object: the message library The WinSECS control is supplied with a default Message Library (SecsLibrary object) which contains the entire SECS standard. In addition to picking pre-defined message templates from the default Library. Consists of a Root SecsItem object and SecsItem objects for the message content. You can modify messages to suit your application. such as MDLN. SecsMessage Represents a single (Primary or Secondary) SECS message. but it does simplify the creation of a SECS transaction. The use of the Library is not required. You can also add new. This default SecsLibrary object contains a set of pre-defined templates of SecsTransaction objects for the entire SECS standard. You must be familiar with these objects in order to use the WinSECS control.WinSECS objects SECS messages are represented as a set of OLE automation objects. Inc. or you can customize it with transactions you define yourself. such as S1F1. The Message Library supplied with WinSECS contains templates for the entire SECS standard. the Message Library can be customized to suit your needs. The Library lets you define those messages supported by your equipment. The items contained in the primary and secondary messages of each SECS transaction are already created for you. Properties and Methods associated with each object are described in the reference chapter for that object. S1F2. non-standard messages to the Library.

<MDLN> 2. To use the templates. To reduce these steps. add two items to the item list. name the transaction.use the NewTransaction method in preparation for sending a message. In the case above. For primary messages. For example. the S1F1. you would use the S1F1 template. name the item. WinSECS uses the Library when it parses incoming messages. and name the two items. 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 .2 1. if a SecsTransaction in the Library has a SecsMessage with Stream and Function matching the incoming message. This saves you the effort of constructing the SecsTransaction object manually each time you want to use it. In addition. establish the default Library and create a copy of the transaction template. add an item. use the transaction templates in the Library. you can specify a library transaction to duplicate. you would have to: create a new transaction. name the contained messages.F2 transaction in the SECS standard is defined in this library as follows: S1.F2 On Line Data (D) L. WinSECS will use that SecsTransaction as the basis for the parse.F1 Are you there request (R) S1. <SOFTREV> If you were to create this transaction yourself. Items in the incoming SECS message will be assigned names as defined by the SecsItem objects in the Library transaction template.

Transaction(2) WinSECS1. Inc.Transaction(“S1F1”) (“S1F1”) SecsTransaction WinSECS1.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.Transaction(2) SecsTransaction Name = S1F3 SecsTransaction Name = S6F13 For more information on the syntax of SecsLibrary objects. WinSECS Version 2.Library.Library.7 6 WINSECS COM REFERENCE © 2006 Brooks Automation. .Library.Library.Library.Transaction(“S1F1”) Name = S1F1 WinSECS1.Library.Transaction(2) WinSECS1.Transaction(2) WinSECS1.Library.Transaction(2) WinSECS1. see the reference chapter “SecsLibrary Object” on page 71.

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 .SecsTransaction object A SecsTransaction object represents a primary and secondary message sequence: it always contains a Primary SecsMessage object and a Secondary SecsMessage object.

To the left of the SecsItem objects are the properties of the SecsMessage object that are used to reference the SecsItem. The first SecsItem object is the Root and does not appear in the SECS message. . named MDLN and SOFTREV. Each SecsTransaction contains two SecsMessage objects. WinSECS creates a new SecsTransaction object automatically and passes it to the PrimaryIn event handler of the WinSECS control. you must create a new SecsTransaction object using the NewTransaction method of the WinSECS control object. but is used as a parent item for the items that do appear in the message. When a primary SECS message is received. A SecsMessage object always contains a Root SecsItem object. SecsMessage Root SecsItem Item(“L”) Item(“L”) Item(“MDLN”) Item(“MDLN”) Item(“SOFTREV”) Item(“SOFTREV”) Item(“SOFTREV”) WinSECS Version 2. obtained using the Primary and Secondary properties of the SecsTransaction object. Inc. The Root SecsItem does not appear in the binary SECS message. SecsMessage object A SecsMessage object is an object that represents a SECS message (either Primary or Secondary). The figure below shows the structure of a SecsMessage object and the contained SecsItem objects that represent a standard S1F2 message. For more information on syntax of SecsTransaction objects.To send a primary message. The next item is a List. see the reference chapter “SecsTransaction Object” on page 75. The list contains two items.7 8 WINSECS COM REFERENCE SecsItem Name = L SecsItem Name = MDLN SecsItem Name = SOFTREV © 2006 Brooks Automation.

it is used as a parent for the SecsItem SecsItem object 9 CHAPTER 1: INTRODUCTION TO WINSECS . 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. see the reference chapter “SecsItem Object” on page 93. The Root SecsItem object does not appear in the SECS message.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.

To the left of the SecsItem objects are the properties of the SecsMessage object that are used to reference the SecsItem objects. .objects below. Inc. 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.7 10 WINSECS COM REFERENCE © 2006 Brooks Automation. WinSECS Version 2.

2. wsFormatAscii. a two-step conversion is performed. If a conversion cannot be performed. (The Variant type in the left column is the type returned by the Visual Basic VarType function.0 (floating point) and the Format property to wsFormatU1. The data type of the Value property is Variant. wsFormatJis8 If the SECS item format code is wsFormatVar. You set the Value property of the SecsItem object to 3.) Variant type SECS item format vbNull. suppose you want to send a SECS message containing an item of SECS type U1 (one byte unsigned integer). wsFormatU2. When a SECS message is sent. wsFormatU1. The associated data value is available through the Value property of the SecsItem object. 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 items in the SECS message are converted to the Variant types indicated in the table above. The vbLong variant is converted to one byte unsigned integer. The Float variant 3. When you send the message. The following table shows the correspondence between the various SECS formats and their associated Variant types.Data types WinSECS uses the “Variant” data type to handle the various item formats defined by the SECS standard. wsFormatBoolean vbSingle wsFormatF4 vbDouble wsFormatF8. wsFormatI8.0 is converted to a vbLong variant type. wsFormatI4. an error event is produced. vbEmpty Item is zero length in SECS message vbLong wsFormatI1. When a SECS messag is received and parsed by the WinSECS control. The actual SECS item format code used is determined by the Format property of the SecsItem object. the WinSECS control performs these conversions: 1. For example. wsFormatI2. wsFormatU4. wsFormatU8 vbString wsFormatBinary. Data types 11 CHAPTER 1: INTRODUCTION TO WINSECS . 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). The resulting variant is then converted to the desired SECS item format.

. The type of each element in the array is the same and is governed by the rules above.Array items A SECS item that is an array is handled in the same fashion as nonarray items. • For outgoing messages. or wsFormatBinary. WinSECS Version 2. Restrictions on arrays While the Variant data type is able to store arrays of any type. because the values in the array must be resolvable to a numeric value. SECS does not allow arrays of those types. The rules WinSECS uses for SECS array items are: • For incoming messages. wsFormatJis8. a SECS item is more constrained. wsFormatAscii. the Format property may not be wsFormatList. The Variant data type is also used to represent array items.7 12 WINSECS COM REFERENCE © 2006 Brooks Automation. and even mixed types within the array. However. Inc. the type of the SECS item array is determined by the Format property. the SECS array item is converted to an array Variant.

and I8 SECS formats. During message construction. The WinSECS control constructs a secondary SecsMessage object when the Reply method is used. the binary message then becomes scheduled for transmission over the port. You should make sure that the low byte is zero if you intend a False value. precision may be lost when converting U8 and I8 variables to vbDouble. U8. there are a few problem areas: Integer representations Notice that the vbDouble data type is used for U4. the U8 and I8 data types are used infrequently. Reply. The WinSECS control constructs a primary SecsMessage object when the Send method is used. SECS messages are constructed when you use the Send. However. It just indicates that the construction was successful and the message has been scheduled for transmission. SECS message construction Message construction is the process of translating a SecsMessage object into the binary form that is actually sent over the port. you will have to access the raw formats of the data. or Build methods. Successful completion of the Send or Reply method does not mean that the message has been transmitted. In the case of U4 data this is not a problem. The construction is done by WinSECS and requires no interaction from the user. Boolean values When sending a Boolean item. and produces very large numbers. If you use equipment that uses the U8 and I8 formats. This is because the range of these formats lies outside the range represented by the vbLong type.Potential conversion problems Although the Variant data type does a good job representing most of the SECS data formats. Fortunately. A safe practice is to use the Visual Basic keywords True and False. the value of the item is converted to a four-byte integer and the low byte of the integer is sent. the properties of the SecsMessage object (and the SecsItem objects contained) can change. When SECS message construction 13 CHAPTER 1: INTRODUCTION TO WINSECS . This event notifies your application that the transmission is complete. the PrimaryOut or SecondaryOut event is triggered. When the message is successfully sent over the port. and non-zero if you do not. If message construction completes successfully. The vbDouble data type can represent the entire range of U4 items without loss of precision.

Each SecsItem object is converted to its binary value. RawHex. The Raw. If you have specified wsFormatVar. the format code is determined from the type of the Value. 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). wsFormatI4 is used. The binary message is constructed using the converted values for each item. The following steps occur during message construction: 1. Determine format code for item If you specify any format code for the item other than wsFormatVar. 3. .the Build method is used. “Item construction conversion process” on page 14). the item format is determined as follows: Value type VarType SECS format used vbInteger 2 wsFormatI2 vbLong 3 wsFormatI4 vbSingle 4 wsFormatF4 vbDouble 5 wsFormatF8 vbCurrency 6 wsFormatF8 vbBoolean 11 wsFormatBoolean vbByte 17 wsFormatU1 All others WinSECS Version 2.7 14 WINSECS COM REFERENCE wsFormatAscii © 2006 Brooks Automation. according to the item construction conversion rules (discussed in the following section. 4. whatever SecsMessage object it is applied to is constructed. Item construction conversion process The following steps occur during item construction: 1. that format code is used for the item. 2. according to the binary message construction rules (discussed in the section “Binary message construction process” on page 15). Inc. Otherwise. If the Value is an array. 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).

4. If the value of an item is Null. whichever is larger. Arrays in SECS can contain only numeric or Boolean values (even though Variant arrays in Visual Basic can also contain strings and other arrays). 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. Length The length is either the value determined during the item construction conversion process (if the item is not a list). 3. the SECS format code for the item is determined as for any other item. the SECS item generated is of length zero. For numeric values. or the number of items defined in the list (if the item is a list). For string values (including formats wsFormatAscii. 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. SECS message construction 15 CHAPTER 1: INTRODUCTION TO WINSECS . This means that if the Format property is wsFormatVar. Array items are converted like other items. An error will result if an array item contains an element that cannot be converted to a numeric value. The SECS item header is constructed. If this conversion fails for any SecsItem within the message. If the value of an item is Null.2. the SECS format code is ASCII. Update length property of item The length of the item is the number of bytes in the binary representation created. except that the conversion happens for each element of the array. and wsFormatBinary) the length is the number of bytes in the string. wsFormatJis8. this will be a multiple of the length implied by the format code. message construction is unsuccessful. Binary message construction process The following steps occur during binary message construction: 1. Create binary SECS data The binary SECS data is created from the converted value. The SECS item header contains: Item Format Code The format code is the code determined during the item construction conversion process.

The binary data for the item is that obtained from the “Item construction conversion process” on page 14.7 16 WINSECS COM REFERENCE © 2006 Brooks Automation. (See the previous discussion about the “Item construction conversion process” on page 14. If the item is a list. WinSECS Version 2. If the item is not a list. each item in the list is constructed.) 3.2. . Inc. the binary data for the item is added to the message.

then of waf’s first grandchild. If the boxes below are SecsItems. Item searching 17 CHAPTER 1: INTRODUCTION TO WINSECS . If there are no matching descendants of the first grandchild. the SecsItems within waf will be searched recursively until a match is found. In other words. so a search for waf.item(“waf”) when applied to the SecsItem named waf will fail. 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). 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. the second grandchild’s descendants are searched. WinSECS will search not only the SecsItem to which you apply the Item property. 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). It will then search the children of waf’s first child. the search will occur in the order shown alphabetically.Item searching To locate a particular item in a SECS message. but all child items as well.

a search for the SecsItem named X waf.7 18 WINSECS COM REFERENCE © 2006 Brooks Automation. In the figure below. 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. Inc.item(“X”) will return the circled item.The search terminates when the first item that matches the search parameters is found.

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.Item(“X”. WinSECS assigns names to the new objects using the InProgress property of the SecsTransaction object. For Primary messages. See “Item property” on page 96 for more detailed information on syntax. it applies within a given Parent item: it is the instance of the item within a list.If you give an Instance number as the second parameter to the Item Property. waf. It is good practice to use unique item names. 2) will return the circled item. 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. Parsing is done by WinSECS and requires no interaction from the user. not the instance within the entire search. 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. In the figure below. SECS message parsing 19 CHAPTER 1: INTRODUCTION TO WINSECS . Use duplicate names for similar items in the same parent list.

Inc. NLB. This transaction is used in parsing. a blank SecsTransaction object is created. but not found in the actual SECS message. the Format. the properties of that item are assigned the extracted values. the list of InProgress transactions is searched. Stream. Such items are deleted from the transaction object. 6. Length. Forward completed transaction object WinSECS Version 2. or against the DeviceID. If the message is a Primary message. If the value of the Function property is odd. If such a transaction is found. If the item violates the SECS2 standard. the WinSECS control searches the Library for the first transaction with a primary message with matching Stream and Function values. Otherwise the new item name is left blank. Determine type of transaction 2. If a matching transaction is not found. 5. Otherwise a blank transaction is created. and Value of the item object are extracted. If it is even. it is removed from the list of InProgress transactions by setting its InProgress property to False.The following steps occur when a SECS message is received: Determine type of message 1. When all items have been extracted. the resulting SecsTransaction object is passed to the PrimaryIn or SecondaryIn event. a SecsError event is generated and the message parsing fails. © 2006 Brooks Automation. The message is matched against the InProgress transactions based on either the system bytes (if IgnoreSystemBytes is False). Parse message items 4. The new item is then assigned the extracted values. and Function (if IgnoreSystemBytes is True). If the parse is the result of an incoming message (instead of the Parse method). If there is an item object in the transaction at a position just prior to the extracted item in its parent list. the transaction is scanned for items that were defined. it is copied and used for parsing the message. If the transaction contains a SecsItem object at a location corresponding to the extracted item. the message is a primary message. Otherwise a new item object is created and inserted in the transaction. . If the message is Secondary. During parsing. the new item is assigned the same name as that previous item.7 20 WINSECS COM REFERENCE 7. Each item in the SECS message is parsed. 3. If a matching transaction is found. it is a secondary message.

These messages are the responsibility of the users. The SecondaryIn event will later trigger if ErrorCode is zero.Event sequences When the Send or Reply methods are used. or the reply was partially received. a T3 timeout occurs. Event Resulting from Send Method. 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. otherwise it is non-zero. events described in the following tables can occur: Note WinSECS does not automatically send stream 9 messages. SecondaryIn Triggered when the secondary message is either received. ErrorCode is zero if the message is parsed without error. 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. 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 . However. if AutoDevice property of the WinSECS control is set to “True” WinSECS will use the S9F1 message to adjust its DefaultDeviceID property.

( Other custom controls can display modal dialogs as well. but they are delayed until the dialog box is closed. it is fairly simple to construct a Visual Basic modal form that does the same job. In the case of the MsgBox function. none of the Visual Basic code in your application will run until the dialog box is closed. Interestingly. When the modal dialog box is closed. You are faced with the decision to code a modal form to do the job. Hence. or to use some more elaborate application level change to avoid the problem. Creating these dialogs as modal forms is possible. 2. If you display a modal dialog. WinSECS then issues all of the Events that it stored while the dialog was displayed. In fact. . Such dialogs are displayed by the MsgBox function and the Common Dialog control. this problem does not occur with modal forms. This becomes more difficult with the Common Dialog control.) This means that the Event procedures. When a breakpoint is reached in the Visual Basic debugger. There are other times when Visual Basic cannot process Events. will not be triggered. When a modal dialog is displayed by any control or by the MsgBox function. WinSECS Version 2. When an untrapped error causes Visual Basic to display an error dialog.Issues when using Visual Basic Visual Basic is the programming environment for SECS interfaces using the WinSECS OLE control. These include 1. your application will not be able to process incoming messages until the dialog is closed. disable the dialog when your application is communicating with the equipment. the Events are not lost. but it is a bigger job. How can you avoid this problem? The simple answer is not to use modal dialogs. such as the PrimaryIn Event. This behavior can have adverse effects in your application. Inc. The WinSECS control reacts to this condition by storing the Events. 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. 3. Visual Basic informs the WinSECS control that it is now able to process Events.7 22 WINSECS COM REFERENCE © 2006 Brooks Automation. 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. This condition will persist until the modal dialog is closed.

You don't want your application to "hang" while the equipment processes your request. Also suppose that we can ask the etcher for the chamber pressure using an S1F3 transaction.Item("SV") End Sub Issues when using Visual Basic 23 CHAPTER 1: INTRODUCTION TO WINSECS . and the text box is named PressureText. In the button click event. you create a form with a text box to contain the pressure and a button.NewTransaction("S1F3") Trans. So. then you want to write the following code: Sub PressureButton_Click ( ) Dim Trans As SecsTransaction Set Trans = WinSECS1. Remember that a SECS transaction may take many seconds to complete.Item("SVID") = 15 Trans. send the primary and get the reply PressureText = Trans. This lets your application go off and do other things while the SECS communication is in progress.Secondary..Primary. a better way to code this application is: Sub PressureButton_Click ( ) Dim Trans As SecsTransaction Set Trans = WinSECS1.Send End Sub Private Sub WinSECS1_SecondaryIn(ByVal Trans As _ SecsTransaction.. That's why the Send method does not complete immediately. The "send the primary and get the reply" part of this code won't work. You probably also want to be able to handle user commands while this transaction is in progress.NewTransaction("S1F3") Trans.Item("SVID") = 15 '.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. with SVID = 15. It's perfectly legal for the equipment to send an alarm report while your transaction is in progress. ByVal ErrorCode As Long. you want to write code to query the etcher for the chamber pressure and display the value in the text box. (Actually you could do it by checking the InProgress property of the SecsTransaction object in a loop. ByVal ErrorText As String) PressureText = Trans. If the WinSECS control is named WinSECS1. the button is named PressureButton.Primary.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. 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. To accommodate this need.

Item("SVID") = 15 Trans. Instead of handling the "Pressure" and "Temperature" cases directly. First. This is the fundamental idea in handling secondary messages.Tag Case "Pressure": PressureText = Trans.Send End Sub Private Sub WinSECS1_SecondaryIn(ByVal Trans As SecsTransaction. passing the Trans object as a parameter.Primary. ByVal ErrorText As String) Select Case Trans. . But now look at the SecondaryIn event code. The click event code for TemperatureButton will be nearly identical to that for PressureButton.NewTransaction("S1F3") Trans. Here we need to decide which secondary message we have received.Item("SV") Case "Temperature": TemperatureText = Trans. Second. we will have problems when we want to add support for more messages. Let's tackle this second issue first.Item("SVID") = 22 Trans.7 24 WINSECS COM REFERENCE © 2006 Brooks Automation. There are still problems with this application.NewTransaction("S1F3") Trans. We can generalize this approach. Does it contain the temperature or the pressure? There are many ways to tackle this problem.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. We add a new button to the form and a new text box. we could call a second function to handle WinSECS Version 2.Send End Sub Private Sub TemperatureButton_Click() Dim Trans As SecsTransaction Set Trans = WinSECS1. ByVal ErrorCode As Long. Inc. Also. Suppose we want to add a second button. that will display the susceptor temperature when clicked. we could call user written functions for these cases. 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.Primary. These are named TemperatureButton and TemperatureText. We can get the susceptor temperature using SVID = 22 (we get this from the SECS manual provided with the equipment). Here is an example: Private Sub PressureButton_Click() Dim Trans As SecsTransaction Set Trans = WinSECS1.Tag = "Temperature" Trans. we do not check for errors.Item("SV") End Select End Sub Here we have used the Tag property to select the desired action when the Secondary message is received.Tag = "Pressure" Trans.

based first on the Tag and then on whether ErrorCode is zero or non-zero. PrimaryIn. and SecondaryOut.errors (the case where ErrorCode is non zero). Then our SecondaryIn event logic becomes a selection of various functions. PrimaryOut. This is the basic way we recommend you handle your SecondaryIn events. You can extend this method for the other events. Issues when using Visual Basic 25 CHAPTER 1: INTRODUCTION TO WINSECS .

Inc.7 26 WINSECS COM REFERENCE © 2006 Brooks Automation.WinSECS Version 2. .

This chapter contains the reference for the control properties. 34 ConnectionMode property CurrentBaud property p. 37 p. 29 p. Properties AcceptDuplicateBlocks property AutoBaud property p. 47 27 . 41 IgnoreSystemBytes property Interleave property p. 42 IPAddressLocal property IPPortRemote property Library property p. 32 BaudIndex property CodePage property Connected property p.2 Chapter 2: WinSECS Control The WinSECS OLE control provides SECS messaging over a single physical port. 35 p. methods and events. 36 CurrentConnectionMode property DefaultDeviceID property EncodingCode property ErrorConstants p. 36 p. 46 p. 38 HSMST3 property p. 30 AutoDevice property Baud property p. 33 p. 38 HSMST5 property p. These elements are documented in alphabetical order within each group. 43 p. 41 p. 37 p. 31 p. It can support multiple SECS devices connected to that port. 39 HSMST7 property p. 32 p. 39 HSMST6 property p. 40 HSMST8 property p.

51 SerialPort property p. 65 SecondaryIn event p. 68 SecsWarning event WinSECS Version 2. 60 Disconnect event Monitor event p. 57 p. 54 T2 property p. 51 p. . 58 Events Connect event p. 47 MonitorEnabled property MultipleOpen property PortIsOpen property PortType property p. 69 © 2006 Brooks Automation. 61 p. 48 p. 57 NewTransaction method OpenPort method p. 67 SecsError event p. 52 SimulateMode property T1 property p. Inc. 55 T4 property p. 49 p. 63 PrimaryOut event p. 66 SecondaryOut event p. 48 p.7 28 WINSECS COM REFERENCE p. 61 PrimaryIn event p. 50 RetryLimit property SecsHost property p. 54 T3 property p. 55 p. 53 Methods ClosePort method p.LinkTestTimer property p.

Generally. If the AcceptDuplicateBlocks property is True. but its value takes effect only when you call the OpenPort method. PortIsOpen Property. then reopen the port with the OpenPort method. Changing this value when the port is open has no effect on the port.]WinSECSn. OpenPort Method. the WinSECS control discards duplicate blocks. as is recommended by the SECS standard. PortType Property AcceptDuplicateBlocks property 29 CHAPTER 2: WINSECS CONTROL . you should set this property to True only if the equipment does not properly generate SECS system bytes. Applies to wsPortTypeRS232 wsPortTypeTELNET wsPortTypeTCPIP Syntax [form. You can change the value of this property at any time.AcceptDuplicateBlocks[ = { True | False }] Notes A duplicate SECS block contains exactly the same ten SECS header bytes as the previous block.Properties This section presents the properties of the WinSECS OLE control. To make the change effective you must first close the port using the ClosePort method. AcceptDuplicateBlocks property Sets or returns a Boolean value which indicates whether or not the WinSECS control accepts duplicate SECS blocks. the WinSECS control accepts duplicate blocks. Normally. Default value False Data type Boolean See also IgnoreSystemBytes Property.

. This prevents real protocol errors from causing an undesired baud rate adjustment. protocol errors do not “count” against the RetryLimit. If you need to use these data rates. you cannot use the AutoBaud feature.AutoBaud property Sets or returns a Boolean value which indicates whether or not the WinSECS control automatically adjusts its baud rate. you can read the CurrentBaud property to determine the actual baud rate setting. If a data link protocol error occurs while a handshake character (ENQ. the control adjusts its baud rate to the next setting in the list below: • 19200 • 9600 • 4800 • 2400 • 1200 3. The AutoBaud feature is disabled after the first successful transmission or reception of a SECS message. Inc. This prevents WinSECS from giving up on a baud rate synchronization attempt because the RetryLimit was exceeded. During the AutoBaud attempt. When using a WinSECS control to talk to another WinSECS control. When using AutoBaud.]WinSECSn. 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. The initial baud rate used is that specified by the Baud property. EOT.7 30 WINSECS COM REFERENCE © 2006 Brooks Automation. 2. WinSECS Version 2. Note The baud rates 150 and 300 (which are legal in the SECS standard) are not included in the AutoBaud list. If a framing error occurs at the 1200 baud rate.AutoBaud[ = { True | False }] Notes The WinSECS control uses the following algorithm when automatically adjusting its baud rate: 1. you should use the AutoBaud feature on only one of the controls for best results. ACK. or NAK) is expected at the SECS1 level. Applies to wsPortTypeRS232 Syntax [form. the control sets its rate to 9600 and the AutoBaud attempt continues.

Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTELNET wsPortTypeTCPIP Syntax [form. but its value takes effect only when you call the OpenPort method. SecsHost Property AutoDevice property 31 CHAPTER 2: WINSECS CONTROL . OpenPort Method. To make the change effective you must first close the port using the ClosePort method. changes to the value of this property affect the handling of any subsequent S9F1 messages.You can change the value of this property at any time.]WinSECSn. the WinSECS control automatically sets the default device ID to the correct value. You can determine the default device ID in use at any time by reading the DefaultDeviceID property.AutoDevice[ = { True | False }] Notes The S9F1 message is issued by the equipment when it receives a message with an incorrect device ID. then reopen the port with the OpenPort method. CurrentBaud Property. PortIsOpen Property. If this property is set to True. Default value True Data type Boolean See also DefaultDeviceID Property. You can change the value of this property at any time. DeviceID Property. PortType Property AutoDevice property Determines whether or not the default device ID is automatically adjusted upon receipt of an S9F1 message. Set this property to True only if the equipment supports a single SECS device ID. Changing this value when the port is open has no effect on the port. Default value True Data type Boolean See also Baud Property. as reported in the SECS1 header of the S9F1 message.

Changing this value when the port is open has no effect on the port. You can change the value of this property at any time. PortType Property BaudIndex property Sets or returns the baud rate using an index code.BaudIndex [= BaudIndexCode ] WinSECS Version 2. but its value takes effect only when you call the OpenPort method. 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. Default value 9600 Data type Long See also AutoBaud Property.]WinSECSn. then reopen the port with the OpenPort method.Baud[ = BaudRate] Notes The serial port hardware must support the BaudRate value. OpenPort Method.Baud property Sets or returns the baud rate for the serial port.7 32 WINSECS COM REFERENCE © 2006 Brooks Automation.]WinSECSn. . Applies to wsPortTypeRS232 Syntax [form. Inc. PortIsOpen Property. BaudIndex Property. CurrentBaud Property. To make the change effective you must first close the port using the ClosePort method. Applies to wsPortTypeRS232 Syntax [form.

you can use the ListIndex property of the list or combo box to set the BaudIndex property. Applies to wsFormatAscii Syntax [form. the BaudIndex property also changes. CurrentBaud Property. Likewise. the Baud property changes. Default value 5 Data type Long See also AutoBaud Property. Baud Property. For example. PortType Property CodePage property Specifies the encoding scheme used by the tool to convert the SECS Format 20 ASCII items. If you display the list in the order shown above. The following table shows the relationship between Baud and BaudIndex property values. when you change the BaudIndex property. PortIsOpen Property.Codepage [ = valid Code Page] CodePage property 33 CHAPTER 2: WINSECS CONTROL . if you set the BaudIndex property to 5.Notes The BaudIndex property is an alternative to the WinSECS control's Baud property setting. Baud Rate BaudIndexCode 150 0 300 1 1200 2 2400 3 4800 4 9600 5 19200 6 When you change the Baud property. the Baud property changes to 9600. OpenPort Method. This property is not available at design time. This property can be used to display a list of available baud rates in a combo or list box.]WinSECSn.

If the port was opened with PortType = wsPortTypeTCPIP or wsPortTypeTELNET.Notes The CodePage property tells WinSECS the encoding scheme used by the tool to interpret character strings. Default value -1 Data type Integer Connected property Determines if the communication port is currently connected. The following table lists some of the valid windows pages. WinSECS Version 2. 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 = wsPortTypeHSMS. the Connected property returns True. A value other than -1 indicates WinSECS to use an alternate code page for interpreting character strings.7 34 WINSECS COM REFERENCE © 2006 Brooks Automation. Inc. the Connected property returns False.]WinSECSn. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTELNET wsPortTypeTCPIP Syntax [form. 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. . A value -1 indicates WinSECS to use active code page for interpreting character strings. the Connected property returns True when a valid connection has been established with a remote device (usually a terminal server). If the port was opened with PortType = wsPortTypeRS232.Connected Notes If the port is closed.

then reopen the port with the OpenPort method. wsConnectionModeAlternating The connection mode alternates between Passive and Active until a connection is established. ConnectionMode Property. This property is read only at runtime and not available at design time. Legal Values of ConnectionModeConstant Usage wsConnectionModePassive The remote entity establishes the HSMS connection. OpenPort Method. SECS message transmissions will fail if the Connected property is False.ConnectionMode[ = ConnectionModeConstant] Notes You can change the value of this property at any time. PortType Property ConnectionMode property 35 CHAPTER 2: WINSECS CONTROL . Applies to wsPortTypeHSMS Syntax [form. PortType Property ConnectionMode property Sets or returns the connection mode for HSMS communications. CurrentConnectionMode Property. When using HSMS or SECS1 over TCPIP/TELNET (but not RS232).]WinSECSn. Default value wsConnectionModeActive Data type Long See also Connect Event. Data type Boolean (read only) See also Connect Event. Changing this value when the port is open has no effect on the port. OpenPort Method. the Connect event will fire when WinSECS sets the Connected property to True (see“Connect event” on page 60). but its value takes effect only when you call the OpenPort method. Connected Property. To make the change effective you must first close the port using the ClosePort method. wsConnectionModeActive WinSECS establishes the HSMS connection.When using HSMS or SECS1 over TCPIP/TELNET.

PortIsOpen Property. OpenPort Method. Data type Long See also Connect Event. PortType Property CurrentConnectionMode property Returns the HSMS connection mode currently in effect. This is not necessarily the same as the Baud property value when the port was opened.CurrentBaud Notes If the port is open. the CurrentConnectionMode property returns the HSMS connection mode currently in use. if the ConnectionMode property was wsConnectionModeAlternating when the OpenPort method was used. This is not necessarily the same value as the ConnectionMode property when the port was opened. Applies to wsPortTypeRS232 Syntax [form. The CurrentConnectionMode property will return the value of the connection mode actually used when the connection was established. The value returned by this property will be one of the ConnectionModeConstants. Connected Property. If AutoBaud was True when the port was opened. the CurrentBaud property will return the current value of the WinSECS Baud property. as described in “ConnectionMode property” on page 35. If the port is not open. the CurrentConnectionMode property will return the current value of the ConnectionMode property. the CurrentBaud property returns the baud rate currently in use for the physical port. ConnectionMode Property. WinSECS Version 2. . the actual baud rate may have been adjusted by the WinSECS control. Data type Long See also AutoBaud Property. Applies to wsPortTypeHSMS Syntax [form.7 36 WINSECS COM REFERENCE © 2006 Brooks Automation. If the port is not open.CurrentBaud property Returns the baud rate currently in effect.]WinSECSn. Baud Property. if the AutoBaud property was True when the OpenPort method was used.]WinSECSn.CurrentConnectionMode Notes If the port is open. Inc. BaudIndex Property.

For these types of equipment.EncodingCode Notes The EncodoingCode property is read-only.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. DeviceID Property. Settings outside this range will cause a trappable runtime error. if you set the default device ID. The value of DeviceID must be in the range 0 to 32767. WinSECS sets its value to the value of code page used for Format 22 SECS items.]WinSECSn. SecsHost Property EncodingCode property Specifies the encoding code used for SECS Format 22 items. You may change the value of this property at any time. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. While receiving SECS items from the tool with Format 22. Applies to wsFormatChar2 Syntax [form. Default value 0 Data type Long See also AutoDevice Property. changes to the value of this property affect subsequent use of the NewTransaction method. you do not need to set the device ID for each outgoing primary message. PortType Property DefaultDeviceID property Sets or returns the default SECS device ID used for primary messages. the 16 bit encoding code received specifies WinSECS. Many pieces of SECS equipment support a single SECS device ID. DefaultDeviceID property 37 CHAPTER 2: WINSECS CONTROL .OpenPort Method. the encoding scheme used by the tool.]WinSECSn.

Inc. These error codes are those that may be useful to test in your application. Rrefer to your Visual Basic User Manual for instructions on how to select an ErrorConstant (from the WinSecsLib) using the Object Browser. “Error Messages”.7 38 WINSECS COM REFERENCE © 2006 Brooks Automation. This property sets or returns the T3 reply timeout value (in seconds) for the HSMS protocol. . You can view available ErrorConstants by using the Object Browser in Visual Basic. You can view a short description of the error. Default value 45 Data type Long WinSECS Version 2. Notes Several WinSECS events pass an ErrorCode as a parameter. Some of these error codes are defined as constants by the WinSECS control. The value of TimerValue must be in the range of 1 to 2147483647.While sending SECS items to the tool with Format 22.]WinSECSn. allowing you to take corrective action in your program. the 16 bit encoding code recorded specifies WinSECS. Error codes and constants are defined in Appendix B. its value takes effect immediately. You can change the value of this property at any time. Default value 1 Data type Integer [read only] ErrorConstants Defines error codes that can be passed in events. HSMST3 property Sets or returns the T3 timer value for HSMS connections. the encoding scheme used by the tool.HSMST3[ = TimerValue] Notes The T3 value specifies the amount of time to wait for a reply. if WinSECS wants to determine the encoding scheme used by the tool then it sets the value of Encoding code property to 1 (UNICODE). While sending SECS items to the tool with Format 22. or click a button to get more information about the ErrorConstant. Applies to wsPortTypeHSMS Syntax [form.

See also Connect Event. OpenPort Method. PortType Property HSMST5 property Sets or returns the T5 timer value for HSMS connections. This property sets or returns the T5 connection separation timeout value (in seconds) for the HSMS protocol. HSMST6 Property. The value of TimerValue must be in the range of 1 to 240.]WinSECSn. 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. HSMST3 Property. OpenPort Method.HSMST5[ = TimerValue] Notes The T5 value specifies the amount of time which must elapse between successive attempts to connect to a given remote entity. HSMST8 Property.HSMST6[ = TimerValue] HSMST5 property 39 CHAPTER 2: WINSECS CONTROL . To make the change effective you must first close the port using the ClosePort method. Applies to wsPortTypeHSMS Syntax [form. HSMST7 Property. Connected Property. ConnectionMode Property. HSMST5 Property. HSMST6 Property. Connected Property. HSMST8 Property. PortType Property HSMST6 property Sets or returns the T6 timer value for HSMS connectionsHSMS connections. then reopen the port with the OpenPort method.]WinSECSn. You can change the value of this property at any time. Applies to wsPortTypeHSMS Syntax [form. Default value 10 Data type Long See also Connect Event. ConnectionMode Property. HSMST7 Property.

Connected Property. Applies to wsPortTypeHSMS Syntax [form. HSMST8 Property. The value of TimerValue must be in the range of 1 to 240. To make the change effective you must first close the port using the ClosePort method. To make the change effective you must first close the port using the ClosePort method. . HSMST5 Property. You can change the value of this property at any time. Default value 10 Data type Long See also Connect Event. OpenPort Method. HSMST3 Property. but its value takes effect only when you call the OpenPort method. Inc. This property sets or returns the T6 control timeout value (in seconds) for the HSMS protocol. Changing this value when the port is open has no effect on the port. You can change the value of this property at any time. HSMST6 Property. Default value 5 Data type Long See also Connect Event. then reopen the port with the OpenPort method.7 40 WINSECS COM REFERENCE © 2006 Brooks Automation. The value of TimerValue must be in the range of 1 to 240.Notes The T6 value specifies the time which a control transaction can remain open before it is considered a communications failure. ConnectionMode Property.e.]WinSECSn. Connected Property. but its value takes effect only when you call the OpenPort method. PortType Property WinSECS Version 2. PortType Property HSMST7 property Sets or returns the T7 timer value for HSMS communicationsHSMS connections. no HSMS activity) before it is considered a communications failure. ConnectionMode Property.. HSMST7 Property. This property sets or returns the T7 “not selected” timeout value (in seconds) for the HSMS protocol. Changing this value when the port is open has no effect on the port. then reopen the port with the OpenPort method.HSMST7[ = TimerValue] Notes The T7 value specifies the time which a TCP/IP connection can remain in the NOT SELECTED state (i. HSMST5 Property. HSMST8 Property. OpenPort Method. HSMST3 Property.

HSMST8 property Sets or returns the T8 timer value for HSMS communicationsHSMS communicationsHSMS connections. OpenPort Method. You can change the value of this property at any time.]WinSECSn. Connected Property. an incoming secondary message is matched to its SecsTransaction object by examining the system bytes. but its value takes effect only when you call the OpenPort method.]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. The value of TimerValue must be in the range of 1 to 120. HSMST8 property 41 CHAPTER 2: WINSECS CONTROL . Default value 5 Data type Long See also Connect Event. HSMST5 Property. HSMST7 Property. Applies to wsPortTypeHSMS Syntax [form. Applies to wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. The incoming secondary message is matched to the first SecsTransaction object that is in progress and has matching system bytes. The system bytes of the incoming secondary message are compared to the system bytes of all in-progress SecsTransactions. Changing this value when the port is open has no effect on the port. HSMST3 Property. HSMST6 Property.IgnoreSystemBytes[ = { True | False }] Notes If this property is False. ConnectionMode Property.This property sets or returns the T8 network intercharacter timeout value (in seconds) for the HSMS protocol. PortType Property IgnoreSystemBytes property Determines whether or not the SECS system bytes are used in reply matching. To make the change effective you must first close the port using the ClosePort method. then reopen the port with the OpenPort method.

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. To make the change effective you must first close the port using the ClosePort method. PortType Property Interleave property Sets or returns a Boolean indicating whether or not the control should interleave SECS blocks as a sender.If this property is True. The WinSECS control always supports interleaved blocks as a receiver. then reopen the port with the OpenPort method. This behavior is desirable if the equipment supports long messages because it allows short messages to be interspersed with longer messages. A match is successful if the DeviceID and Stream properties match. Default value False Data type Boolean See also AcceptDuplicateBlocks Property. Set this property to True only if the equipment supports interleaved blocks. and the Function of the incoming message is either zero or one greater than the in-progress transaction.]WinSECSn. Inc. You can change the value of this property at any time.7 42 WINSECS COM REFERENCE © 2006 Brooks Automation. DeviceStream. Many equipment types do not support interleaving. OpenPort Method. PortIsOpen Property. Changing this value when the port is open has no effect on the port.Interleave[ = { True | False }] Notes Interleaving means that blocks from one SECS message may be alternated with blocks from another SECS message. The DeviceID and Stream properties of the incoming secondary message are compared to the DeviceID and Stream properties of all in-progress SecsTransactions. but its value takes effect only when you call the OpenPort method. WinSECS Version 2. .and Function properties. the matching is performed using the DeviceID. Applies to wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form.

but its value takes effect only when you call the OpenPort method. Applies to wsPortTypeHSMS Syntax [form. To make the change effective you must first close the port using the ClosePort method.0. then reopen the port with the OpenPort method. Changing this value when the port is open has no effect on the port.]WinSECSn. PortType Property IPAddressLocal property Sets or returns the IP address of the local node for HSMS connections. It must correspond to an IP address that is assigned to your computer. WinSECS will resolve this host name to the IP address automatically. then reopen the port with the OpenPort method. On NT systems. You may not choose this address at random. You can change the value of this property at any time. OpenPort Method.0 Data type String IPAddressLocal property 43 CHAPTER 2: WINSECS CONTROL .XXX Alternatively.0.0.XXX. PortIsOpen Property. under the Network topic. If you do not know your IP address you can look in the Control Panel. Examine the properties of the TCP/IP service.XXX. Default value False Data type Boolean See also MultipleOpen Property. This feature will work only if your network supports host name resolution. To make the change effective you must first close the port using the ClosePort method. you may use a host name string as the IP address. the value “0.0. Default value 0. Changing this value when the port is open has no effect on the port.0” is interpreted by the operating system as equivalent to your actual IP address. The IPAddress is a string of the form XXX.You can change the value of this property at any time. but its value takes effect only when you call the OpenPort method.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. If you do not know the IP address of the remote computer you should check with your network administrator.]WinSECSn. In that case the remote entity must connect to the IP address you specify in the IPAddressLocal property. usually a terminal server that has a piece of equipment connected to it locally.XXX. or terminal server connected via RS232 to a SECS1 entity) for HSMS and SECS1 -TCPIP/TELNET connections. you may use a host name string as the IP address. . capable of communicating with SECS1 protocol. WinSECS will resolve this host name to the IP address automatically. are used instead of the SerialPort property.7 44 WINSECS COM REFERENCE © 2006 Brooks Automation.See also Connect Event. ConnectionMode Property. IPPortRemote Property. in conjunction with the IPPortRemote Property. IPPortLocal Property. This feature will work only if your network supports host name resolution. This property. Applies to wsPortTypeHSMS wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. For HSMS. WinSECS Version 2.XXX Alternatively.IPAddressRemote[ = IPAddress] Notes This property sets or returns the IP address used to designate the remote node (the remote HSMS entity. In Passive mode. this property designates a communication endpoint. Inc. the IP address of the remote device is used only when the ConnectionMode is wsConnectionModeActive or wsConnectionModeAlternating. IPAddressRemote Property. It must correspond to the IP address of the remote computer to which you intend to establish an HSMS connection. Connected Property. PortType Property IPAddressRemote property Sets or returns the IP address of the remote node for HSMS connections. You may not choose this address at random. OpenPort Method. For SECS1-TCPIP/TELNET. the remote entity establishes the connection.

Default value 5000 Data type Long See also Connect Event.255. IPPortLocal Property. The combination of IPPortLocal and IPAddressLocal must be unique for each active HSMS connection from your computer.]WinSECSn. OpenPort Method. PortType Property IPPortLocal property Sets or returns the IP port number of the local node for HSMS connections. You may not use a port number in use by another process. Legal port numbers may vary from one computer and network configuration to the next. ConnectionMode Property. Applies to wsPortTypeHSMS Syntax [form. but its value takes effect only when you call the OpenPort method. Connected Property.You can change the value of this property at any time.255. then reopen the port with the OpenPort method. IPPortRemote Property. ConnectionMode Property. Connected Property. To make the change effective you must first close the port using the ClosePort method. To make the change effective you must first close the port using the ClosePort method. then reopen the port with the OpenPort method. You may use any legal PortNumber. Default value 255. You can change the value of this property at any time. if that entity attempts to establish the connection. IPAddressLocal Property. Changing this value when the port is open has no effect on the port. so you should choose a different IPPortLocal number for each HSMS connection.100 Data type String See also Connect Event. Typically your computer will have only one IP address.IPPortLocal[ = PortNumber] Notes This property sets or returns the IP port used by the local node (the computer running WinSECS) for HSMS connections. The port number you choose must be known to the remote entity. IPPortLocal property 45 CHAPTER 2: WINSECS CONTROL . Changing this value when the port is open has no effect on the port. but its value takes effect only when you call the OpenPort method.

For SECS1-TCPIP/TELNET. IPAddressLocal Property. This property.IPPortRemote[ = PortNumber] Notes This property sets or returns the IP port used to designate the remote node for HSMS and SECS1-TCPIP/TELNET connections.7 46 WINSECS COM REFERENCE © 2006 Brooks Automation. IPAddressRemote Property. this property designates a communication endpoint.IPAddressLocal Property. ConnectionMode Property. PortType Property WinSECS Version 2. capable of communicating with SECS1 protocol.]WinSECSn. OpenPort Method. usually a terminal server that has a piece of equipment connected to it locally. Default value 5000 Data type Long See also Connect Event. The value of this property usually is associated with an an individual RS232 port found on the device. IPPortRemote Property. IPAddressRemote Property. Connected Property. To make the change effective you must first close the port using the ClosePort method. but its value takes effect only when you call the OpenPort method. in conjunction with the IPAddressRemote Property. OpenPort Method. the value of this property has no effect. You can change the value of this property at any time. . Applies to wsPortTypeHSMS wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. Inc. For HSMS. this property is used only if WinSECS attempts to establish the HSMS connection. Changing this value when the port is open has no effect on the port. IPPortLocal Property. If the remote node establishes the connection. PortType Property IPPortRemote property Sets or returns the IP port number of the remote node for HSMS connections. The PortNumber you use must agree with the port number used by the remote entity. then reopen the port with the OpenPort method. are used instead of the SerialPort property.

A TimerValue of 0 disables link test messages from WinSECS. Such messages are useful to determine whether or not the HSMS connection is intact. The Library is useful to store transactions that you use in more than one location in your code. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. Data type SecsLibrary object.]WinSECSn. you can create a new copy of a transaction by specifying the transaction name or index in the NewTransaction method.]WinSECSn. meaning it contains no SecsTransaction objects. This property is read only at runtime and not available at design time. even in the absence of SECS message activity. The link test timer value determines the amount of time between link test control messages issued by the WinSECS control. Applies to wsPortTypeHSMS Syntax [form. the Library is initially empty. even though that object may contain no SecsTransactions. SecsTransaction Object LinkTestTimer property Sets or returns the link test timer value for HSMS connections.Library property Returns the library property associated with the control. If you add SecsTransaction objects to the Library. You add SecsTransaction objects to the Library using the AddNew or UseDefault methods for the Library object. The value of TimerValue must be in the range of 0 to 86400 (the number of seconds in a day). The Library property will always return a SecsLibrary object.Library Notes When your application starts.LinkTestTimer[ = TimerValue] Notes This property sets or returns the link test timer value (in seconds) for the HSMS protocol. Library property 47 CHAPTER 2: WINSECS CONTROL . read only See also SecsLibrary Object.

Default value 0 Data type Long MonitorEnabled property Sets or returns a Boolean indicating whether or not the WinSECS control generates Monitor events. but its value takes effect only when you call the OpenPort method.]WinSECSn. If you change this property when the port is open. To make the change effective you must first close the port using the ClosePort method. Monitor events are triggered when characters are sent or received over the physical 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.You can change the value of this property at any time. Inc. You do not have to close and reopen the port. the change will be effective immediately.MonitorEnabled[ = { True | False }] Notes If this property is True.7 48 WINSECS COM REFERENCE [form.MultipleOpen[ = { True | False }] © 2006 Brooks Automation. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax WinSECS Version 2. Changing this value when the port is open has no effect on the port. . Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form.]WinSECSn. then reopen the port with the OpenPort method.

but its value takes effect only when you call the OpenPort method. Some equipment does not support multiple open transactions. PortType Property PortIsOpen property Returns a Boolean indicating whether or not the port is open. Changing this value when the port is open has no effect on the port. This condition occurs if you use the Send method two or more times before you receive a SecondaryIn event. PortIsOpen Property. you should set this property to False. You can initiate many Send methods before their associated replies are received. Default value True Data type Boolean See also Interleave Property. Applies to wsPortTypeHSMS PortIsOpen property 49 CHAPTER 2: WINSECS CONTROL . if the other end of the SECS link sends a primary message to WinSECS. up to the limit imposed by system memory. If the value is True. For example. the sending of primary messages will be suspended until there are no outstanding primary messages waiting for replies. To make the change effective you must first close the port using the ClosePort method. then reopen the port with the OpenPort method. is outstanding. If the equipment does not support multiple open transactions. You can change the value of this property at any time. the primary messages are sent as rapidly as possible. If this property is set to False. OpenPort Method. The WinSECS control will buffer the pending send requests in memory. However. The new primary message will be sent immediately. 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. you can still use the Send method to send a primary message while this primary message.Notes Multiple open transactions occur when the primary messages for two or more transactions are sent before the secondary messages are received. regardless of the value of the MultipleOpen property. The value of this property has no effect on your use of the Send method. it does not prevent new primary messages from being created and sent from the other side of the link. sent from the other side. even though there is a primary message waiting for a secondary message at the other end of the SECS link.

This property is not available at design time and is read-only at runtime. To make the change effective you must first close the port using the ClosePort method. Data type Boolean See also Connected Property.wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. Changing this value when the port is open has no effect on the port.]WinSECSn. but its value takes effect only when you call the OpenPort method. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form.PortType[ = PortTypeConstant] Notes The legal values for PortTypeConstant are: PortTypeConstant Value Description wsPortTypeRS232 0 SECS1 RS232 port wsPortTypeHSMS 1 HSMS (Ethernet) port wsPortTypeTCPIP 2 SECS1 via TCPIP wsPortTypeTELNET 3 SECS1 via TELNET You can change the value of this property at any time. OpenPort Method.PortIsOpen Notes The PortIsOpen property has the following return values: Return Value Description True The port is open False The port is closed. . Inc. then reopen the port with the OpenPort method.7 50 WINSECS COM REFERENCE © 2006 Brooks Automation. WinSECS Version 2. PortType Property PortType property Sets or returns a number that identifies the port connection type.]WinSECSn.

then reopen the port with the OpenPort method. T2 Property SecsHost property Determines whether or not the WinSECS control will act as SECS host to the SECS equipment. The product of the RetryLimit and T2 properties specifies the length of time WinSECS will attempt to initiate sending of a SECS message. OpenPort Method. the WinSECS control allows any value in the range 0 to 32767.]WinSECSn. 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. A value of zero is permitted. General Properties.RetryLimit[ = RetryLimit] Notes Although the SECS standard specifies a maximum value of 31 for this property. but its value takes effect only when you call the OpenPort method. but may result in send failures when line contention occurs. PortIsOpen Property RetryLimit property Sets or returns the RetryLimit (RTY) value for the SECS1 data link protocol.Default value 0 (wsPortTypeRS232) Data type Long See also Connected Property. Default value 10 Data type Long See also OpenPort Method. Applies to wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. You can change the value of this property at any time. PortIsOpen Property. Applies to wsPortTypeRS232 wsPortTypeTCPIP RetryLimit property 51 CHAPTER 2: WINSECS CONTROL . HSMS Properties.

This property is ignored if the PortType property is wsPortTypeHSMS. Default value True Data type Boolean See also OpenPort Method. acting as the equipment. but its value takes effect only when you call the OpenPort method. Inc. If there is line contention. False The WinSECS control. Value Meaning True The WinSECS control. The R bit in outgoing messages is cleared.SecsHost[ = { True | False }] Notes The value of this property determines whether the WinSECS control will act as the SECS host or the SECS equipment. but its value takes effect only when you call the OpenPort method. then reopen the port with the OpenPort method. This setting governs line contention at the SECS1 level and the value of the R bit in the SECS1 header. You can change the value of this property at any time. WinSECS Version 2.wsPortTypeTELNET Syntax [form.7 52 WINSECS COM REFERENCE © 2006 Brooks Automation. wsPortTypeTCPIP.SerialPort[ = PortName] Notes For serial ports (PortType property is wsPortTypeRS232). line control is expected. The R bit in outgoing messages is set. If there is line contention. talks to the host.]WinSECSn. then reopen the port with the OpenPort method. talks to the equipment. line control is relinquished. or wsPortTypeTELNET You can change the value of this property at any time. PortIsOpen Property. acting as the host. Changing this value when the port is open has no effect on the port. this property sets or returns the name of the serial port. .]WinSECSn. To make the change effective you must first close the port using the ClosePort method. PortType Property SerialPort property Sets or returns the name of the serial port. To make the change effective you must first close the port using the ClosePort method. Applies to wsPortTypeRS232 Syntax [form. Changing this value when the port is open has no effect on the port. The PortName returned is used when you call the OpenPort method.

PortIsOpen Property. Changing the value of this property affects subsequent use of the Send method. and triggers the SecondaryIn event as if the secondary message had been received over the port. 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. parses the secondary message object. 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. You may change the value of this property at any time. When you use simulate mode.Default value COM1 Data type String See also OpenPort Method. a mode in which the WinSECS control simulates the transmission and reception of messages. secondary messages are defined in the transaction containing the primary message. Default value False Data type Boolean SimulateMode property 53 CHAPTER 2: WINSECS CONTROL . When the SimulateMode property is True. When the SimulateMode property is True.SimulateMode[ = { True | False }] Notes This property indicates whether or not the WinSECS control is in simulate mode. the transaction is complete. but does not affect messages that are in progress. the WinSECS control then builds the secondary message object. If the ReplyExpected property is True. 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.]WinSECSn. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. If the ReplyExpected property is False. Simulate mode is useful for equipment simulation and for testing the logic in an application. the Reply method builds the secondary message object and then triggers the SecondaryOut event.

While you may specify more than one digit of precision.7 54 WINSECS COM REFERENCE © 2006 Brooks Automation. the precision of the time is 0.T2[ = TimerValue] Notes This property sets or returns the T2 protocol timeout value (in seconds) for the SECS1 data link protocol.3 Data type Single (4 byte floating point) See also OpenPort Method. but its value takes effect only when you call the OpenPort method. The value of TimerValue must be in the range of 0.See also Receive Method. then reopen the port with the OpenPort method. Inc. WinSECS Version 2. Applies to wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form.2 to 25.1 seconds. the precision of the time is 0.]WinSECSn. PortIsOpen Property. While you can specify more than one digit of precision.1 seconds. The value of TimerValue must be in the range of 0.]WinSECSn. T3 Property.T1[ = TimerValue] Notes This property sets or returns the T1 inter-character timeout value (in seconds) for the SECS1 data link protocol. Send Method T1 property Sets or returns the T1 timer value.1 to 10. To make the change effective you must first close the port using the ClosePort method. RetryLimit Property. Applies to wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. Default value 0. You can change the value of this property at any time. . Changing this value when the port is open has no effect on the port. T2 Property. T4 Property T2 property Sets or returns the T2 timer value.

RetryLimit Property. PortIsOpen Property. This property sets or returns the T3 reply timeout value (in seconds) for the SECS1 data link protocol.You can change the value of this property at any time. Default value 0. T1 Property. T4 Property T4 property Sets or returns the T4 timer value. Changing this value when the port is open has no effect on the port. T1 Property. PortIsOpen Property. The value of TimerValue must be in the range of 1 to 2147483647.5 Data type Single (4 byte floating point) See also OpenPort Method. but its value takes effect only when you call the OpenPort method. Applies to wsPortTypeRS232 wsPortTypeTCPIP T3 property 55 CHAPTER 2: WINSECS CONTROL . then reopen the port with the OpenPort method. its value takes effect immediately.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. T3 Property. Applies to wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form. T4 Property T3 property Sets or returns the T3 timer value.]WinSECSn. To make the change effective you must first close the port using the ClosePort method. Default value 45 Data type Long See also OpenPort Method. RetryLimit Property. You can change the value of this property at any time. T2 Property.

This property sets or returns the T4 reply timeout value (in seconds) for the SECS1 data link protocol. and eh successful receipt the subsequent block of the same message.7 56 WINSECS COM REFERENCE © 2006 Brooks Automation.T4[ = TimerValue] Notes The T4 property sets the amount of time between the successful receipt a block in a multi-block message. T1 Property. Changing this value when the port is open has no effect on the port.wsPortTypeTELNET Syntax [form. RetryLimit Property. but its value takes effect only when you call the OpenPort method. You can change the value of this property at any time. PortIsOpen Property. then reopen the port with the OpenPort method. T3 Property WinSECS Version 2.]WinSECSn. To make the change effective you must first close the port using the ClosePort method. . T2 Property. The value of TimerValue must be in the range of 1 to 120. Inc. Default value 10 Data type Long See also OpenPort Method.

The ClosePort method is called automatically when the WinSECS control is unloaded.NewTransaction[(Index)] [form.]WinSECSn.]WinSECSn.NewTransaction [form. Messages that are scheduled for transmission through the port after you call the ClosePort 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. It is good practice to use the ClosePort method in the Unload event of your main form in Visual Basic. Closing the port will cause an HSMS connection to be terminated. ClosePort method Closes a physical communication port. will be discarded.ClosePort Notes Closes the physical communication port opened with the OpenPort method.]WinSECSn.NewTransaction[(TransactionName)] ClosePort method 57 CHAPTER 2: WINSECS CONTROL . See also OpenPort Method. The ClosePort method does not generate an error if it is called when the port is not open. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form.Methods This section presents the methods of the WinSECS OLE control.]WinSECSn.

If the parameter is an index number. the properties of the new SecsTransaction object are the same as those of the Library transaction. you must close the port and reopen it. The Length property is always zero. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax [form.Notes Use this method to create a new SecsTransaction object. WinSECS Version 2. a new default SecsTransaction is created. If you provide an argument to this method.OpenPort Notes Opens a physical port for SECS communication. If the argument is a string. The first transaction in the Library is at index 1. . SecsTransaction Object OpenPort method Opens a physical communication port. the transaction at the specified index in the Library is copied and returned. With the exception of the Raw and Length properties. To make changes to port configuration effective. all of the SecsItems defined in the Library transaction are also copied. in preparation for starting a SECS transaction.]WinSECOpenPort Method.7 58 WINSECS COM REFERENCE © 2006 Brooks Automation. When a transaction is copied. All objects of the SecsTransaction are unnamed and their properties are assigned default values. 2-49Sn. The Raw property for a new Transaction is always a zero length string. Data type SecsTransaction object See also Library Property. Inc. changing these properties has no effect on the operation of the port. a new SecsTransaction object is created by copying the specified SecsTransaction from the Library. the first transaction in the Library with a matching name is copied and returned. Before the port is opened. This transaction contains primary and secondary SecsMessage objects and each of these message objects contains a root SecsItem object. Once the port is open. If you do not supply an argument to this method. p. the properties related to the communication parameters for the port are used to configure the port.

When an HSMS port is successfully opened it is not ready for communication until an HSMS link is established. use the ClosePort method to explicitly close the port. See also ClosePort Method. the Connected property will be True and the port will be ready for communication. Connect Event.When an application is finished using the port. Because of this behavior. When an RS-232 port is successfully opened. WINsock will keep the port open even after the application has exited. Completion of the connection is indicated by the Connect event. Note In an HSMS connection. PortIsOpen Property OpenPort method 59 CHAPTER 2: WINSECS CONTROL . completion of the connection is indicated by the Connect event. Connected Property. it is immediately ready for communication. After this event is triggered. As with HSMS. it is not ready for communication until it’s remote device accepts it’s connection. the Connected property will be True and the port will be ready for communication. it should close the port using the ClosePort method. After this event is triggered. When either a SECS1-TCPIP or SECS1-TELNET port is successfully opened.

send. For SECS1-TCP/IP or SECS1-TELNET. Inc. After this event occurs the Connected property will be True until a Disconnect event occurs. this event occurs whenever the connection is established for the first time or re-established after a detected break.Events This section presents the events of the WinSECS OLE control. Likewise a Connect event cannot occur until the port is opened. PortIsOpen Property. When an HSMS port is opened. this event occurs when an HSMS link is successfully established. or Telnet link is established. .7 60 WINSECS COM REFERENCE © 2006 Brooks Automation. The sequence of events should be: open. Disconnect Event. the link is not fully established until a Connect event occurs. Connect event Occurs when an HSMS. Event Sequences. The Send and Reply methods cannot be used successfully until the Connect event is received (and the Connected property is True). OpenPort Method. See also Connected Property. TCP/IP. Applies to wsPortTypeHSMS wsPortTypeTCPIP wsPortTypeTELNET Syntax Sub WinSECSn_Connect() Notes For HSMS. connect. PortType Property WinSECS Version 2.

Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax Sub WinSECSn_Monitor(ByVal Sent As Boolean. If the link was broken because the remote entity sent a Separate Request message (clean termination) ErrorCode is zero. ByVal HexBytes As String) Disconnect event 61 CHAPTER 2: WINSECS CONTROL . Event Sequences. 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) . Bytes As Variant. ErrorText A string containing a text description of the error. See ErrorConstants. this event occurs when the underlying TCPIP connection is broken. PortType Property Monitor event Triggered when characters are sent or received over the physical port. PortIsOpen Property. ByVal ByteType As Long ByVal. Non-zero otherwise. Applies to wsPortTypeHSMS wsPortTypeTCPIP wsPortTypeTELNET Syntax Notes Sub WinSECSn_Disconnect(ByVal ErrorCode As Long. Otherwise ErrorCode indicates the reason for termination. See also Connect Event. For SECS1-TCPIP or SECS1-TELNET. or TCP/IP connection is broken. The Disconnect event is not triggered when you use the ClosePort method. ErrorText is a zero-length string (""). OpenPort Method. For HSMS.Disconnect event Occurs when an HSMS link. this event occurs when the link is broken. Connected Property. If the ErrorCode is zero.

The data is stored as an array of bytes. 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. False if bytes were received ByteType A numeric code specifying the type data.7 62 WINSECS COM REFERENCE © 2006 Brooks Automation. HexBytes ASCII Hex representation of the data. disable Monitor events for best performance. Inc. . This event is triggered only if the MonitorEnabled property is True. Processing monitor events can consume processing time in your application. The length of the array is the number of bytes sent or received.Notes Parameters Meaning Sent True if bytes were sent out the port. 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. Bytes Binary data sent or received.

ByVal ErrorText As String ) Parameters Meaning Trans The SecsTransaction object for which the primary message has been received. ByVal ErrorCode As Long. See ErrorConstants. If the ErrorCode is zero. bytes received with a framing error are reported as ByteTypeError. If the Transaction has a secondary message defined. If it receives some other character it will report it as ByteTypeDiscarded. the control may expect a control character at a particular moment. non-zero otherwise. For example. ErrorCode Zero if the message was successfully received. The SecsTransaction object is passed as a parameter. For example. 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. you can return the secondary (reply) message using the Reply method. Before you return PrimaryIn event 63 CHAPTER 2: WINSECS CONTROL . All bytes reported in the Monitor event are of the same type (determined by the ByteType parameter). ErrorText is a zero-length string (""). PrimaryIn event Occurs when an incoming primary SECS message is received. when using SECS1. ErrorText A string containing a text description of the error. The type wsByteTypeError marks bytes that were incorrectly received by the computer hardware.ByteTypeConstant Description wsByteTypeRejectRequest HSMS Reject Request control message wsByteTypeSeparateRequest HSMS Separate Request control message The type wsByteTypeDiscarded marks bytes that were unexpected by WinSECS. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax Notes Sub WinSECSn_PrimaryIn (ByVal Trans As SecsTransaction.

If the Library object contains a SecsTransaction with the same SECS stream and function numbers as the primary message. the ErrorCode is 0 and the ErrorText is a zero-length string.14 transaction as defined in the default Library. The SecsItem objects contained in the Primary SecsMessage object will be as received in the incoming message. it should normally be a function zero reply. ByVal ErrorCode As Long. The ReplyExpected property of the SecsTransaction object indicates whether or not the sender expects a reply.7 64 WINSECS COM REFERENCE © 2006 Brooks Automation. indicating successful establishment of communications. If the messages:message was parsed successfully. Examples The following example replies to an S1F1 message with an S1F2 message. Otherwise the ErrorCode is non-zero and the ErrorText contains a string describing the error. that SecsTransaction is used as the basis for the new SecsTransaction object created and passed to this event. You must check the ErrorCode value in this event handler.Primary. If you return a reply in this case. Private Sub WinSECS1_PrimaryIn(ByVal Trans As SecsTransaction. 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. ByVal ErrorText As String) If Trans. There are no data items in the S1F2 message (a SECS host replies with a zero length list). The names and descriptions of these SecsItem objects will be as defined in the Library.Reply End If End If End Sub The following example adds support for the S1F13.the reply you should set any desired data values for the items in the reply message. Private Sub WinSECS1_PrimaryIn(ByVal Trans As SecsTransaction. ByVal ErrorCode As Long.Primary. If no match is found in the Library for the incoming stream and function numbers.Primary. you should not process the primary message. When this event is triggered.Stream = 1 Then If Trans.Stream Case 1 WinSECS Version 2. . If the message was not parsed successfully. The Primary SecsMessage object will have the name of the Primary SecsMessage object in the Library. ByVal ErrorText As String) Select Case Trans. the SecsTransaction object is not in progress so you can change the properties of the SecsTransaction and the objects it contains. Inc. No error is returned if the incoming message does not match the format of the Library message. but the unmatched items will be unnamed. We set the value of COMMACK to 0.Function = 1 Then Trans. to the extent the incoming message matches the Library message. all objects in Trans are unnamed.

has been transmitted or the transmission attempt failed. ErrorConstants. See ErrorConstants. RawHex Property. SecondaryIn Event. ByVal ErrorCode As Long. This event passes the transaction object for which a primary message has been sent. PrimaryOut Event. ErrorText A string containing a text description of the error. PortIsOpen Property. sent using the Send method.Select Case Trans.Primary. Event Sequences. PortType Property. ErrorCode Zero if the message was successfully sent. SecondaryOut Event PrimaryOut event Occurs when a primary message.Reply Case 13 Trans. If the ErrorCode is zero. To determine if the message was successfully transmitted.Primary. Raw Property. OpenPort Method. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax Sub WinSECSn_PrimaryOut(ByVal Trans As SecsTransaction. ByVal ErrorText As String) Parameters Meaning Trans The SecsTransaction object for which the primary message send attempt has completed. check the ErrorCode value in this event handler. ErrorText is a zero-length string ("").Function Case 1 Trans. PrimaryOut event 65 CHAPTER 2: WINSECS CONTROL .Item("COMMACK") = 0 Trans. non-zero otherwise.Reply End Select End Select End Sub See also Connect Event. Connected Property.

OpenPort Method. See also Connect Event. non-zero otherwise. . the ErrorCode is nonzero. PrimaryIn Event. 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. but before the secondary (reply) message has been received. Inc.7 66 WINSECS COM REFERENCE Sub WinSECSn_SecondaryIn(ByVal Trans As SecsTransaction. Therefore. Applies to wsPortTypeHSMS wsPortTypeRS232 wsPortTypeTCPIP wsPortTypeTELNET Syntax WinSECS Version 2. Raw Property. the RawHex property returns a text version of this data. PortIsOpen Property. Connected Property. If the ReplyExpected property is True and ErrorCode is zero. Event Sequences. © 2006 Brooks Automation. The primary SecsMessage object's Raw property returns the actual data sent. This event is triggered when the primary message is transmitted. ByVal ErrorText As String) Parameters Meaning Trans The SecsTransaction object for which the secondary has been received. ErrorConstants. the SecsTransaction object is still in progress when this event is triggered. RawHex Property. and the transaction is no longer in progress even if the ReplyExpected property is True. ByVal ErrorCode As Long. all of the properties of the SecsTransaction object and the objects it contains are read-only. See ErrorConstants. ErrorCode Zero if the message was received and parsed successfully. In this case. Otherwise. You can use this event to display the SECS message data sent. PortType Property.If the message was transmitted successfully. the ErrorCode is 0 and the ErrorText is a zero-length string. the ErrorText contains a string describing the error. SecondaryOut Event SecondaryIn event Occurs when either a secondary message is received or a T3 timeout occurs. SecondaryIn Event.

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. SecondaryIn Event. See also Connect Event. PortType Property. Inc.7 70 WINSECS COM REFERENCE © 2006 Brooks Automation. T1. . and other recoverable error conditions. Other events that will cause warnings are a checksum error. PrimaryIn Event. Event Sequences. OpenPort Method.. bad character received on a serial port. PrimaryOut Event. ErrorConstants.g. SecsError Event WinSECS Version 2. Connected Property. T2). This event occurs on the expiration of any of the timeouts associated with the data link protocol (e.

3 Chapter 3: SecsLibrary Object The SecsLibrary object contains pre-defined SecsTransaction objects for every message in the SECS standard. 73 Methods AddNew method p. Use the Transaction property of the Library object to access the SecsTransaction objects in the Library. 72 TransactionCount property p. WinSECS uses the Library when it constructs outgoing messages or parses incoming messages. Properties Description property p. 72 Transaction property p. 74 71 . You can also add to or modify the SecsTransaction objects in the library to suit your needs. 74 UseDefault method p.

Transaction(Index) Notes The SecsTransaction object returned by this property is a member of the Library.Properties This section presents the properties of the SecsLibrary object. you must use the NewTransaction method of the SECS control to make a copy of the desired transaction. Description property Sets or returns a description of the Library object. If you want to use these methods.]WinSECSn. the transaction at the specified index in the Library is returned. Inc. Build. Case is not significant in the TransactionName string.Description[ = DescriptionString ] Notes The description property is not used by the WinSECS control. If the argument is a string. Data type WinSECS Version 2. read-only.]WinSECSn. If the argument is a number. The first transaction in the Library is at index 1. but allows you to add descriptive text to the Library object for documentation purposes. The Index must be between 1 and the TransactionCount.Library. “S1f1”.7 72 WINSECS COM REFERENCE SecsTransaction object.]WinSECSn. Syntax [form. or Parse methods with transactions returned by this property. inclusive. . Data type String Transaction property Returns a transaction object from the library. Reply.Library. and “s1f1”. so “s1f1” will find SecsTransactions named “S1F1”. Syntax [form. Receive. the first transaction in the Library with a matching name is returned. You cannot use the Send.Transaction(TransactionName) [form. © 2006 Brooks Automation.Library.

For example. Syntax [form.]WinSECSn. the last SecsTransaction in the Library for a control named WinSECS1 is obtained by the expression WinSECS1.Library.TransactionCount ) Data type Integer.TransactionCount Notes You can use this property to iterate through the SecsTransaction objects in the Library.Library.TransactionCount property Returns the number of SecsTransaction objects defined in the Library object. read-only TransactionCount property 73 CHAPTER 3: SECSLIBRARY OBJECT .Library.Transaction(WinSECS1.

Inc.UseDefault Notes The Library object is initially empty (contains no transactions). use the UseDefault method to create a library containing the default transaction. Syntax [trans = ] [form. An Index of TransactionCount + 1 adds the new SecsTransaction to the end of the Library. The UseDefault method deletes any transactions currently in the Library and replaces them with the default transactions. then modify the Library using the AddNew method. Notes The Index must be an integer greater than zero and not greater than TransactionCount + 1. UseDefault method Adds transactions to the Library object for each message in the SECS standard. After adding a new SecsTransaction object to the Library. AddNew method Adds a new SecsTransaction object to the Library. 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. .Library.AddNew(Index) Return value The SecsTransaction object added.]WinSECSn. You should also add any desired SecsItem objects to the new SecsTransaction.Methods This section presents the methods of the SecsLibrary object. To build a custom Library based on the default library. but those objects contain only the Root and Stream SecsItem objects. Syntax [form. The SecsTransaction added is a "blank" transaction.]WinSECSn. It contains a Primary and Secondary SecsMessage objects. set its Name and other properties to the values you desire.Library. All other properties are set to their default values. The Name property of all objects is a zero-length string. WinSECS Version 2. An Index of 1 adds the new SecsTransaction at the start of the Library.7 74 WINSECS COM REFERENCE © 2006 Brooks Automation.

78 p.4 Chapter 4: SecsTransaction Object A SecsTransaction object contains both a Primary and Secondary SecsMessage object. 76 AutoSystemBytes property Description property DeviceID property Index property p. These SecsMessage objects are returned by the Primary and Secondary properties of the SecsTransaction object. 77 p. 79 ReplyExpected property Secondary property Methods p. 76 ActionOnSuccess property p. 76 ActionOnError property p. 83 75 . 82 Receive method p. 81 p. 82 Send method p. 77 p. 80 SystemBytes property Tag property p. 79 Primary property p. 82 Delete method p. 81 p. 80 p. 78 p. For more information. see “SecsTransaction object” on page 7. 82 Reply method p. Properties p. 78 InProgress property Name property p.

Inc. and it is identical in this respect to the Tag property.ActionOnError [= Expression] Notes The ActionOnError property is not used by the WinSECS control. . ActionOnError property Sets or returns a value that can be used to identify an error handling procedure. This property can be used to specify a desired action when an error occurs when using the Send or Reply method with this transaction. Syntax SecsTransaction. This property will be available in the PrimaryOut.ActionOnSuccess [= Expression] Notes The ActionOnSuccess property is not used by the WinSECS control. and it can be used to select the desired action in that event procedure. or SecondaryIn event. This property will be available in the PrimaryOut. Default value Empty Data type Variant WinSECS Version 2. You can use it to store any information about the transaction you need. SecondaryOut. It can also be used to select the desired action in that event procedure. SecondaryOut. You can use it to store any information about the transaction you need and is identical in this respect to the Tag property. or SecondaryIn event.Properties This section presents the properties of the SecsTransaction object.7 76 WINSECS COM REFERENCE © 2006 Brooks Automation. Syntax SecsTransaction. Default value Empty Data type Variant ActionOnSuccess property Sets or returns a value that can be used to identify an error handling procedure. This property can be used to specify a desired action when the Send or Reply method completes successfully.

the SECS control uses the value of the primary message's SystemBytes property. Syntax SecsTransaction. You should set this property to False only if the equipment has special requirements for the system bytes. Syntax SecsTransaction. the counter value is incremented on each send attempt.AutoSystemBytes property Sets or returns a Boolean which indicates whether or not unique system bytes are automatically generated when a primary message is sent. Default value Zero length string Data type String AutoSystemBytes property 77 CHAPTER 4: SECSTRANSACTION OBJECT . Default value True Data type Boolean Description property Sets or returns a description of the SecsTransaction object.AutoSystemBytes[= { True | False }] Notes When a primary SECS message is sent. the SECS control handles automatically generates system bytes using this counter scheme. unique system bytes are generated by treating the system bytes as a counter. If this property is False. In general. the system bytes in the message should differ from the system bytes of the open transactions on the port.Description[ = DescriptionString ] Notes The Description property is not used by the WinSECS control. Transactions in the Library initially have this property set to True. but allows you to add descriptive text to the SecsTransaction object for documentation purposes. If this property is True.

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. the SecsTransaction is in the Library. When you create a new transaction. Syntax SecsTransaction. This is the index that may be used with the Transaction property of the Library object to retrieve the SecsTransaction from the Library.Index Notes This property returns the index for the SecsTransaction object in the Library. 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. If the value returned is 1 or greater. Inc. read-only InProgress property Returns a Boolean value which indicates whether or not the SecsTransaction object is in progress. Syntax SecsTransaction. The legal range for the DeviceID property is 0 to 32767. the value returned is 0.DeviceID[ = DeviceID] Notes When a SECS message is received you can read this property to determine the device ID received in the message. Data type Long. . When a message is sent using the Send method. the DeviceID property is initialized to the DefaultDeviceID of the SECS control.DeviceID property Sets or returns the Device ID used in the messages:SECS messages. If the SecsTransaction object is not in the Library.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.7 78 WINSECS COM REFERENCE © 2006 Brooks Automation. Syntax SecsTransaction.

the InProgress property of that object becomes True. Case is retained in the TransactionName. Syntax SecsTransaction. After using the Send method on a SecsTransaction object. but is not significant when searching for the transaction using the Transaction property of the Library object.Primary Notes A SecsTransaction object always contains a primary SecsMessage object. Syntax SecsTransaction. you can access it only by its index number. read-only Name property 79 CHAPTER 4: SECSTRANSACTION OBJECT .Name[ = TransactionName] Notes If a SecsTransaction in the Library is not named. Data type SecsMessage object. Use this property to obtain the SecsMessage object representing the primary message.True). Default value Zero length string ("") Data type String Primary property Returns the SecsMessage object representing the primary message in the transaction. read-only Name property Sets or returns the name of the transaction. 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.

the transaction is in progress until the secondary message is received (unless an error is reported in the PrimaryOut event). . Syntax SecsTransaction. Example The following example sets the Stream property of the secondary SecsMessage object to 1: Trans. you can check this property to determine whether or not the sender expects a reply. If this property is False. Inc.7 80 WINSECS COM REFERENCE SecsMessage object. the transaction is in progress until the primary message is sent (i.ReplyExpected[= { True | False }] Notes This property corresponds to the W bit in the primary SECS message header. When a primary message is received. When a primary message is sent.Secondary.. the W bit is cleared. when the PrimaryOut event is triggered). Syntax SecsTransaction.Secondary.ReplyExpected property Sets or returns a Boolean indicating whether or not a reply is expected to the primary message. If this property is True. The W bit is always zero in secondary messages sent by WinSECS. For messages sent using the Send method. Default value True Data type Boolean Secondary property Returns a SecsTransaction object that represents the secondary message in the transaction. If this property is False. read-only © 2006 Brooks Automation.[=Number] Notes A SecsTransaction object always contains a secondary SecsMessage object (even if the ReplyExpected property is False).Stream = 1 Data type WinSECS Version 2.e. this property determines when a transaction is no longer in progress. the W bit in the SECS message header is set if this property is True.

SystemBytes property Sets or returns the system bytes. which states that the system bytes in a secondary message must match those in the primary message. This property can be used to mark a SecsTransaction object before using the Send method. if the AutoSystemBytes property is False. The Tag value is retained when the PrimaryOut and SecondaryIn events trigger. You can use it to store any information about the transaction you need. You can change the value of the SystemBytes before the Reply method is used to send a secondary message.SystemBytes[ = SystemBytes] Notes Under normal conditions. The least significant byte is the last system byte in the SECS header. Syntax SecsTransaction. Default value Empty Data type Variant SystemBytes property 81 CHAPTER 4: SECSTRANSACTION OBJECT . However. Default value 0 Data type Long Tag property Sets or returns a value that can be used to identify a SecsTransaction object. you must set the system bytes to the desired value before you can use the Send method. This change is rarely desirable because it violates the SECS standard. You can inspect the Tag value in these events to help keep track of your transactions-in-progress. it is unnecessary to examine the system bytes. The most significant byte of this property is the first system byte in the SECS header. Syntax SecsTransaction.Tag [= Expression] Notes The Tag property is not used by the WinSECS control.

To use the Receive method. A SecondaryOut event is triggered when the secondary message is sent. Syntax SecsTransaction. Receive method Triggers a PrimaryIn event as if the message had been received over the SECS port.Reply Notes The data in the secondary (reply) message must be set before this method is used. Inc.7 82 WINSECS COM REFERENCE © 2006 Brooks Automation.Receive Notes This method is useful for testing or simulation.. You cannot use the Receive method with a SecsTransaction object contained in the Library. . Delete method Deletes a transaction from the library. If an error occurs while the secondary message is being built. See Message Construction. Syntax SecsTransaction.Methods This section presents the methods of the SecsTransaction object.e.Delete Notes This method produces a trappable runtime error if the transaction object does not reside in the Library (i. Successful execution of the Reply method does not necessarily indicate that the WinSECS Version 2. 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. a trappable error is produced. Syntax SecsTransaction. you must create a new SecsTransaction object using the NewTransaction method. Reply method Sends the secondary message in a transaction. was created with NewTransaction).

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

The use of a second Send method before a reply is received to the first will cause multiple outstanding SECS transactions. WinSECS Version 2. Inc. if MultipleOpen is True. The transaction object to which the SecondaryIn event relates is passed in the SecondaryIn event.7 84 WINSECS COM REFERENCE © 2006 Brooks Automation. There is no limit to the number of simultaneous outstanding SECS transactions.of the Send method does not necessarily indicate that the transmission will be successful. The secondary (reply) message is obtained in the SecondaryIn event function. . You must check the ErrorCode value passed to the PrimaryOut event to determine if the transmission was successful.

86 p. The Root SecsItem does not appear in the binary SECS message. 89 Stream property Methods p. 91 Parse method p. 87 p. 91 85 . obtained using the Primary and Secondary properties of the SecsTransaction object.5 Chapter 5: SecsMessage Object A SecsMessage object represents a SECS message (either Primary or Secondary). 87 Length property Raw property p. Each SecsTransaction contains two SecsMessage objects. 88 RawHex property Root property p. but is used as a parent item for the items that do appear in the message. see “SecsMessage object” on page 8. A SecsMessage object always contains a Root SecsItem object. For more information. Properties p. 86 Description property Function property Item property Name property p. 91 Build method p. 86 p. 87 p. 90 p. 88 p.

the value of the Secondary message is one greater than that of the Primary message. nor can you set the Function of a secondary message to an odd value.Function[ = Function] Notes The value of Function must be between 0 and 255. . Generally. although the WinSECS control does not enforce this convention.Properties This section presents the properties of the SecsMessage object. Default value Zero length string. Inc. Syntax SecsMessage. inclusive.7 86 WINSECS COM REFERENCE Integer © 2006 Brooks Automation. Syntax SecsMessage. Data type String Function property Sets or returns the SECS function number. but it allows descriptive text to be added to a SecsMessage object for documentation purposes. Default value Primary messages: 1 Secondary messages: 2 Data type WinSECS Version 2. You cannot set the Function of a primary message to an even value.Description[ = DescriptionString ] Notes The Description property is not used by the WinSECS control. Description property Sets or returns a description of the SecsMessage object.

For incoming messages.Item("SVID") See the Item property of the SecsItem object. Syntax SecsMessage.Item(ItemName) SecsMessage. this property is valid after the Send method is issued. This length does not include the SECS1 header bytes. For outgoing messages. Data type Long. Data type SecsMessage object. read-only Length property Returns the length.Primary. in bytes. read only Name property Sets or returns the name of the message.Item( ItemNumber) Notes This property is a shortcut for searching the Root item in a message.Primary. This property is also set by the Build method. this property is valid after the PrimaryIn or SecondaryIn event is triggered. ItemNumber) SecsMessage.Item(ItemName. These two statements are equivalent: Set MyItem = Trans.Name[ = MessageName] Item property 87 CHAPTER 5: SECSMESSAGE OBJECT .Item property Returns an item object. or after the Raw property is set. Syntax SecsMessage. of the binary data contained in the Raw property.Item("SVID") Set MyItem = Trans.Root. This property is valid only after the message has either been successfully built or parsed. Syntax SecsMessage.Length Notes The length returned by this property is the number of bytes in the SECS2 message data.

. If there are no SecsItem objects in the message (except the Root object which is always present) the Raw data is transmitted without modification. If you create a transaction without using a Library transaction. Each byte in the Raw data is expanded to three characters. Default value Zero length string ("") Data type String Raw property Sets or returns the SECS message data as a binary memory image.RawHex Notes This property is useful for diagnostic display of the bytes contained in a SECS message.Notes If you create a transaction based on a Library transaction. and the third is a space character. Inc. the names of the message objects are initially zero length strings. WinSECS Version 2. The value of this property is the result of the message being built using the SecsItem objects contained in the message. in hexadecimal notation. Default value Empty Variant Data type Variant (array of BYTE) RawHex property Returns an ASCII representation of the Raw data.7 88 WINSECS COM REFERENCE © 2006 Brooks Automation. Syntax SecsMessage. in hexadecimal notation. but does not include the SECS1 headers. A message build is the result of a message Send. 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 first two are the value of the byte. The binary image contains all of the SECS2 message data.Raw[ = MessageData] Notes This property is useful if you want to examine the SECS message data directly. Syntax SecsMessage. The length of the string returned by the RawHex property is always three times the length of the Raw property. the name of each message contained in the transaction is initialized to the name defined in the Library message.

the syntax of the standard does not prevent this. Data type SecsItem object. If the SECS message contains multiple items. It serves as the parent of all SECS items at the top level in the SECS message. Using the Delete method on the Root item will cause a runtime error. 2. The SECS standard does not state that this is illegal. This is because the SECS standard defines only messages that are either Header-only or that contain exactly one item at the top level. WinSECS supports messages of this form and there are examples of equipment in the field that use it. the Root item would contain two SecsItem objects. In the example above. Syntax SecsMessage. 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. Normally. the Root item will either be empty (for a header only message) or it will contain one SecsItem object. You cannot delete the Root item. The Root item is special in a two ways: 1. they are always contained in a single top level list item.Root Notes The root item of a message is always a list item that represents the complete SECS message data. read only Root property Returns the root item for the message.Data type String. It does not appear in the SECS message actually sent or received. Although the SECS standard does not define messages with more than one item at the top level. read only Root property 89 CHAPTER 5: SECSMESSAGE OBJECT . but it does go against the implied conventions of the Standard.

. Inc. Default value 0 Data type Integer WinSECS Version 2.Stream property Sets or returns the SECS stream number. A stream number of zero is not allowed by the SECS standard.7 90 WINSECS COM REFERENCE © 2006 Brooks Automation. Syntax SecsMessage. but will not generate a runtime error.Stream[ = StreamNumber] Notes The StreamNumber must be non-negative and less than 128.

the size of the SECS message to follow is normally sent. The Parse method can be useful if you obtain a binary SECS message in some fashion other than over the communication port. The Build method updates the Length. The Parse method updates the set of SecsItem objects contained in the SecsMessage object. and RawHex properties of the SecsMessage object. No events (such as PrimaryOut) are triggered by the Build method. Parse method Parses the raw SECS message Syntax SecsMessage. A trappable runtime error will occur if the build fails. You can use this method to determine the length of the message before you send it. For example. you may have a file containing a binary SECS message that you want to parse. No events (such as PrimaryIn) are triggered by the Parse method.Build Notes This method builds the raw SECS message.Parse Notes This method parses the raw SECS message and reconstructs the contained SecsItem objects.Methods This section presents the methods of the SecsMessage object. Build method Constructs the raw SECS message. as if the message had been received. A trappable runtime error will occur if the parse fails. Use the Parse method to parse the message. then assign the Raw property of the SecsMessage object to this binary data. Raw. Syntax SecsMessage. You can then use this size in the Request message. but does not send it. See“SECS message construction” on page 13. Use the Length property of the SecsMessage object to determine the actual size of the message. Read the contents of the file. In the Request message. You can obtain this size conveniently by first building the message to follow the Request/Grant sequence using the Build method. The Build method can be useful for messages that require a Request/ Grant sequence. Build method 91 CHAPTER 5: SECSMESSAGE OBJECT . The parse will proceed exactly as if the message had been received over the serial port.

Inc. “SECS message parsing” on page 19. WinSECS Version 2. .7 92 WINSECS COM REFERENCE © 2006 Brooks Automation.A Header-only messages:SECS message is represented by a SecsMessage object that contains only the Root SecsItem See also.

94 Description property Format property Index property Item property p.6 Chapter 6: SecsItem Object This chapter contains a reference for the SecsItem object properties and methods. 96 ItemCount property Length property Name property NLB property p. 94 p. 101 Duplicate method p. 101 Delete method p. 99 Value property Methods p. 101 93 . For an introduction to SecsItem objects. see “SecsItem object” on page 9 A SECS item can contain either a list or a value. 97 p. 97 p. 96 p. 99 p. Properties p.. 99 p. 98 Parent property Raw property p. it is used as a parent for the SecsItem objects below. 101 AddNew method p. 98 p. A Root SecsItem object does not appear in the SECS message. 94 p. A header only messages:SECS message is represented by a SecsMessage object that contains only the Root SecsItem.

zero = False. 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. FormatConstant Value Description wsFormatList 0 SECS item list wsFormatBinary 8 SECS binary item wsFormatBoolean 9 SECS Boolean item (one byte. non-zero = True) wsFormatAscii 16 SECS ASCII item wsFormatJis8 17 SECS JIS8 item wsFormatI2 26 SECS signed integer item. Syntax SecsItem. . Data type String Format property Sets or returns the SECS format code for the item.7 94 WINSECS COM REFERENCE © 2006 Brooks Automation. 1 byte WinSECS Version 2. These constants are listed in the left column in the following table together with valid values for the FormatConstant.Format[ = FormatConstant] Notes The format code governs the data representation of the item in the SECS message as sent over the port. Inc. but allows descriptive text to be added to the SecsItem object for documentation purposes.Properties This section presents the properties of the SecsItem object. The WinSECS control object defines constants that can be used for the Format property. 2 bytes wsFormatI1 25 SECS signed integer item. Default value Zero length string.

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. is the length (6 characters). 06. 41. see “Data types” on page 11 and “Item construction conversion process” on page 14. The Format property contains the value of the high 6 bits. When a SECS message is constructed (as a result of the Send. The upper six bits have the value 010000 (binary) which means "ASCII format". The first byte. 4 byte IEEE format wsFormatU8 40 SECS unsigned integer item.wsFormatI8 24 SECS signed integer item. 2 bytes wsFormatU1 41 SECS unsigned integer item. 8 bytes wsFormatI4 28 SECS signed integer item. or Build methods). 4 bytes wsFormatU2 42 SECS unsigned integer item. The value of the Format property is 010000 (binary) or 16 (decimal). Receive. The second byte. 4 bytes wsFormatF8 32 SECS floating point item. For more information. 8 bytes wsFormatU4 44 SECS unsigned integer item. the SECS item header contains two bytes (shown in hex): 41 06. Default value wsFormatVar Data type Integer Format property 95 CHAPTER 6: SECSITEM OBJECT . The low two bits of this byte indicate the number of length bytes (NLB). contains the SECS item format code in the upper six bits and the NLB in the lower two bits. treated as an integer. which means one length byte. Example If a SECS item is ASCII format and is 6 bytes long. Hence the first byte is 01000001 (binary) or 41 (hex). 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. The Format property is not affected by the value of NLB. and the lower 2 bits have the value 01. 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. Reply. See the SECS standard for more information on format codes. 8 byte IEEE format wsFormatF4 36 SECS floating point item.

Instance ] ) SecsItem.Index Notes The index is the numeric position of the item within its parent item. See “Item searching” on page 17. The Index parameter allows you to iterate through all of the items defined in the library.Item ( ItemName [. WinSECS Version 2. If the specified item is not found. third. etc. for a description of the search technique. Case is not significant when searching for items. The index of the root item is 1. where the first item is at index 1. Syntax SecsItem. An ItemName can be a variable or a quoted string. otherwise it is treated as an ItemName. Syntax SecsItem. Svid” and “SVID”. If an ItemName is specified. so “svid” will find items named “svid”. read-only Item property Returns the specified SECSItem object contained within this item. the item with that index is returned.7 96 WINSECS COM REFERENCE © 2006 Brooks Automation. If the first parameter is numeric. Only list items contain other items. Reading this property for a deleted item produces a runtime error. second. The Index parameter specifies the index to the desired item in the Library. so this property is never valid for a non-list item. Data type Long. An Index applies only to the immediate children of the SecsItem. a trappable runtime error occurs and a Null value is returned. The first item within a parent item has an index of 1. then it is treated as an Index. the first item matching the ItemName and Instance within a single list is returned.) of the ItemName within a given Parent item. If the Instance is not specified. . the children of the SecsItem are searched for a SecsItem with the specified name. The optional Instance parameter specifies the instance (first. If the Index parameter is specified.Item ( Index ) Notes The SecsItem is searched recursively for an item that has the specified name or index.Index property Returns the index for an item. The Index must be greater than zero and not greater than ItemCount. If the Instance is specified. the first item with the specified name is returned. Inc.

item("SVID") ' returns the first item named SVID L. or Build methods. If the SecsItem is not a list.Example If a SecsItem object named L contains three items named SVID. This property is set by the WinSECS control as a result of the Send. Data type Long.item("SVID". read-only ItemCount property Returns the number of items in a SecsItem object representing a list. ItemCount returns 0. Reply.item(dev) ' returns the first item named SVID Data type SecsItem Object. then if dev="svid" L. 2 ) ' returns the second item named SVID L. then L. Receive. if a variable named dev is defined. Syntax SecsItem. 3 ) ' returns the third item named SVID Similarly.item("SVID".item("SVID".ItemCount Notes If the item is a list (format code 0). 1 ) ' returns the first item named SVID L. For non-list items (Format does not equal wsFormatList) the Length property returns the number of bytes in the SECS item. or when a message is received. then the ItemCount property returns the number of item objects defined in the list. read-only Length property Returns the value of the length bytes in the SECS item header. Default value 0 Data type Long.Length Notes For list items (Format = wsFormatList) the Length property returns the number of items in the SECS list. Syntax SecsItem. read-only ItemCount property 97 CHAPTER 6: SECSITEM OBJECT .

If the item has a name. After parsing a message. If you create a transaction based on a transaction defined in the default Library. the NLB property for all SecsItems contained in the SecsMessage object will have values 1. but if it does not then you can locate the item only by the numeric index in the Item property. Default value Zero length string ("") Data type String NLB property Sets or returns the number of length bytes for an item. If you create items using the AddNew method. Setting this property to any other value generates a runtime error. 2.Name property Sets or returns the name of the item. . These names are the same as those defined in the SECS standard. Setting this property to 0 causes the number of length bytes to be set to the minimum required to accommodate the item (1. but is not significant when searching for the SecsItem using the Item property.7 98 WINSECS COM REFERENCE © 2006 Brooks Automation. then all items in the transaction have names. Default value 0 Data type Integer WinSECS Version 2. the name of the item is initially a zero length string. 2. Zero is not a legal value in a SECS message.Name[ = ItemName] Notes The Name property aids in selection of items from lists. Syntax SecsItem. or 3). or 3. and 3. Case is retained in the ItemName. 1. An item is not required to have a name. Inc.NLB[ = NumberOfBytes] Notes The legal values for this property are 0. you can locate the item by using the name as a parameter to the Item property. Syntax SecsItem. 2.

set Value to Null. Syntax [ItemData=]SecsItem.Raw Notes The data is Read-only. read only Raw property Returns the SECS item data as a binary memory image. If you want to send a zero length item. The binary image contains all of the item data. When you receive a message. This property is useful if you want to examine the SECS item data directly. Syntax SecsItem. Parent property 99 CHAPTER 6: SECSITEM OBJECT .) Data type SecsItem object. Data type Variant (array of BYTE) Value property Sets or returns the value of an item. (No runtime error occurs in this case. so either form shown above can be used. Items are built when the message in which they are contained is built.Parent property Returns the SECS item object that contains the SECS object. this property will be Null if a zero length item was received. Syntax SecsItem.Value [= expression] SecsItem [= expression] Notes The value is the default property of a SecsItem object. but does not include the item headers. A zero length item is represented by either a Null or Empty value.Parent Notes This property returns the Visual Basic constant “Nothing” for the Root item.) This property also returns “Nothing” when applied to a SecsItem deleted by the Delete method. (A runtime error does occur in this case. The value of this property is the result of the item being built or parsed.

Given a SecsItem object named MyItem. 2. This error is produced when the SECS message is built. so when working with SECS array items in messages you have received you will need to use a temporary variable to access the values. Reply. . 3 ) The Value property does not allow a subscript.7 100 WINSECS COM REFERENCE © 2006 Brooks Automation. the following example creates a SECS array item of I4 values: MyItem. Receive. it must be onedimensional. Default value Empty Data type Variant WinSECS Version 2. If an array is used. This conversion might produce an error.Format = wsFormatI4 MyItem. For example. not when the Value property is set. or Build methods) the Value is converted to the type specified by the Format property (see “Item construction conversion process” on page 14).Value = array ( 1. Inc.When a SECS message is constructed (using the Send. The expression can be an array. the value "Friday" cannot be converted to the format wsFormatI4.

This is different from an item with a value of Null or Empty. AddNew method 101 CHAPTER 6: SECSITEM OBJECT . inserting the duplicate after the item being duplicated. An item with a value of Null or Empty appears in the SECS message as a zero length item. Syntax SecsItem. An Index of 1 adds the new item at the start of the list. The Root item cannot be deleted. Syntax [Item = ] SecsItem. Notes The Index must be an integer greater than zero and not greater than ItemCount + 1.Delete Notes A deleted item does not appear in the SECS message.Methods This section presents the methods of the SecsItem object. This method automatically sets the Format property of the SecsItem to 0 (wsFormatVar). deleting the Root item causes a runtime error. Duplicate method Duplicates an item. AddNew method Adds a new item to a list item.AddNew (Index) Return value The SecsItem object created. Syntax [Item = ] SecsItem. Delete method Deletes an item. An Index of ItemCount + 1 adds the new item to the end of the list.Duplicate Return value The SecsItem object created.

a copy of the item is inserted in the parent list. the item objects contained in the list are also duplicated. at the position just after the item being duplicated. When an item is duplicated. . WinSECS Version 2. You can change its properties without affecting the original item. If the item is a list. The properties of the duplicated item are also copied.7 102 WINSECS COM REFERENCE © 2006 Brooks Automation.Notes Item duplication is useful for SECS messages that have repeating items. Inc. The duplicated item is completely independent of the item that was duplicated.

A Appendix A: Examples This chapter provides examples of WinSECS usage. 106 Send method substitution New transaction p. 110 p. 111 Reading data from a message not defined in your library p. please send them to Brooks Automation for consideration. 105 p. 107 p. 110 HSMS port configuration p. If you create some examples that you feel could benefit others. Transaction name display p. 104 Message transaction example SECS1 port configuration PrimaryOut secondaryin p. 108 Download binary recipe p. 105 p. 112 103 . 104 Set hsms port type p. 111 Building a new message p. 104 Port test p. 104 Set rs-232 port type p. 109 S1F1 message received Adding a secsitem p.

Library. Inc.PortType = wsPortTypeRS232 WinSECS1.PortType = wsPortTypeHSMS Set rs-232 port type This example sets the WinSECS1 control to use RS-232 communication over the COM1 port: WinSECS1.UseDefault List1.SerialPort = "COM1" WinSECS Version 2.TransactionCount List1.Library.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. On Error Resume Next Err = 0 WinSECS1.OpenPort If Err Then MsgBox ("Unable to open port: " & Err.Clear For i = 1 To WinSECS1.Transaction name display This example displays the names of all transactions in the default library.Library. create a form that includes a WinSECS control named WinSECS1. .7 104 WINSECS COM REFERENCE © 2006 Brooks Automation. Add the following code to the form's Load event and press F5.Transaction(i). Dim i As Integer WinSECS1.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. To run this example.AddItem WinSECS1.

MultipleOpen = True WinSECS1.Library. Add the following code to the form's Load event and press F5.IgnoreSystemBytes = False WinSECS1.5 WinSECS1.PortType = wsPortTypeRS232 Then ' for SECS1-RS232 ports Message transaction example 105 APPENDIX A: EXAMPLES .RawHex Add the next code to the WinSECS1 control SecondaryIn event: Debug.SimulateMode = True Set t = WinSECS1. Dim t As SecsTransaction WinSECS1.Send Add the following code to the WinSECS1 control PrimaryOut event: Debug.SecsHost = True WinSECS1.Primary. create a form that includes a WinSECS control named WinSECS1.AcceptDuplicateBlocks = False WinSECS1.Print "Sent S1F1: " & Trans.3 WinSECS1. To run this example.T1 = 0. Watch the results in the Visual Basic’s Debug window. SECS1 port configuration The following example configures the port for SECS1 communication. WinSECS1. To run this example.T4 = 45 ' Properties that apply to the SECS1 communications medium if WinSECS1.AutoDevice = True WinSECS1.UseDefault WinSECS1.Interleave = False WinSECS1. Add the following code and form's Load event.DefaultDeviceID = 0 WinSECS1.T3 = 45 WinSECS1.Print "Received S1F2: " & Trans.PortType = wsPortTypeRS232 ' this is the default ' Properties that apply to all port types WinSECS1.SimulateMode = False ' Properties that apply to all SECS1 port types WinSECS1. create a form that includes a WinSECS control named WinSECS1.Message transaction example This example simulates the sending of an S1F1 message and the receipt of the reply message. Variations are also illustrated to demonstrate SECS1 over three supported media.RetryLimit = 10 WinSECS1.NewTransaction("S1F1") t.Secondary.RawHex Press F5 to run the example.T2 = 0.

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.

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

Raw = Chr$(1) & Chr$(0) Else Trans.Secondary.Delete Trans. ByVal ErrorText As String) If Trans.Stream = 1 And Trans. The first byte is the item format.Index + 1) WinSECS Version 2.Secondary. while the equipment responds with the message as defined in the default Library.Item("SOFTREV") = "Rev1. .Item(1).SecsHost Then Trans.7 110 WINSECS COM REFERENCE © 2006 Brooks Automation.Primary. A zero length list in SECS consists of the byte sequence (in hex) 01 00. In this example. The SECS standard requires that the SECS host responds with a zero length list.Item("MDLN") = "Model1" Trans. with value 0. when an S1F1 message is received in the PrimaryIn event. Inc. The new item is added just after MyItem: MyItem.Parent.Secondary.AddNew(MyItem.1" End If Trans. The second byte is the length byte.Function = 1 Then If WinSECS1.Secondary.S1F1 message received This example returns the proper type of S1F2 message. when an S1F1 message is received.Root. which is list format with 1 length byte. ByVal ErrorCode As Long. Private Sub WinSECS1_PrimaryIn(ByVal Trans As SecsTransaction.Primary. the SecsHost property of the control determines whether or not to reply with a zero length list.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.

PortType = wsPortTypeHSMS ‘ Properties that apply to HSMS ports WinSECS2._ Name = "Pod Arrived" .Item(1).Item(1).Item(1).AddNew (3) .Item(1).AddNew (2) .Root.AddNew (1) .Item(3).Item(2).Root.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.AddNew (1) .Root.DefaultDeviceID = 0 WinSECS2.Root.IPAddressLocal = 0.HSMST6 = 5 WinSECS2.255.Item(1).Item(1).Item(1).100 WinSECS2.Item(1).IPPortLocal = 5000 WinSECS2.Item(1).255.AddNew (2) .Root.Item(1).SimulateMode = False WinSECS2.Item(1).HSMST8 = 5 WinSECS2.Value = 1 .HSMS port configuration This example configues the port for HSMS communication.Name = "TagSn" HSMS port configuration 111 APPENDIX A: EXAMPLES .Name = "L" .IPAddressRemote = 255.Root.Format = wsFormatU1 .0.Root.0.Item(1).Primary .Item(3).Item(1).Item(2).0 WinSECS2.Item(3).Root.Root.Item(1).Item(1).Item(3). using the default values of all properties related to HSMS ‘ Properties that apply to all port types WinSECS2.Item(1).HSMST3 = 45 WinSECS2.Format = wsFormatU1 .Value = 1 ._ Name = "L" .AddNew (1) .Root.NewTransaction("S100F7") With sx.Item(2).Name = "ARM_ID" .Item(1).Root.Item(1).Root.Root.WinSecs1.HSMST7 = 10 WinSECS2.Root.MultipleOpen = True WinSECS2.HSMST5 = 10 WinSECS2.Root.

Value = "45" .Item(2).Item(3).Item(i + 1).Item(i).Item(1).Root.Item(1).Item(1).Format = wsFormatAscii .Item(2).Name = "L" For i = 1 To 12 Step 2 .Item(3).Item(1). Trans.Root.Root.Item(1).Item(1).Item(1).Name = "TAGINFO" .Item(3).Item(1).Checked End If lDisplayMessage AsText.Item(3).Item(2).Root.Format = wsFormatAscii .Primary.AddNew (i + 1) .Item(3).Item(i).Root.Checked Then On Error Resume Next Trans.Item(3).Item(1).Root.Item(1).Item(2). ByVal ErrorCode As Long.Item(1).Item(3).Value = "PR" Next i End With sx.Item(3).Reply If Err Then MsgBox "Unable to reply.Root. Inc.Value = "LOT111" .Name = "TAGINFO" ." Else AsText = MenuText.Item(2).Item(1).Item(2).Item(1).Primary. ByVal ErrorText As String) Dim AsText As Boolean Dim MyItem As Integer If ErrorCode Then AsText = False lDisplay "PrimaryIn error [" & ErrorCode & "]: " & ErrorText & "Message follows.Primary.Item(1).Item(1).Item(3).AddNew (i) .Item(2).Item(1).Item(i).Item(1).Item(2).Value = 1 Then 'pod arrived If Trans.Root. Reason: " & Error$ End If End If Select Case Trans.Format = wsFormatAscii . True If MenuAutoReply.Primary.Root. .Name Case "S100F7" If Trans.Item(3). Trans.Item(2).Value = 1 Then 'arm 1 lblStatus1 = "Buffer" ElseIf Trans.Item(3).Root.7 112 WINSECS COM REFERENCE © 2006 Brooks Automation.Root.Item(1)..Item(2).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.Item(i + 1).Item(i + 1).Value = 2 Then 'arm 2 lblStatus2 = "Buffer" WinSECS Version 2.

0" End Select Case Else Debug.Item(1).Value = 1 Then 'arm 1 lblStatus1 = "Idle" ElseIf Trans.Item(1).Primary.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.Primary.Print "CEID <> 73.Item(2). 74.Primary.Item(2).Print "Message <> S100F7 or S6F11" End Select End Sub Reading data from a message not defined in your library 113 APPENDIX A: EXAMPLES .Item(1).End If ElseIf Trans.Item(1).Item(1).Value = 0 Then 'pod removed If Trans.Value = 2 Then 'arm 2 lblStatus2 = "Idle" End If End If Case "S6F11" Select Case Trans.Primary.Item(1).

WinSECS Version 2.7

114 WINSECS COM REFERENCE

© 2006 Brooks Automation, Inc.

B

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.

Create a new SecsTransaction object using the NewTransaction method. See also InProgress Property. When a SecsTransaction is in progress. See also InProgress Property. This method is not available for transactions in the library. using the NewTransaction method of the SECS control. all properties of the SecsTransaction and the objects it contains become read-only. The SECS message header reserves 8 bits for the function number. SecsMessage Object Error 1014 The Function property must be between 0 and 255 inclusive. When a SecsTransaction is in progress. Event Sequences Error 1016 This transaction is contained in the library. The SECS message header reserves 7 bits for the stream number. The transaction in which this item is contained is in progress.Error 1011 You cannot set this property at this time. This SecsTransaction object is in progress. all properties of the SecsTransaction and the objects it contains become read-only. Event Sequences Error 1013 The Stream property must be between 0 and 127 inclusive. The transaction is in progress. then apply this method to the new SecsTransaction object. WinSECS control object APPENDIX B: ERROR MESSAGES 117 . The transaction in which this message is contained is in progress. See also Function Property. SecsTransaction Object. You should create a new transaction. See also InProgress Property. When a SecsTransaction is “in progress”. Reply. For this reason the SECS function number must be within this range. all properties of the SecsTransaction and the objects it contains become read-only. You cannot use the Send. For this reason the SECS stream number must be within this range. SecsMessage Object Error 1015 You cannot set this property at this time. This SecsMessage object is contained in an in progress SecsTransaction. or Receive methods with a SecsTransaction object contained in the Library. This SecsItem object is contained in an “in progress” SecsTransaction. SecsTransaction Object. SecsTransaction Object. Event Sequences Error 1012 You cannot set this property at this time. See also NewTransaction Property. See also Stream Property.

index. please contact Brooks Automation Technical Support. A value of 1 selects the first SecsTransaction object. In this case. The index must be 1 or greater. Error 1019 This transaction is not contained in the Library.TransactionCount selects the last SecsTransaction object in the Library. See also Transaction Property. The value Library. This error should not occur. You can use the UseDefault method on the Library object to create the default Library. SecsLibrary Object Error 1023 There is no transaction with index index. if it does. You have applied the Transaction property to the Library object. The transaction index passed to the Transaction property or AddNew method must be 1 or greater.7 118 WINSECS COM REFERENCE © 2006 Brooks Automation. SecsLibrary Object. . This method is available only for transactions in the library.TransactionCount. Transaction Property. SecsLibrary Object Error 1022 The transaction index value you have provided. if it does. See also Add New Method. SecsLibrary Object Error 1021 Unable to convert the transaction index to long integer. Use Default Method. Inc. The control has attempted to convert this number to a four-byte integer. is too small. you have used a number. The index value must be between 1 and Library. Check the type value of the parameter for the Transaction property. You must either add transactions you define yourself or use the UseDefault method to create the default Library. Error 1020 There are no transactions defined in the Library. The Transaction property accepts a number or a string as its parameter. but there are no SecsTransaction objects defined in the Library. It is not applicable to SecsTransaction objects that are not contained in the Library.Error 1017 There is no primary message defined for this transaction. Error 1018 There is no secondary message defined for this transaction. This method is used for managing the SecsTransaction objects contained in the Library. See also Transaction Property. SecsLibrary Object. WinSECS Version 2. please contact Brooks Automation Technical Support. The value 1 selects the first SecsTransaction object in the Library. This error should not occur. but the conversion attempt failed.

See also NewTransaction Method.See also Transaction Property.Transaction("S1F3") ' "S1F3" is a string The following code will produce an error: WinSECS1. index.2)) See also Transaction Property.Transaction(2) ' 2 is a number WinSECS1.TransactionCount. SecsLibrary Object Error 1025 Transaction name is not found in the Library.TransactionCount selects the last SecsTransaction object in the Library. SecsLibrary Object Error 1024 The parameter to the Transaction property must be either a number or a string. The value Library. See also Transaction Property. The Variant value you passed to the Transaction property is not a number and cannot be converted to a string. SecsLibrary Object Error 1027 The parameter to the NewTransaction method must be a string or an integer. Legal examples are: WinSECS1.Library.Transaction(Array(1. is too large.Library. APPENDIX B: ERROR MESSAGES 119 . TransactionCount Property. or wsFormatJis8). There is no SecsTransaction object in the Library whose name matches name. The index value must be between 1 and Library. The parameter you passed is not a string and cannot be converted to a number. WinSECS control object Error 1028 Constant: wserrstringconversion Unable to convert item 'item name' value to string. Possible cause is that the Value is an array. The conversion of the Value property to string type failed. See also Transaction Property. wsFormatBinary.Library. The SECS item format for this item is a string type (format code format code). SecsLibrary Object Error 1026 The transaction index you provided. The value 1 selects the first SecsTransaction object in the Library. SecsLibrary Object. 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. The index must be not greater than TransactionCount + 1. The Format property for this item specifies a string type (wsFormatAscii.

The Value cannot be represented as a string. Although the value of SecsItem appears to be defined as an array variant. contact Brooks Automation Technical Support. Error 1032 Constant: wserrnumericconversion Error in numeric conversion of item 'item name'. SecsItem Object Error 1029 Internal logic error. See also Object Error 1033 Format Property. For example. Inc. The SECS standard supports items that are arrays. 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). Use the operating system utilities to examine the memory usage of your system. this error will result. See also Value Property. You must change the Value to a single dimension array. See also Value Property. the actual array elements are either nonexistent or inaccessible.WinSECS has attempted to convert the Value to a string and this data conversion failed. SecsItem Memory allocation failed. If a Value is an array. but WinSECS is unable to convert the Value to a number. Check the Value property and ensure that it is a Value that can be converted to a string representation. if the Format property is wsFormatI4 and the Value property is "Friday". . Value Property. SecsItem Object. You may need to provide more virtual memory or add physical memory. Contact Brooks Automation Technical Support. If the memory usage figure reported by the operating system indicates that there should be sufficient memory. The Format property specifies that this SecsItem is a numeric quantity. Error 1030 Constant: wserrmultidimensionalarray The Value for item 'item name' is an array with more than one dimension. There is no provision in the SECS standard to represent multi-dimensional arrays in a SECS item. it must be one-dimensional. but such item arrays must be one-dimensional. The operating system has reported that there is insufficient memory for the operation. The Value property is a Variant type and is capable of containing multi-dimensional arrays.7 120 WINSECS COM REFERENCE © 2006 Brooks Automation. This error will cause an ARRAY_ACCESS_ERROR. The reason for this error is that the Value property cannot be converted to the specified item format. WinSECS Version 2. SecsItem Object Error 1031 Error attempting access of array variant value for item 'item name'.

WinSECS cannot parse the message unless it conforms to the SECS standard syntax. To fix this problem. To fix this problem. This is not a legal format code. See also RawHex Property. The value of the byte containing this format code is byte value (hex). but only actual number were found in the list. SecsMessage Object Error 1037 Constant: wserrendsinlengthbyte The SECS message ends within an item header length field. See also RawHex Property. The SECS message received is improperly formatted. The end of the SECS message was encountered before the specified number of length APPENDIX B: ERROR MESSAGES 121 .Error 1034 Constant: wserrlisttooshort A list header in the incoming SECS message specified that the list contains specified number items. The error was detected at offset decimal offset in the SECS message. A SECS list header specified that specified number of items were to be found in the list. 10. SecsMessage Object Error 1036 Constant: wserrillegalformatcodein A format code with value format code value (decimal) was found in a SECS item header. it found only actual number of items. WinSECS cannot parse the message unless it conforms to the SECS standard syntax. The error was detected at offset decimal offset in the SECS message. The SECS standard specifies a certain set of legal format codes. you will have to correct the SECS message sent by the other end of the SECS link. This is not a legal value. You can use the RawHex property of the SecsMessage object to examine the SECS2 message. 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). or 11. When WinSECS counted the items. See also RawHex Property. you will have to correct the SECS message sent by the other end of the SECS link. 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 SECS standard requires that the value of these bits be (binary) 01. To fix this problem. A value of (binary) 00 is illegal. 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. You can examine the RawHex property of the SecsMessage object to examine the SECS2 message. You can use the RawHex property of the SecsMessage object to examine the SECS2 message. SecsMessage Object Error 1035 Constant: wserrzeronlb The number of length bytes in a SECS item header is zero. The value format code value is not among these legal values.

See also RawHex Property. See also RawHex Property. The error was detected at offset decimal offset in the SECS message. For example. You can use the RawHex property of the SecsMessage object to examine the SECS2 message. See also SimulateMode Property. WinSECS cannot parse the message unless it conforms to the SECS standard syntax. you will have to correct the SECS message sent by the other end of the SECS link. To fix this problem. The end of the SECS message was encountered before the specified number of data bytes were found. you will have to correct the SECS message sent by the other end of the SECS link. The error was detected at offset decimal offset in the SECS message. The item length must be an even multiple of the size implied by the format code. the format code wsFormatI4 implies that the data bytes will be a multiple of 4 bytes in length. SecsMessage Object Error 1038 Constant: wserrendsindata The SECS message ends within an item data field. the SECS format code implies the number of data bytes in the item. you will have to correct the SECS message sent by the other end of the SECS link. The actual length is not an even multiple of the specified length. . To fix this problem.bytes were found. WinSECS cannot parse the message unless it conforms to the SECS standard syntax. SecsMessage Object Error 1039 Constant: wserrnotmultiple A SECS item was received with a format code that indicates a data length of specified length bytes. You can use the RawHex property of the SecsMessage object to examine the SECS2 message. but the length of the item is actual length bytes. To fix this problem.7 122 WINSECS COM REFERENCE © 2006 Brooks Automation. OpenPort Method. WinSECS control object. For numeric values. You can use the RawHex property of the SecsMessage object to examine the SECS2 message. See also RawHex Property. SecsMessage Object Error 1040 The port is not open and the control is not in simulate mode. The SECS item being parsed has a format code that implies a data length of specified length bytes. Inc. but the length bytes in the item header specify that the item contains actual length bytes. WinSECS control object WinSECS Version 2. 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. You cannot use this method at this time. WinSECS cannot parse the message unless it conforms to the SECS standard syntax. The number of data bytes in a SECS item are specified by the length bytes of the SECS item header.

The WinSECS control relies on this convention to determine if an incoming message is a primary or secondary message. but the SECS control has no record of sending this message. SecsMessage Object Error 1044 This item is deleted and no longer contained in a parent item. SecsMessage Object Error 1043 You cannot set the Function property of a Secondary SecsMessage object to an odd value. it no longer has a parent. SecsTransaction Object. The following code will cause an error of this type: Dim Trans as SecsTransaction Dim MyItem as SecsItem Set Trans = WinSECS1. WinSECS will not allow you to set the Function property of the Primary message to an even value. Function Property. The (optional) second parameter to the Item property specifies the instance of the item. Contact Brooks Automation Technical Support. SecsItem Object Error 1045 The second parameter to the Item property must be a number. The WinSECS control relies on this convention to determine if an incoming message is a primary or secondary message.NewTransaction("S1F1") Set MyItem = Trans. A value of 1 selects the first instance. and so on. Error 1042 You cannot set the Function property of a Primary SecsMessage object to an even value. Function Property. APPENDIX B: ERROR MESSAGES 123 . See also Primary Property.Error 1041 The SECS port handler has given notice that a SECS message has been sent.Secondary. WinSECS will not allow you to set the Function property of the Secondary message to an odd value.Parent. The SECS standard requires that primary messages have odd function values. See also Item Property.Name = "Ln" ' Error! No parent.Delete MyItem. This parameter must be a numeric quantity. Once an item is deleted. SecsTransaction Object. SecsItem Object Error 1046 The Baud value baud is invalid. The SECS standard does not allow this value of the Baud property. See also Secondary Property. See also Delete Method. The SECS standard requires that secondary messages have even function values. 2 the second.Item("MDLN") MyItem.

2 and 25. See also T2 Property.0 inclusive. See also T1 Property. This range of values is specified by the SECS standard. WinSECS control object Error 1052 The T4 value must be between 1 and 120 inclusive. WinSECS control object Error 1053 The PortType value value is invalid. See also RetryLimit Property. The SECS standard reserves 15 bits for the device ID within the SECS1 message header. When you set the PortType. See also T3 Property. WinSECS control object Error 1047 The DeviceID must be between 0 and 32767. This range of values is specified by the SECS standard.See also Baud Property.1 and 10. 1 (HSMS). A PortTypeConstant (defined by the WinSECS control) • wsPortTypeRS232 • wsPortTypeHSMS • wsPortTypeTCPIP • wsPortTypeTELNET 2. you specify a constant or an integer: 1. Inc.7 124 WINSECS COM REFERENCE 0 to specify an RS-232 port © 2006 Brooks Automation. An integer • WinSECS Version 2. WinSECS control object Error 1049 The T1 value must be between 0. WinSECS control object Error 1051 The T3 value must be between 1 and 120 inclusive. 2 (TCPIP). See also T4 Property. See also DeviceID Property. or 3 (TELNET). The DeviceID property must lie within this range. This property must be 0 (RS-232). This range of values is specified by the SECS standard. Change the RetryLimit property. . This range of values is specified by the SECS standard.0 inclusive. SecsTransaction Object Error 1048 The RetryLimit must be a positive integer. WinSECS control object Error 1050 The T2 value must be between 0.

APPENDIX B: ERROR MESSAGES 125 . but its format code is U8. The legal range for this format is min value to max value. SecsItem Object Error 1056 Constant: wserru8range The value of item 'item name' is negative. SecsItem Object Value Property. See also Value Property. Error 1063 The port is already open. You must use a shorter port name. The value specified by the Value property of the SecsItem lies outside this range. Conversion of this value to the U8 format would result in loss of data. The U8 format cannot represent negative values. WinSECS control object Error 1064 This SecsTransaction object has been deleted from the library. See also ClosePort Method. The specified format is capable of representing numbers in the range min value to max value. Conversion of the value to the specified format would result in loss of data. See also Value Property. This property is applicable only to SecsTransaction objects that are contained in the Library. WinSECS control object Error 1054 Constant: wserri4range The value of item 'item name' is outside the legal range for SECS format format. Conversion of the value to the specified format would result in loss of data. You have applied this property to a SecsTransaction object that has been deleted from the Library. You must use the ClosePort method before you can open the port again. SecsItem Object Error 1055 Constant: wserru4range The value of item 'item name' is outside the legal range for SECS format format. The integer value is value. See also Format Property. The value specified by the Value property of the SecsItem lies outside this range.• 1 to specify an HSMS port • 2 to specify an TCPIP port • 3 to specify an TELNET port See also PortType Property. SecsItem Object Error 1062 The serial port name must be less than maximum characters. The specified format is capable of representing numbers in the range min value to max value. The legal range for this format is min value to max value.

7 126 WINSECS COM REFERENCE © 2006 Brooks Automation. WinSECS control Error 1067 The HSMST6 value must be between 1 and 120 inclusive. See also HSMST8 Property. See also IPAddressLocal Property. • The equipment sent a reply to a Primary with ReplyExpected = False. See also HSMST6 Property. SecsTransaction Object. This is the range of values specified by the HSMS standard. • The T3 timeout expired before the equipment sent the reply message. See also HSMST5 Property. Inc. This is the range of values specified by the HSMS standard. See also HSMST7 Property.See also Delete Method. This is the range of values specified by the HSMS standard. WinSECS control. WinSECS control Error 1073 Constant: wserrunknownsecondary message. SecsLibrary Object Error 1065 The HSMST3 value must be between 1 and 120 inclusive. The maximum allowed length is max length characters. See also HSMST3 Property. Received unexpected secondary Possible causes: • The equipment has sent an even function number as a primary message. 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. WinSECS control Error 1072 The IP address is too long. . WinSECS Version 2. This is the range of values specified by the HSMS standard. WinSECS control Error 1066 The HSMST5 value must be between 1 and 120 inclusive. WinSECS control Error 1069 The HSMST8 value must be between 1 and 120 inclusive. IPAddressRemote Property. UseDefault Method.

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. WinSECS will no longer have a record of the original primary and this error will result. SECS messages contain a bit (the W-bit) in the header that indicates that a primary message expects a reply. Contact Brooks Automation Technical Support. See also T3 Property. WinSECS control. It is not possible to delete the Root item of a SecsMessage object. WinSECS control Error 1077 The window handle for this process is NULL. Transaction canceled. the equipment should not return a reply message. If the T3 timeout period elapses before the secondary message is received. See also IPPortLocal Property. IPPortRemote Property. See also LinkTestTimer Property. WinSECS will not be able to find the matching primary and this error will result. WinSECS will assume that it is a secondary (reply) message. which will not exist in this case. WinSECS control Error 1075 The link test timer value must be a positive integer. indicating that there were messages scheduled for transmission when the port was closed. WinSECS will search for the matching primary. The corrective action in this case may be to increase the T3 timeout period. If a primary message is received with an even function number. Error 1078 The ClosePort method was used while this transaction was in progress. This does not indicate a problem in your application. Probable cause is that the application is terminating. Error 1079 The Root item cannot be deleted. Change the test timer value. Change Port number. If the equipment later returns the desired reply. This is an informational error. If this bit is not set. WinSECS will fail the transaction.The SECS standard requires that primary (order) messages have an even function number. Error 1081 Out of memory in SECS interface library. APPENDIX B: ERROR MESSAGES 127 . You have applied the Delete method to the root item. If the equipment does return a reply message. WinSECS control Error 1074 The port number must be greater than zero.

WinSECS control Error 1085 The maximum allowed number of ports are already open. There may be insufficient memory. Contact Brooks Automation Technical Support WinSECS Version 2. You may need to increase the size of the virtual memory available on the computer. See also SerialPort Property. This error originates from SECSDSS (the driver). If you receive this message. The operating system reports that the port you have specified with the SerialPort property does not exist on this computer. Inc. Error 1087 System resources were exhausted trying to create a semaphore. For example. See also SerialPort Property. Error 1089 An attempt was made to close a port that is not open. Set the SerialPort property to a valid port name on your computer. if you are using Visual Basic. You cannot open additional serial ports within this process. Error 1082 Internal SECS library error ErrorNumber: This error message is a funnel for SECSDSS errors (the driver). WinSECS control Error 1084 The serial port name specified does not exist. Error 1088 System resources were exhausted trying to create a system event. There may be insufficient memory. . WinSECS was unable to create a semaphore object for the port. Error 1086 System resources were exhausted trying to open the port. The SerialPort property may not be a zero length string. This second application will allow you to open additional ports.This is a serious error and indicates that the SECS port driver does not have sufficient memory. Some system limitation has been reached. To use additional serial ports. Contact Brooks Automation Technical Support. there may be unexpected TCP/IP or network level errors. The WinSECS process limit on the number of open serial ports has been reached.7 128 WINSECS COM REFERENCE © 2006 Brooks Automation. There may be insufficient memory. WinSECS was unable to create an event object for the port. you must start another process. Error 1083 No port name was specified. you must write a second VB application.

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. you may need to set the IgnoreSystemBytes property to True. The most likely cause is that the port is in use by another process. you may need to increase the T3 or HSMST3 property value. If you find that the equipment does not handle system byte property. APPENDIX B: ERROR MESSAGES 129 . WinSECS has successfully sent a primary message.Error 1090 An attempt was made to open a port that is already open. The operating system has denied access to the port. WinSECS control Error 1094 Constant: wserrrty The RetryLimit was exceeded on an attempt to send a SECS message. IgnoreSystemBytes Property. HSMST3 Property. you should check the health of the equipment and the status of the SECS cable. If the equipment is not expected to send a reply. Contact Brooks Automation Technical Support. If a reply is expected. The system bytes in the secondary message must match those in the primary message. Select a different serial port. This should be a last resort. you should set the ReplyExpected property of the SecsTransaction object to False. The first thing to check is whether or not the equipment should send a reply to this primary message. A serial port has been opened by another application or WinSECS control. you should obtain a record of the traffic on the port. SecsTransaction object. WinSECS control. or close the application or WinSECS control that opened the serial port you wish to use. but the secondary message was not received within the period specified by the T3 property (or the HSMST3 property for HSMS ports). Some equipment do not handle system bytes properly. because it can lead to unreliable communication. ReplyExpected Property. Error 1093 Constant: wserrt3timeout A secondary message was not received within the T3 (reply) timeout period. Error 1092 The operating system reported an error on the attempt to open the port. WinSECS control. If the equipment is operating properly and the cabling is intact. See also T3 Property. and such misuse can cause this error. The port may be in use by another process. See also Serial Port Property Error 1091 The SECS driver has no record of this transaction. If you are not able to solve the problem using the steps above. You can do this by using the Monitor event.

See also T2 Property. RetryLimit Property. you will not get anywhere with WinSECS in HSMS mode. The product of RetryLimit and T3 determines the amount of time the equipment has to respond. You must upgrade to version 1. Error 1098 The WinSock layer reports that the network is down. You must obtain and install a more recent version of the WinSock layer.1. you will not get anywhere with WinSECS in HSMS mode. Error 1099 WinSECS Version 2. Check your network settings and verify that TCP/IP support is enabled. Check your network settings and verify that TCP/IP support is enabled. contact Brooks Automation Technical Support. WinSECS uses certain WinSock features that are not present in versions earlier than 1. If the link is intact.51 ships with the proper version of WinSock. .1. can cause this error. A disconnected cable or equipment is off line. If it is less than 3.First determine if the SECS link to the equipment is intact. Until you can use these utilities successfully. Inc. Your WinSock software has probably been replaced by an older version. This error indicates that the equipment did not respond to a request to transmit a message. check the value of the RetryLimit property. If your settings are correct but you are still having WinSock problems. WinSECS control. Use one of the standard TCP/IP utilities on your computer (such as TELNET) to verify that your TCP/IP configuration is correct. Windows NT version 3. Check your network settings and verify that TCP/IP support is enabled. WinSECS control Error 1095 The operating system has reported that the networking components are not ready. try setting it to 3 or more. Error 1096 The WinSock DLL installed on your system does not support version 1. Error 1097 The WinSock layer reports that it is not initialized.7 130 WINSECS COM REFERENCE The WinSock layer reports that the Local IP address used is not supported on your computer.1. 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. © 2006 Brooks Automation. Some equipment cannot respond rapidly if it is busy.

An attempt to connect to the remote HSMS entity was unsuccessful. Error 1104 You are using two ports in Passive or Alternating mode with the same combination of IP address and Port number. Try increasing your virtual memory limits.You have used a value for the IPAddressLocal property which is not valid for this computer. Error 1108 WinSECS was unable to create a socket using the Remote/Local IP address and Remote/Local IP port specified. Try using a second process. WinSECS control Error 1100 The WinSock layer is out of file descriptors for this process. Error 1102 The WinSock layer reports that this local port type is not supported. In other words. 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. See also IPAddressLocal Property. Verify that the local IP address of your machine matches the IPAddressLocal property. APPENDIX B: ERROR MESSAGES 131 . Contact Brooks Automation Technical Support. Error 1101 The WinSock layer is out of buffers. Each port must have a unique combination of IP Address and Port number. The WinSock layer has rejected the IP Address you have entered. Error 1106 WinSock reports that a connection attempt was refused. You have attempted to open more HSMS ports for this process than the operating system allows. Contact Brooks Automation Technical Support. Make sure these are valid values for your machine. Determine your actual IP address and use that value as the IPAddressLocal property. Error 1105 WinSock reports that the local IP address used is not allowed on this machine. Error 1103 The WinSock layer reports that this local port number is not supported. Probable cause is a low memory condition. This is probably because the remote entity is not listening on this combination of IP Address and Port number. Contact Brooks Automation Technical Support. this is not the address of this machine. This is not allowed.

If it does.. This error may be the result of problems with the remote entity. Inc. A T6 timeout is the result of a reply timeout on a control message. This may indicate problems with the network or the remote equipment. If you are using a host name for the IP Address.7 132 WINSECS COM REFERENCE © 2006 Brooks Automation. or your are using a Remote IP Address/IP Port that doesn’t exist. network errors. such as select and link test. Error 1112 Constant: wserrconnectionlost The HSMS connection has been lost. make certain that this host name is valid for your network and that host name resolution is operating properly on your network. The network may recover.You have used a value for the IPAddressRemote. 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 may indicate problems with the network or the remote equipment. or slow network response. . WinSECS control. WinSECS control Error 1109 WinSock reports that a connection attempt has been made on a socket that is already connected. The network connection has been lost unexpectedlyand is not the result of a disconnect request from the remote HSMS entity. you may want to increase the HSMST7 value. WinSECS control Error 1114 Constant: wserrhsmst7 An HSMS T7 timeout has occurred. 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. IPPortRemote. you may want to increase the HSMST6 value. See also IPAddressLocal Property. Check with your network administrator to gain access to the remote address. Either the Local IP Address/IP Port is invalid for this is invalid host. This error might result from problems with the remote entity. In the case of slow network response. IPAddressRemote Property. IPPortRemote Property. See also HSMST6 Property. or slow network response. network errors. WinSECS control. IPAddressLocal. Contact Brooks Automation Technical Support. WinSECS control. IPPortLocal Property. or IPPortLocal property which is not valid. Error 1111 WinSock reports that it is unable to connect to the Remote host specified. WinSECS Version 2. In the case of slow network response. Error 1113 Constant: wserrhsmst6 An HSMS T6 (control transaction) timeout has occurred. the HSMS connection will automatically be established again (assuming the remote HSMS entity is still live).

Either the remote HSMS entity has shut down or it has terminated the link with the intention of starting it up again. WinSECS control Error 1115 Constant: wserrhsmst8 An HSMS T8 (network intercharacter) timeout has occurred. This may be because of problems with the remote entity. Make sure TCP/IP is loaded properly on your computer if you wish to use HSMS. In the case of slow network response. you may want to increase the HSMST8 value. This may indicate problems with the network or the remote equipment. This may indicate a baud rate mis-match. See also AutoBaud Property. This timeout occurs if successive packets are received in a time longer than HSMST8. or using a shielded cable. or noise on the line. or slow network response. Error 1118 Constant: wserrdisconnectlocal The HSMS connection was closed by your program's request. You have closed the port using the ClosePort method. See also HSMST8 Property. The remote HSMS entity has done a clean termination of the HSMS connection. This error indicates that the remote HSMS entity has rejected a message transmitted by this node.See also HSMST7 Property. This is normally the result of lack of state synchronization between the local and remote entities. WinSECS control Error 1117 Constant: wserrhsmsreject An HSMS message was rejected.DLL) was not found. WinSECS control Error 1121 The WinSock library (WSOCK32. This can occur if the SECS data are transmitted in multiple TCP/IP network packets. you should consider shortening the RS-232 cable. This may indicate problems with the network or the remote equipment. If there is no baud mis-match and this error occurs frequently. You must install the TCP/IP network support to use HSMS. Error 1120 Constant: wserrbadchar An RS-232 character was received with an error indication from the UART. This should be a transient problem that will correct itself. Error 1119 Constant: wserrdisconnectremote The HSMS connection was closed because a SEPARATE message was received. you may want to consider using the AutoBaud feature. You have not installed TCP/IP support on your computer. APPENDIX B: ERROR MESSAGES 133 . If the problem is a baud rate mis-match. network errors.

the remote HSMS entity is either not available or the connection has not completed. The connection will be restarted. The connection will be restarted. The remote HSMS entity has shut down its network connection. Transaction indexes must be 1 or greater. is too small. Change the index to a number between 1 and TransactionCount. . so the index value cannot be less than 1. Error 1124 Constant: wserrnotconnected The HSMS port is not connected. Error 1123 WinSock reports that the other side of the socket has shut down. Error 1128 Constant: wserrt2timeout The T2 timeout period was exceeded. When using HSMS. you cannot send a SECS message unless the Connected property is True. The remote HSMS entity has reset its network connection. This may be the result of an error detected at the remote entity. See also NewTransaction Method Error 1127 Constant: wserrcharacterdiscarded A character was discarded at the data link level. If it is an active connection. Inc.Error 1122 WinSock reports that a connection has been reset by the remote HSMS entity. An incoming bad character was reported by the operating system. index. WinSECS control Error 1125 The transaction index value you have provided. An index of 1 selects the first transaction in the library. A T2 timeout has expired. You have attempted to send a SECS message. If this is a passive connection. WinSECS will attempt to reconnect. WinSECS will attempt to reconnect. WinSECS control. This may be the result of an error detected at the remote entity.7 134 WINSECS COM REFERENCE © 2006 Brooks Automation. Error 1126 There is no transaction with index index. assuming the remote entity is willing. This can be the result of noise on the line or a mis-matched baud rate. WinSECS Version 2. A retry will occur at the data link level. the remote HSMS entity has not yet initiated the connection. This means that either the communication is broken between the host and equipment or that the value for the T2 property is too small. assuming the remote entity is willing. but the HSMS port is not in the connected state. No SECS message transmission is possible until the HSMS connection is established. Connect Event. See also Connected Property.

See also T2 Property Error 1129 Constant: wserrt1timeout The T1 timeout period was exceeded. Its purpose is to be the Parent SecsItem object for those items that are at the top level of the SECS message. If it occurs regularly. Error 1132 Constant: wserrchecksum The checksum for a SECS1 block does not equal the sum of the data bytes received. Such items are children of the Root item. There is always exactly one Root item for a SecsMessage object. The Root item does not appear in the SECS message sent or received over the port. This means that either the communication is broken between the host and equipment or that the value for the T4 property is too small. it is legal to duplicate one of the SecsItem objects at the top level of the SECS message. See also T4 Property Error 1131 Constant: wserrcommabort The communication driver on your computer has aborted. you should check the binary data sent from the equipment to determine if it is using the proper checksum values. 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. This means that an error condition has occurred from which the driver software cannot recover. In our testing we have been able to cause this error only on a baud rate mismatch between the equipment and the computer. You may also want to install shielded cables. However. The driver software is installed to match your hardware configuration and so is not necessarily the same from one computer to the next. See also T1 Property Error 1130 Constant: wserrt4timeout The T4 timeout period was exceeded. This means that either the communication is broken between the host and equipment or that the value for the T1 property is too small. This error may be the result of line noise. A T4 timeout has expired. A T1 timeout has expired. See also Root Property APPENDIX B: ERROR MESSAGES 135 . It is illegal to duplicate this SecsItem. To recover you must close and reopen the port. If this is the problem you should either use the AutoBaud feature or make certain that the baud rates are matched. The communication driver software that handles the serial ports on your computer has aborted. The reason for this error depends on the driver. Error 1133 The Duplicate method cannot be used on the Root item.

Block numbers must be sequential. This will occur if the equipment has sent (for example) blocks numbered 1. the Ubound and Lbound function can be used to determine what indexes are valid. Make sure the data passed contains Bytes whose values are between 0 and 255. See also Raw Property. Block numbers must be sequential. SecsMessage Object Error 1138 The Index passed as an argument to the Raw property for the item was invalid. See also AcceptDuplicateBlocks Error 1135 A SECS1 block was received with an unexpected block number. . 2. The block number in the SECS1 header is unexpected. WinSECS was unable to convert this data to a byte representation. Error 1137 An illegal value has been entered into the Raw property. A duplicate block may also be received because the sender does not manage system bytes properly. 1. The data passed to set the Raw property was not valid.Error 1134 A duplicate SECS1 block was detected and discarded. but the receiver (WinSECS) had not rejected the previous block. The block number in the SECS1 header is unexpected. See also Raw Property. Inc. Normally this indicates that the sender has resent the block because of a T2 timeout. SecsItem Object WinSECS Version 2.7 136 WINSECS COM REFERENCE © 2006 Brooks Automation. Error 1136 A SECS1 block was received with a block number indicating it is the first block. you should disable duplicate block detection. This will occur if the equipment has sent (for example) blocks numbered 1. The error typically means that the index being used to access data in the raw property of the item is invalid. In Visual Basic. If this is the case (and only in this case). A duplicate SECS1 block is one where the 10 header bytes are exactly the same as those received in the previous block. but the first block was not expected at this time. 3. This is not an error under these conditions.

or need assistance with.C Appendix C: Software Support This section explains what to do when you have questions about. 138 Before you call p. 141 137 . 140 p. 139 How to contact Software Support Other services p. Brooks Automation software products. What is Software Support? p.

contact your sales representative. product alerts.brooks. 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. To arrange for additional product maintenance. technical professionals who answer questions and help you when you need assistance with products developed by Brooks Automation. Web-based support WinSECS Version 2.What is Software Support? Software Support is a group of trained.com. supported configuration information. Brooks Automation offers web-based support for its products. For information about additional services. This includes online access to current product information.com. contact your sales representative or send an e-mail message to ssgorders@brooks. Coverage The Software Support department is available for: • Customers using products covered under the ninety (90) day warranty. For more information about coverage. . documentation. • Products covered by current maintenance contracts.7 138 WINSECS COM REFERENCE In addition to the Software Support department. Visit us at www. and frequently asked questions (FAQs). see “How to contact Software Support” on page 140. Inc. release notes. © 2006 Brooks Automation.

select the .DLL file in the File Manager or Windows Explorer and press ALT+ENTER. company and site or If you are a Brooks Automation employee. • An ActiveX control on a PC. value added location reseller (VAR). If you need to call for help while working through a problem. For more information. or distributor. enter <product name> -help at the command line to obtain version information. select its . Click the Version tab to display the file version number. run the CELLversions script to display the file containing version information. Make a note of any measures you have taken to resolve the problem. Provide any additional information requested by the Software Support engineer. Gather and be prepared to provide the information in the table below. • A dynamic-link library on a PC. Type of hardware. try to be near a computer that is ready to run the application.OCX file in the File Manager or Windows Explorer and press ALT+ENTER.Before you call Please be prepared to provide a detailed description of the problem and the sequence of events necessary to reproduce it. • FACTORYworks (UNIX components). E-mail address If you prefer to be contacted electronically. • On a PC. Telephone number Where to reach you during business hours. please indicate who the end customer is. see the CELLworks Installation Guide. see your System Administrator. • CELLworks. Name of the product If you are not sure of the product name: • For UNIX products. operating system and version. Click the Additional tab to see version information about all product components. Click the Version tab to display the file version number. so that the issue can be logged under the appropriate customer account. from the main menu of an application. Before you call 139 APPENDIX C: SOFTWARE SUPPORT . Version information To obtain version information for: • APC Platform. please give your e-mail address. amount of RAM If you are not sure about this information. choose Help > About. refer to the ReadMe file included with the release. Type of information Comments Your name. look at the expl file for the product set.

fax. Your call will be returned by the first available engineer. you can send an email or fax. The return address may not be the correct address for Software Support. or mail. .: <Product name> Software Support (For example: Xsite Software Support) Mail Brooks Automation Attn. If you feel the issue requires escalation. WinSECS Version 2.com (For example: Xsite-support@brooks. please leave a voice mail message. Escalation Your issues and satisfaction are important to us. 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.: <Product name> Software Support (For example: Brooks Automation Xsite Software Support 15 Elizabeth Drive Chelmsford. Inc. Reporting Method Contact Information Telephone 978-262-7970 E-mail <Product name>-support@brooks.How to contact Software Support The Software Support department can be reached by phone. or leave a voice mail message that details your question.7 140 WINSECS COM REFERENCE © 2006 Brooks Automation. Eastern Standard Time. If all Software Support engineers are busy when you telephone. you may request a Priority 1 (P1) response. e-mail. Fax 978-262-2509 Attn. If you need assistance during non-business hours. MA 01824 USA) Hours of operation Software Support’s current operating hours are: Monday through Friday (except company holidays) 8:00 AM .8:00 PM. Call tracking Brooks Automation uses computer-based call tracking of all problem reports. please contact the Software Support manager. A Software Support engineer will contact you during regular business hours.com) Do not use your e-mail system's reply function to send a message back. If this is a critical problem.

Free upgrades and bug fixes Brooks Automation may issue modified or enhanced versions of products. Contact your sales representative or the Software Support manager for additional details. 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. Other services 141 APPENDIX C: SOFTWARE SUPPORT .Other services Brooks Automation offers additional support services and enhanced versions of products to qualified customers. Customers who have a current maintenance contract are eligible to receive this software per the terms of the Brooks Automation Software License Agreement.

Inc. .WinSECS Version 2.7 142 WINSECS COM REFERENCE © 2006 Brooks Automation.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 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 C AutoSystemBytes property SecsTransaction objects 77 characters discarding at data link level 134 RS-232 133 sending over communication ports 61 B 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 .

setting 104 unavailble 122 unsupported numbers 131 unsupported types 131 L M N O P Q R S T 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 X Y Z device IDs adjusting 31 DeviceID property invalid values 124 SecsTransaction objects 78 dialogs See modal dialogs. 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. 128– 129 RS-232 104 SECS1 105 sending characters over 61 types.A B C D E F G H I J attempting to close 125. document revision history ix CurrentConnectionMode property WinSECS controls 36 W 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 V 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 U WinSECS controls 37 Connect events WinSECS controls 60 ConnectionMode property WinSECS controls 35 144 K 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. . 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.

68 SecsWarning 69 storing 22 system. 67 SecsError 21. item data as 99 index codes setting baud rates using 32 Index property INDEX 145 .A B C D E F G H I J K Disconnect 61 Monitor 48. 82 PrimaryOut 21. 106 SecondaryOut 21. 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. 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. 61. 65. HSMS communication breaking 61 connection mode 36 L M N O P Q R S T U V W X Y Z 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. 63. 94 updating 14 forms See modal forms. 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. 66. 129 PrimaryIn 21. 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.

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. 121 length 15 names 98. 97. . 127.7 WINSECS COM REFERENCE J K L M N O P Q R S T U V W X Y Z items attempting to locate 115 constructing 14 converting 11– 12 data. as binary memory images 99 deleted 123 deleting 101 duplicating 101 format 11. 96 SecsMessage objects 87 ItemCount property SecsItem objects 97 146 WinSECS Version 2.TransactionCount 118– 119 link test timers obtaining 47 valid values 127 LinkTestTimer property WinSECS controls 47 M memory allocation failures 120 virtual. 14. 119 format codes 11. increasing 131 memory images binary. 116 obtaining 87 Root 115. Inc.A B C D E F G H I 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. 94 headers 15. item data as 99 messages © 2006 Brooks Automation.

65 events occurring upon receipt of 63 expecting replies to 80 generating unique system bytes 77 object names 19 INDEX 147 . 101 Duplicate 101. 111 creating 2 illegal length 121– 122 improperly formatted 121 modifying 2 names 87 parsing 19 S1F1 64. constructing 15 constructing 13. 119 OpenPort 58 Receive 82 Reply 21. 83. 127 Delete 82. 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 L M N O P Q R S T U V W X Y Z 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. 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. 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. 82 Send 21.A B C D E F G H I J K adding support for 24 binary. 121 NLB property SEC item header length 15 SecsItem objects 98 number of length in bytes See NLB. 107 UseDefault 74. 105– 106. 135 NewTransaction 57. 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.

78 Interleave 42 IPAddressLocal 43. 124 Tag 24. 97 Library 47 LinkTestTimer 47 MonitorEnabled 48 MultipleOpen 48 Name 79. 124 T4 55. 99. 14. Inc.7 WINSECS COM REFERENCE Q R S T U V W X Y Z Length 14– 15. 87. 123 ItemCount 97 P 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. 87. 126. 123 HSMST3 38.A B C D E F G H I J K L M N O 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. 122 read-only when transaction in progress 117 ReplyExpected 21. 87. 136 RawHex 14. ReplyExpected True 21 triggering 106 WinSECS controls 65 148 WinSECS Version 2. 94 DeviceID 78. 132 IPPortRemote 46. . 129 Index 78. 124 T3 55. 37 Description 72. 117 SystemBytes 81 T1 54. 96 InProgress 20. 116. 87. 99. 124. 124 Format 11– 12. 98 Parent 99 PortIsOpen 49 PortType 50 Primary 79 Raw 14. 88. ReplyExpected False 21 resulting from Send method. 134 ConnectionMode 35 CurrentBaud 36 CurrentConnectionMode 36 DefaultDeviceID 31. 133 AutoDevice 31 AutoSystemBytes 77 Baud 32. 96. 98 NLB 15. 77. 120 Primary property SecsTransaction objects 79 properties AcceptDuplicateBlocks 29 ActionOnError 76 ActionOnSuccess 76 AutoBaud 30– 31. 123 BaudIndex 32 Connected 33. 132 HSMST8 41. 132 HSMST7 40. 86. 117. 132 Item 17. 126 HSMST6 39. 126 HSMST5 39. 126. sending 109 replies expecting 80 © 2006 Brooks Automation. 118– 119 TransactionCount 73 Value 11. 130– 132 IPAddressRemote 44. 94 Function 86. 124 T2 54. 133 IgnoreSystemBytes 41. 132 IPPortLocal 45. 126. 81 Transaction 72. downloading 109 multi-block. 129 Root 89 Secondary 80 SecsHost 51 SerialPort 52. 128 SimulateMode 53 Stream 90. 80 RetryLimit 51.

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. 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. 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. in Visual Basic 23 SECS items See items. SECS standard 4 SECS stream numbers 90 INDEX 149 . 51 S S1F1 messages example reply 64 primary 106 receiving 110 sending 105 K L M N O P Q R S T U V W X Y Z 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.A B C D E F G H I J matching 41 receiving 105 reply messages See replies.

A B C D E F G H I J SECS transactions See transactions. 71– 73 ActionOnError property 76 ActionOnSuccess property 76 adding to library 74. 92 converting 14 Delete method 101 Description property 94 Duplicate method 101 Format property 11.7 WINSECS COM REFERENCE K L M N O P Q R S T U V W X Y Z SecsMessage objects characteristics 4 constructing 13 Description property 86 Function property 86. . Inc. 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. 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. 85 Value property 11. 94 Index property 96 Item property 17. 118 150 WinSECS Version 2. 96 ItemCount property 97 Length property 97 Name property 98 NLB property 98 Parent property 99 properties 10. 81 templates 4 use when receiving primary messages 63 SecsWarning events WinSECS controls 69 semaphores creating 128 SEMI standards 1 © 2006 Brooks Automation. 94 Raw property 99 root for SecsMessage objects 8. 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. 99 SecsLibrary objects AddNew method 74 characteristics 4 Description property 72 Transaction property 72 TransactionCount property 73 UseDefault method 74.

A B C D E F G H I J K L Semiconductor Equipment Communication Standard See SECS. 127. 135 T2 134 T3 38. 55. 135 T5 39 INDEX 151 . 129 T4 55. breaking 61 enabling 130 loading properly 133 technical support 137 timers link test 47. 127. 129 stream 9 messages 21 Y T2 property invalid values 124 WinSECS controls 54 simulate mode setting 122 software support 137 X T1 timers obtaining 54 timeouts 135 T3 property invalid values 124 WinSECS controls 55 sockets connection failures 132 problems creating 131 shutting down 134 W invalid values 124 WinSECS controls 54 SerialPort property specifying 128 WinSECS controls 52 SimulateMode property WinSECS controls 53 V 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. Send method events resulting from 21 SecsTransaction objects 83 substitution method 107 serial ports name restrictions 125 obtaining names 52 specifying 128 M N O P Q R S T U 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 Z T2 timers timeouts 134 T3 timers HSMS communication 38 obtaining 55 timeouts 66. 127 T1 54.

99 Variant data type array 12 problems 13 Variant values invalid 116. 134 valid values 134 transaction objects representing SECS messages 2 M N O P Q R S T U V Value property converting 120 SecsItem objects 11. 119 variants arrays 12 converting type 11 Float 11 item formats 11 WinSECS Version 2.A B C D E F G H I J K T6 132 T7 132 transaction indexes converting 118 invalid 119. 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. 104 records 129 simplifying creation of 4 simultaneous outstanding 84 templates 2 using ClosePort method while in progress 127 152 L W window handles 127 Windows-compatible Semiconductor Equipment Communications Standard See WinSECS WinSEC library See library. Inc.7 WINSECS COM REFERENCE Z Visual Basic debugging environment 2 hiding secondary messages 23 programming environment for SECS interfaces 22 W bits 80. 127 V Y vbDouble data type drawbacks 13 TransactionCount property SecsLibrary objects 73 UseDefault method SecsLibrary objects 74. . 118 X VB Toolbox incorporating WinSECS controls 2 Visual Basic applications adding WinSECS controls to 2 U W 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.

134 uninitialized 130 WinSock library (WSOCK32.DLL) problems locating 133 INDEX 153 .A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 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.

Inc. .A 154 B C D E F WinSECS Version 2.7 WINSECS COM REFERENCE G H I J K L M N O P Q R S T U V W X Y Z © 2006 Brooks Automation.