110 likes | 382 Views
WATS CLIENT API. Ragnar Engnes, Virinco Martin Lentz, Virinco. Client overview (Ragnar) .NET Converter in C# (Ragnar) LabVIEW Toolkit (Martin). Client overview. WATS User I nterface WATS TDM Interface WATS MES Interface. WATS Server. WATS Client Service (Transfer Agent)
E N D
WATS CLIENT API Ragnar Engnes, Virinco Martin Lentz, Virinco
Client overview(Ragnar) .NET Converter in C# (Ragnar) LabVIEW Toolkit (Martin)
Clientoverview WATS User Interface WATS TDM Interface WATS MES Interface WATS Server WATS Client Service (Transfer Agent) Converters.xml Converters Teststand Standard Text Format Custom Drop Folders
TDM Interface • Build UUTreports • Sequences • Measures (Numeric, String, PassFail...) • Charts • Attachments • Submit • Query
.NET Converter • In Visual Studio, create new Class Library (assembly/.dll) • Reference the TDM apidll (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)
internalvoidSubmitToWATS() { try { if (_tdm.Status != Virinco.WATS.Interface.APIStatusType.Online) _tdm.InitializeAPI(true); if (unitinfo == null) { messageEvent("No person registered, scan barcode", MessageTypes.Error); return; } WorkflowResponseresp = _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); UUTReportuut = _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 = newFileStream(@"c:\Tmp\Person.png", FileMode.Open, FileAccess.Read)) { BinaryReader r = newBinaryReader(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);
Download and install WATS Client WATS Plug into TestStand or LabVIEW in minutes