Using the Test Suite Functions and Properties
Test Suite Properties
The following properties can be used in the imaqkit.AdaptorTest
functions.
Property | Description |
---|---|
AdaptorName | Name of the Image Acquisition Toolbox adaptor you are creating, as defined by the constructor. |
DeviceId | Device ID of the device you are testing with, as defined by the constructor. |
Format | Video format used for acquisition or camera file. |
DeviceName | Device name of the device you are testing with, as defined by the constructor. |
VendorDriverDescription | Device driver name. |
VendorDriverVersion | Device driver version. |
EstimatedAcquisitionFrameRate | Estimated frame rate. |
ConciseLog | Verbosity of log, with a default of In concise mode, only the following is shown in the log output:
With concise mode set to
|
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.
Function | Purpose |
---|---|
createTest | Create For an testObj = imaqkit.AdaptorTest.createTest (AdaptorName, DeviceId, Format, EstimatedAcquisitionFrameRate) returns
a test object to test a device with specified adaptor, ID and format.
See the example in the next
section for an example of using the |
runAllAutomatedTests | For automated testing, run all automated tests. This runs all test points. For an 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 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
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 testObj.runAutomatedROITest |
runAutomatedRepeated AcquisitionTest | For automated testing, run automated repeated acquisition test. This test does 25 acquisitions from the same device. For an
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 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
For an testObj.runAutomatedManualTriggerTest |
runAutomatedHardware TriggerTest | For automated testing, run automated trigger test for hardware
triggering. This test checks the For an 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 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
For an
testObj.runInteractiveMultipleDeviceAcquisition Test(testObj, deviceId1, deviceFormat1, deviceId2, deviceFormat2) |
methods | Get the list of tests that can be run. For an
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;