Upload
jerome-lawrence
View
223
Download
4
Embed Size (px)
Citation preview
WATS CLIENT API
Ragnar Engnes, VirincoMartin Lentz, Virinco
Client overview (Ragnar).NET Converter in C# (Ragnar)LabVIEW Toolkit (Martin)
Client overview
WATS User InterfaceWATS TDM InterfaceWATS MES Interface
WATS Client Service (Transfer Agent)Converters.xml
ConvertersTeststandStandard Text Format Custom
Drop Folders
WATS Server
TDM Interface
• Build UUT reports– Sequences– Measures (Numeric, String, PassFail...)– Charts– Attachments
• Submit• Query
TDM api Class model
.NET Converter• In Visual Studio, create new Class Library (assembly/.dll)• Reference the TDM api dll (Program Files\Virinco\WATS\Designsupport)• Write the converter class that implements IReportConverter:
– class MyConverter : IReportConverter– public Report ImportReport(TDM api, System.IO.Stream file)– < Read File and use api to create the report, eventually call Submit if file contains many reports>
• Complete example on:https://virinco.zendesk.com/entries/23872588-Create-custom-WATS-Client-converter
• Primary input is a file in any format– Delimited Text, XML, Binary– Can also fetch data from database, web-services etc. (.NET is the limit)
• Planned improvements: GUI for configuration, examples database
MES Interface
• Production (active units, batches)• Product (product / revision information)• Workflow (validate, checking, start test)• Software (Download software)
internal void SubmitToWATS() { try { if (_tdm.Status != Virinco.WATS.Interface.APIStatusType.Online) _tdm.InitializeAPI(true); if (unitinfo == null) { messageEvent("No person registered, scan barcode", MessageTypes.Error); return; } WorkflowResponse resp = _mesWorkflow.Validate(unitinfo.SerialNumber, unitinfo.PartNumber, ActivityMethod.StartTest, "Height Measure",null,wfUseStatus); if (!resp.ok || resp.InstanceStatus != WorkflowInstanceStatus.ActiveWorkflowExist) { messageEvent(String.Format("Workflow not ok: {0}\r\n{1}", resp.ErrorMessage, resp.Description),MessageTypes.Error); return ; } if (HeadPosition == 0) { messageEvent(String.Format("No measure obtained, try again"), MessageTypes.Error); return; } resp = _mesWorkflow.StartTest(unitinfo.SerialNumber, unitinfo.PartNumber, "Height Measure", null, false, false, wfUseStatus); messageEvent("Starting test: " + resp.Description, MessageTypes.Info); UUTReport uut = _tdm.CreateUUTReport("oper", unitinfo.PartNumber, unitinfo.Revision, unitinfo.SerialNumber, "80", "WATSUp2014", "1.1.1.1"); uut.AddMiscUUTInfo("Name", PersonName); uut.GetRootSequenceCall().AddNumericLimitStep("Height").AddTest(HeadPosition, Virinco.WATS.Interface.CompOperatorType.GELE, 150, 220, "cm"); _image.WritePngFile(@"c:\Tmp\Person.png"); using (FileStream fs = new FileStream(@"c:\Tmp\Person.png", FileMode.Open, FileAccess.Read)) { BinaryReader r = new BinaryReader(fs); byte[] buff = r.ReadBytes((int)fs.Length); uut.GetRootSequenceCall().AddGenericStep(GenericStepTypes.Action, "Picture").AttachByteArray("Image", buff, "image/png"); } _tdm.Submit(SubmitMethod.Automatic, uut); resp = _mesWorkflow.EndTest(unitinfo.SerialNumber, unitinfo.PartNumber, "Height Measure", ActivityTestResult.Passed, false, null,false,false,wfUseStatus); messageEvent("End test - height sent to WATS: " + resp.Description, MessageTypes.Info);
LabVIEW Toolkit
Download and install WATS Client
WATS
Plug into TestStand or LabVIEW in minutes