First, read the article that explains serial number taking and reserving.
This article describes how to retrieve the serial numbers from a client.
First, download and install the WATS client, see Install WATS Client (>5.0.272). TEMP
During the installation, select the Development version.
Then, you need to make a setup program (we will provide this in a later version). This setup program can be made in any tool that can call a .NET assembly (dll). Visual Studio, LabView, Teststand...
The assembly to be referenced is called WATS in the Global Assembly Cache (GAC) and can also be found in the folder C:\Program Files\Virinco\WATS\DesignSupport. The assembly is Virinco.WATS.Interace.MES.Production, and the class to use is called SerialNumberHandler.
The test program needs to call one function to prepare the client for serial number retrieval:
Here in C#
public void Initialize(
Here is the meaning of the parameters:
tokenID - Authentication token generated on the WATS server according to this procedure:
serviceUrl - The service address, e.g.:
requestType - The client can operate in two different modes:
Take: Client must be online and the requested number of serial numbers will be marked as Taken in the database when fetched.
Reserve: Client downloads a batchSize number of serial numbers and makes a reservation in the database.
The downloaded serial numbers are stored and maintained in an XML file on the client (C:\ProgramData\Virinco\WATS\AddressStore). When there are fetchWhenLessThan serial numbers left in the local store, new serial numbers are downloaded from server.
onlyInSequence - If set to true, requested serial numbers will be contiguous (NB: Not supported for serial numbers)
batchSize - How many serial numbers that are reserved on the server (When requestType=Reserve)
fetchWhenLessThan - Number of remaining offline serial numbers before server is polled for a new batch
startFromSerialNumber - String containing an integer, which will be the first generated serial number in the serial number range.
siteName- Serial numbers will be registered to a site with this name (NB: Must be defined on the server, can be null)
token- Special Guid needed to perform this function (password), contact email@example.com
After calling this function, the client is ready to retrieve serial numbers by calling the GetSerialNumber or GetSerialNumbers function.
There are more functions in the api. Use this as the latest documentation of the client api.
To open it, click Start, All Programs, WATS and WATS Client Documentation - or on Windows 10.
You will find all function calls here:
Here is a sample VI with Labview for setup with Reserve:
To retrieve a serialnumber: