Adding Asset Information to UUT Reports (TDM API)
Summary: How to add instrumentation and test equipment tracking to UUT reports using the C# API.
Key Insight: Assets track instrumentation (DMMs, power supplies, fixtures). If the asset serial number exists in Asset Manager, its usage count is automatically incremented.
#assets #instrumentation #test-equipment #c-sharp-api
Adding Assets to a UUT Report
Basic Usage
using Virinco.WATS.Interface;
// Create UUT report
Report report = api.CreateUUTReport(
"SN12345",
"PCB-100",
UUTStatusType.Passed,
"Test");
// Add asset by serial number
report.AddAsset("DMM-SN-001");
// Add asset with specific usage count
report.AddAsset("PSU-SN-042", 1523);
// Submit
api.Submit(report);
What happens:
- If asset serial number exists in Asset Manager → usage count is automatically incremented
- If asset doesn't exist → it's tracked with the report but not in Asset Manager
Complete Example
using Virinco.WATS.Interface;
public void SubmitTestWithAssets()
{
using (TDM api = new TDM())
{
api.ClientLogin("client", "password", "station");
// Create UUT report
Report report = api.CreateUUTReport(
"SN12345",
"PCB-100",
UUTStatusType.Passed,
"Functional Test");
// Add instrumentation used during test
report.AddAsset("DMM-34401A-SN12345"); // Digital multimeter
report.AddAsset("PSU-E3631A-SN67890"); // Power supply
report.AddAsset("FIXTURE-ICT-001"); // Test fixture
// Add test measurements
api.AddNumericLimitTest(
report.RootStep,
"Supply Voltage",
"V",
5.02,
CompOperatorType.GELE,
4.95,
5.05);
// Submit
api.Submit(report);
}
}
Accessing Assets
// Get all assets from a report
Asset[] allAssets = report.Assets;
// Get asset statistics (only available when loading from server)
AssetStatistics[] stats = report.AssetStatistics;
Use Cases
Assets are useful for tracking:
- Calibration schedules - Track usage count for instrumentation requiring periodic calibration
- Equipment traceability - Know which DMM, power supply, or fixture was used for each test
- Maintenance planning - Monitor fixture usage cycles for wear management
Restrictions
- Same asset can be added multiple times with different usage counts
-
AssetStatisticsis only populated when loading a report from the server (not during creation) - Assets must be registered in Asset Manager (Control Panel > Asset Manager) for usage count tracking
Related Documents
- UUT-UUR-STRUCTURE-REFERENCE.md - Complete UUT report structure
- INTEGRATION-GUIDE.md - Full C# API integration guide
Questions? Contact support@wats.com
Incrementing asset counts using the WATS Client MES API.
This section explain how to use the WATS Client .NET API's MES Interface to access and increment your asset counters. Please see the article Using the WATS .NET api as a NuGet package for instructions on how to access the API.
Initializing the MES Interface
The functions related to asset management is found in the MES Interface. The below example code shows how you can create and initialize the MES Interface, as well as increment your asset counters.
The MES Interface is accessed by creating an object of the class Virinco.WATS.Interface.MES.MesInterface. If the WATS Client is installed and running, no further initialization is necessary.
Incrementing your asset counters
You can use the MES Interface object's .Asset.IncrementAssetUsageCount()-function. The function takes three parameters:
serialNumber(string) - The serial number for your asset
usageCount(int) - The count to be added (Optional - default = 1)
incrSubAsset(bool) - If true, the sub assets will also be incremented. (Optional - default = false)
The function returns an .Asset.AssetResponse object. If the call succeeded, the AssetResposes .Ok parameter will be true.
Example Class - C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// WATS
using Virinco.WATS.Interface.MES.Asset;
namespace AssetManagement_ExampleCode
{
class MesIntegration
{
Virinco.WATS.Interface.MES.MesInterface mes;
public MesIntegration()
{
// Create the MesInterface object.
// No initialization is nessesary if the WATS Client is installed and running
mes = new Virinco.WATS.Interface.MES.MesInterface();
}
public void Test()
{
bool d_incr = IncrementAssetCounter("YourAssetSerialNumber");
bool c_incr = IncrementAssetCounter("YourAssetSerialNumber", 10, true);
}
// This functions will increase the counter by 1 and will not increment sub assets.
private bool IncrementAssetCounter(string assetSerial)
{
AssetResponse ar = mes.Asset.IncrementAssetUsageCount(assetSerial);
return ar.Ok;
}
// Use the optional parameters: int usageCount & incrementSubassets to increase by other number and/or to update sub assets.
private bool IncrementAssetCounter(string assetSerial, int usageCount, bool incrementSubAssets)
{
// This call succeded if the respons objects .Ok is true;
AssetResponse ar = mes.Asset.IncrementAssetUsageCount(assetSerial, usageCount, incrementSubAssets);
return ar.Ok;
}
}
}
Comments
0 comments
Please sign in to leave a comment.