필터 지우기
필터 지우기

How to make an app which starts recording in channel number two when the particular level trigger is crossed in channel number one?

조회 수: 2 (최근 30일)
I saw an AnalogTriggerApp in matlab app which records the signal from a channel when certain trigger level is reached in the same channel. It also records some pre-trigger data. I want to make some change such that data from one channel starts recording when the trigger level is crossed in other channel.

채택된 답변

Ravi
Ravi 2024년 1월 23일
Hi Ramdev Rajeshbhai Gohil,
The objective is to record signals on one channel if the trigger level crosses threshold on another channel. That is possible in AnalogTriggerApp. To do that open the AnalogTriggerApp and switch to the code view of the app to know about few insights. In case you have not modified the source code, then you can refer to the line numbers as well.
  1. The signals data is read into a variable “data” inside the function “scansAvailable_Callback”. (Line 112). “data” is a matrix that contains signal levels and channels.
  2. The plot is populated with the data from “app.DataFIFOBuffer” variable returned by the function “storeDataInFIFO”. The last parameter of the function is “data(:, 1)” which means the signal values of the first channel are passed. (Line 116)
  3. In the function, “detectTrigger”, the trigConfig.Channel property is set to 1. This property is used in checking the trigger condition. The signal values in the first channel are used in checking the trigger condition. (Line 587)
In a nutshell, so far, trigger condition is checked against the channel 1, and data that is plotted also belongs to the first channel.
If you want to record data in channel 1, by checking a trigger against the channel 2, then you can do the following, set the trigConfig.Channel property to 2. This way you can check for trigger condition on one channel, and record signals on another channel.
I hope this answers your question.
  댓글 수: 1
Ramdev Rajeshbhai Gohil
Ramdev Rajeshbhai Gohil 2024년 2월 6일
Thank you so much Ravi for your help. I am looking into it. I will have to modify the default app to run two channels and then use what you suggested. Thank a lot again for your effort. I will get back if I run into some errors again :)
Good Day!
~Ramdev.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by