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

4 vues (au cours des 30 derniers jours)
Sajal Agarwal
Sajal Agarwal le 20 Mai 2016
Commenté : Sajal Agarwal le 23 Mai 2016
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 commentaire
Sajal Agarwal
Sajal Agarwal le 23 Mai 2016
Thanks for the views guys... I have got the solution. Syntax:
tmp_SF_Value = tmp_SFData.Props.InitialValue;

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Stateflow dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by