internal class Program
{
private static async Task Main(string[] args)
{
const string port = "COM7";
var region = DataDisplayInfos.RegionInfoList.Get("EU_Installations").ToRegion();
var passFailEmpty = DataDisplayInfos.MeasurementInspectionDataTypeInfoList.Get("Pass_Fail_Empty");
// create new custom inspection
var inspection = new EmptyCustomInspection(passFailEmpty, region)
{
Name = "Inspection 1",
Children =
{
new EmptyCustomInspection(passFailEmpty, region) {Name = "Inspection child 1"},
new EmptyCustomInspection(passFailEmpty, region) {Name = "Inspection child 2"}
}
};
// create workspace
var workspace = new Workspace("Workspace with custom inspection", region);
var root = new EmptyStructureObject("ROOT", region);
root.Tests.Add(inspection);
workspace.StructureObjects.Add(root);
// upload to instrument
using (var instrument = Channel.Serial.Open(port))
{
await instrument.UploadWorkspace(workspace);
}
}
}
C#