Main Content

Using the Test Suite Functions and Properties

Test Suite Properties

The following properties can be used in the imaqkit.AdaptorTest functions.

PropertyDescription
AdaptorNameName of the Image Acquisition Toolbox adaptor you are creating, as defined by the constructor.
DeviceIdDevice ID of the device you are testing with, as defined by the constructor.
FormatVideo format used for acquisition or camera file.
DeviceNameDevice name of the device you are testing with, as defined by the constructor.
VendorDriverDescriptionDevice driver name.
VendorDriverVersionDevice driver version.
EstimatedAcquisitionFrameRateEstimated frame rate.
ConciseLog

Verbosity of log, with a default of false. Set to true if you want a concise log output.

In concise mode, only the following is shown in the log output:

  • current test name

  • test results

With concise mode set to false (the default), the following is shown in the log output:

  • current test name

  • current test details/information

  • any applicable information on how to interpret the results

  • test condition under test

  • test results

Test Suite Functions

You can use these functions with the imaqkit.AdaptorTest class.

The imaqkit.AdaptorTest class is used to create an Image Acquisition Toolbox Adaptor Test object and to test Image Acquisition Toolbox connectivity with cameras/framegrabbers. This class is not instantiated directly. Call imaqkit.AdaptorTest.createTest to instantiate.

FunctionPurpose
createTest

Create imaqkit.AdaptorTest object.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj = imaqkit.AdaptorTest.createTest
   (AdaptorName, DeviceId, Format, 
   EstimatedAcquisitionFrameRate)

returns a test object to test a device with specified adaptor, ID and format. AdaptorName is the name of the adaptor to use to communicate with the device, e.g. winvideo, gige, etc. DeviceId is the numeric ID of the device, and is often 1. Format is the video format to acquire images in. To see more about DeviceId and available formats, use imaqhwinfo.

See the example in the next section for an example of using the createTest function.

runAllAutomatedTests

For automated testing, run all automated tests. This runs all test points.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAllAutomatedTests
runAutomatedObjectCreation
   AndPreviewTest

For automated testing, run automated object creation and preview test. This test creates an object with the specified parameters and then previews it. It also checks that the preview can be stopped and then closed.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedObjectCreationAndPreviewTest
runAutomatedBasic
   AcquisitionTest

For automated testing, run automated acquisition test. This test acquires and montages 10 frames. It also checks that continuous image acquisition can be stopped.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedBasicAcquisitionTest
runAutomatedROITest

For automated testing, run automated region of interest test. The test sweeps the ROI during preview. It divides the frame into four sections and previews each section separately. This test checks setting the Region of Interest to a value different from the default value and then acquiring data. It also checks setting ROI values using X and Y offsets.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedROITest
runAutomatedRepeated
   AcquisitionTest

For automated testing, run automated repeated acquisition test. This test does 25 acquisitions from the same device.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedRepeatedAcquisitionTest
runAutomatedImmediate
   TriggerTest

For automated testing, run automated trigger test for immediate triggering. This test checks acquiring images in Immediate trigger mode. It checks the number of acquired frames for acquisition with immediate trigger.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedImmediateTriggerTest
runAutomatedManualTrigger
   Test

For automated testing, run automated trigger test for manual triggering. This test checks acquiring images in Manual trigger mode. It checks that frames are not acquired when the imaqkit.AdaptorTest object is waiting for a trigger, as well as number of acquired frames (once triggered).

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedManualTriggerTest
runAutomatedHardware
   TriggerTest

For automated testing, run automated trigger test for hardware triggering. This test checks the imaqkit.AdaptorTest object in hardware trigger mode. It checks that frames are not acquired when the object is waiting for a trigger. To test triggering using hardware trigger, refer to Image Acquisition Toolbox documentation.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runAutomatedHardwareTriggerTest
runInteractiveDevice
   PropertiesTest

For interactive testing, run interactive device properties test. This tests device-specific property values in the Property Inspector. This test checks device properties interactively. by opening a preview window and the property inspector. You can modify the properties from the property inspector and observe the changes in the preview window.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runInteractiveDevicePropertiesTest
runInteractiveMultiple
   DeviceAcquisitionTest

For interactive testing, run interactive multiple device acquisition test. This test checks simultaneous acquisition from two devices. Before running this test, at least two devices should be connected and their Device ID and Format information obtained using imaqhwinfo.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

testObj.runInteractiveMultipleDeviceAcquisition
   Test(testObj, deviceId1, deviceFormat1, 
   deviceId2, deviceFormat2)
methods

Get the list of tests that can be run.

For an imaqkit.AdaptorTest object called testObj, use this syntax:

methods(testObj)

Test Suite Example

This example shows the basic workflow of creating and running a test using some of the functions outlined in the previous section.

Get installed hardware information recognizable using the winvideo adaptor.

info = imaqhwinfo('winvideo');

Identify the Device IDs.

info.DeviceIDs

Get information about available formats for the camera under test identified in the last step. If it is the first camera, use DeviceId of 1.

info.DeviceInfo(1).SupportedFormats

Choose a format, for example MJPG_800x600, and create the test object, with an estimated frame rate of 15.

testObj = imaqkit.AdaptorTest.createTest('winvideo', 1, 'MJPG_800x600', 15);

By default, tests create verbose logs. To run tests with concise logs set the ConciseLog property to true and then run tests.

testObj.ConciseLog = true;

To run individual tests, call specific test functions, such as:

testObj.runObjectCreationAndPreviewTest;
testObj.runInteractiveDevicePropertiesTest;

Run all automated tests.

testObj.runAllAutomatedTests;