Save Data using "to File" on command

조회 수: 2 (최근 30일)
Simon Schirk
Simon Schirk 2023년 12월 14일
답변: Divyanshu 2023년 12월 21일
Is there a way to save the data i provide to the "to File" block on a command?
I don't want to use continious logging or some time intervall, but a signal I crate as the indicator when to save.
  댓글 수: 2
Andreas Goser
Andreas Goser 2023년 12월 14일
Would that "command" an interaction by the user or an event like a signal value exceedinf a threshold?
Simon Schirk
Simon Schirk 2023년 12월 15일
The trigger event is a signal value. The "ping" is send every 10 cm driven by the Robot.

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

답변 (1개)

Divyanshu
Divyanshu 2023년 12월 21일
Hi Simon,
I understand that you want to save the data provided as input to "To File" block, only when the ping signal is recieved from the Robot you are working with.
A possible way to achieve this is to make use of 'Triggered Subsystem'.
Following are the components I used for my sample model to achieve similar objective:
  • Firstly created a 'Triggered Subsystem' and inside the subsytem placed the 'To File' block.
  • The above subsytem takes the data as an input, which is to be provided to the 'To File' block.
  • I have used a pulse generator whose rising edge acts as a trigger for the subsystem.
  • Finally when rising edge comes in pulse generator the subsystem is triggered and input data is logged into the block.
You can go through above points and can make modifications based on your use-case.
Please refer the following documentation for further details about 'Triggered Subsystem':

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by