How can i get the Initial Value of an Output signal in a StateFlow ?

조회 수: 3 (최근 30일)
Sajal Agarwal
Sajal Agarwal 2016년 5월 20일
댓글: Sajal Agarwal 2016년 5월 23일
I want to read the initial value of an output signal in a Stateflow and store it in a variable. I am able to access the object of Data of a Stateflow in the following manner:
SF: is the path of the Stateflow
tmp_SFObj = get_param(SF,'Object')
tmp_ChartObj = tmp_SFObj{1}.find('-isa','Stateflow.Chart')
tmp_SFData = tmp_ChartObj.find('-isa','Stateflow.Data')
But problem arising is that the object 'tmp_SFData' does not have 'Initial Value' as its dataobject variable. How can i get Initial Value of the Output in a variable ??
I am getting following object parameters for an Output signal (No option for Initial Value):
K>> tmp_SFData(1)
ans =
Path: 'xyz'
Id: 690
Machine: [1x1 Stateflow.Machine]
SSIdNumber: 117
Name: 'abc'
Description: ''
SaveToWorkspace: 0
TestPoint: 0
OutputState: []
DataType: 'uint8'
Props: [1x1 Stateflow.DataProps]
ParsedInfo: [1x1 Stateflow.DataParsedInfo]
CompiledSize: ''
CompiledType: 'unknown'
Debug: [1x1 Stateflow.DataDebug]
Tag: []
Document: ''
Scope: 'Output'
Port: 1
InitializeMethod: 'Expression'
UpdateMethod: 'Discrete'
MessageMode: 'NotMessage'
LoggingInfo: [1x1 Stateflow.SigLoggingInfo]
  댓글 수: 1
Sajal Agarwal
Sajal Agarwal 2016년 5월 23일
Thanks for the views guys... I have got the solution. Syntax:
tmp_SF_Value = tmp_SFData.Props.InitialValue;

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by