Returns the value container object for the Grade collection.
Namespace: Cognex.VisionPro.InspectionAssembly: Cognex.VisionPro.Inspection (in Cognex.VisionPro.Inspection.dll) Version: 75.1.0.0 (75.1.0.0)
Syntax
Property Value
Type: CogVerificationValueContainer StringExamples
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub SetGrade()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)
' The grade which will be added
Dim grade As String = "Good"
' Step one: add this grade to the metadata
' WARNING: If the metadata already contains this grade an exception will be thrown.
mInputDatabase.AddGrade(grade)
' Step two: set the record's grade
mCurrentRecord.Params.ExpectedOutputs.Grade.Value = grade
' Update the record in the database
mInputDatabase.Replace(mCurrentRecord)
mInputDatabase.Disconnect()
End Subusing Cognex.VisionPro; using Cognex.VisionPro.Database; using Cognex.VisionPro.Inspection; private SetGrade() { CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase")); mInputDatabase.Connect(); CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0); // The grade which will be added string grade = "Good"; // Step one: add this grade to the metadata // WARNING: If the metadata already contains this grade an exception will be thrown. mInputDatabase.AddGrade(grade); // Step two: set the record's grade mCurrentRecord.Params.ExpectedOutputs.Grade.Value = grade; // Update the record in the database mInputDatabase.Replace(mCurrentRecord); mInputDatabase.Disconnect(); }
See Also