STwrench User Guide Working with the API
9836 4134 01 Edition 2.9 291 (326)
Examples on what a client can do using the STwrench API are:
• Upload and download configuration data from/to a STwrench unit
• Read tightening results and traces from a STwrench unit
• Get/Set the selected Pset, selected Job, barcode on a STwrench unit
• Get/Set the batch count for a specific Pset on a STwrench unit
NOTE: The STwrench events (new result, new batch result, new job result, TAG removed,
TAG inserted, new identifier read, OK key pressed, CL key pressed, UP key pressed, DOWN
key pressed, LASER key pressed, OK key released, CL key released, UP key released, DOWN
key released, LASER key released, Battery low, Pset started, Pset completed, Cycle start
reached, Job started, job completed, multistage started, multistage completed) are available only
when connected via IRC-W (not for USB connection). Therefore, since events are available
only with IRC-W, the function to execute a Pset/Multistage/Job by the API should be used only
with IRC-W connection. To select a Pset/Multistage/Job, the STwrench “source program” must
be set to API. See the chapter Setting the source for Pset/Multistage/Job selection for more
information.
The STwrench API handles all communication needed between the PC, on which the custom application
resides, and the specific STwrench units involved. The developer of the custom application only needs to
know which objects and function(s) to call, and in some cases how the returned data are formatted.
When the custom application invokes one of the API functions, the API first translates the request to
commands understood by the target unit. These are then sent to the target Unit via the USB connection.
Thereafter the API waits for the answer to be returned. When the answer is received, it is interpreted and
in some cases translated to a more easily understood format before the API returns the answer to the
custom application.
Custom applications using the API can be run on any PC that is connected to a STwrench via USB.
However, only one custom application at a time may use the API on a specific PC.
Technically the STwrench API can be used with a COM interface or a .NET interface.
Before using the STwrench API, you must install the component on the PC you are going to use it from. It
also installs a small custom application example, written in Visual Basic 6 and Visual Basic .NET, that
shows you an example of how the API can be used.
After installing the STwrench API, you can start to develop applications performing tasks not covered by
the standard STwrench system. Typical cases are:
• Storing cycle data on disk, or in a database, in any customer specific format
• Sending cycle data to an external SPC program
• Sending or receiving data via any serial protocol you choose to implement