This article describes how to configure the Serial Number handler at the client dynamically using the API.
First, download and install the WATS client (download.wats.com).
See Also:
Configure Serial Number handler at the WATS Client
Get Serial number or MAC address using the WATS Client
NOTE: When you are using the 5.x client, you should leave the parameters tokenID and serviceUrl blank as it will retrieve these from the client setup.
NB: The only valid serialNumberTypeName in WATS new installations is "MAC address" (not MACAddress as stated in the following guide) and RunningSN. New custom handler(s) may be applied (specific rules for SN generation etc.), please contact support@virinco.com.
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 (Client type Development). The assembly is Virinco.WATS.Interace.MES.Production, an the class to create is called SerialNumberHandler.
The application needs to call one function to prepare the client for MAC retrieval:
Here in C# |
public void Initialize( |
Here is the meaning of the parameters:
tokenID - Leave BLANK (API will use the existing Client token)
serviceUrl - Leave BLANK (API will use the existing Client connection)
requestType - The client can operate in two different modes:
Take: Client must be online and requested number of serialnumbers will be marked as Taken in the SN database when fetched.
Reserve: Client download a batchSize number of serialnumbers and makes a reservation in the SN 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 serialnumbers left in the local store, new serialnumbers are downloaded from server.
onlyInSequence - If set to true, requested serialnumbers will be contiguous (NB: Only MAC addresses)
batchSize - How many serialnumbers that are reserved on the server (When requestType=Resvere)
fetchWhenLessThan- Number of remaining offline serialnumbers before server is polled for a new batch
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 support@virinco.com
After calling this function, the client is ready to retrieve serialnumbers 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:
Comments
0 comments
Please sign in to leave a comment.