MATLAB: How to query the enumeration name for a Test Sequence block’s active step output

activeenumnamesequencesimulink teststeptest

I am using Simulink Test's programmatic interface to author test sequences (<https://www.mathworks.com/help/sltest/automation.html>). I have found that I am able to get the active step output through the Test Sequence block's properties 'EnableActiveStepData' and 'ActiveStepDataSymbol' using sltest.testsequence.getproperty.
How can I check the enumeration name for the active step programmatically?

Best Answer

It is possible to get/set the ActiveStepEnumName from one of the properties of the ActiveStepDataSymbol.
For example, to read it's value:
p = sltest.testsequence.getProperty('model/Test Sequence');
s = sltest.testsequence.readSymbol('model/Test Sequence', p.ActiveStepDataSymbol);
enum_name = s.ActiveStepEnumName
To set it's value:
p = sltest.testsequence.getProperty('model/Test Sequence');
sltest.testsequence.editSymbol('model/Test Sequence', p.ActiveStepDataSymbol, 'ActiveStepEnumName', 'NewEnumName')