Triggeractivation error in image acquisition toolbox

5 ビュー (過去 30 日間)
HYZ
HYZ 2023 年 3 月 3 日
回答済み: Sachin 2023 年 3 月 16 日
Hi, I tried to record a video using Image acquisition toolbox.
src.TriggerActivation threw an error as below:
Attempt to modify currently read-only or inaccessible property: TriggerActivation.
Use IMAQHELP(OBJ, 'TriggerActivation') for information.
Could anyone suggest? Thanks.
vobj = videoinput("gentl", 1, "Mono8");
src = getselectedsource(vidobj);
vobj.LoggingMode='disk';
src.AcquisitionFrameCount = 200;
src.AcquisitionFrameRateEnable = "True";
src.AcquisitionFrameRate = 50;
src.ExposureAuto = "Off";
src.TriggerMode = "On";
src.TriggerSelector = "AcquisitionStart";
src.TriggerSource = "Software";
src.TriggerActivation = 'RisingEdge';
src.ExposureTime = 15000;
diskLogger = VideoWriter('C:\Users\user\Desktop\cameratest\test.avi', 'Grayscale AVI');
diskLogger.FrameRate = 50;
vobj.DiskLogger = diskLogger;
start(vidobj)
stop(vidobj)
  2 件のコメント
HYZ
HYZ 2023 年 3 月 3 日
I tried the suggested solution from the question. It does not solve the error I have.

サインインしてコメントする。

回答 (1 件)

Sachin
Sachin 2023 年 3 月 16 日
Hi @HYZ,
I understand that you are getting error 'Attempt to modify currently read-only or inaccessible property: TriggerActivation' .
Some properties are only read-only in ‘videoinput’ object i.e. you cannot update those properties.
e.g. ‘Videoformat’ property is a read-only property and it is set by the ‘videoinput.’
Try this command after creating ‘videoinput’ object ‘vobj’ which will give you more information about the ‘triggeractivation’ property
imaqhelp(vobj,'Triggeractivation')
You can refer to the following page for more information about ‘videoinput’ and read-only properties.
Thanks
Sachin

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by