I have a Variant Subsystem. The variant control mode is Label. I'd like to have a popup mask parameter named LabelToActivate to set the active variant choice because my users know how to interact with a mask dialog box and don't know how to use variants (i.e. right-clicking the variant badge or right-clicking the block and navigating to Variant > Label Mode Active Choice).
The code I would put in MaskInitialization is straight-forward. This would run whenever the user applies mask changes.
set_param(gcb, 'LabelModeActiveChoice', LabelToActivate)
However, I don't want to hard-code the TypeOptions of the popup. When the block's LoadFcn callback executes, I want to get all of the labels and set the TypeOptions property of the mask parameter LabelToActivate. I thought there would be a block parameter like VariantControlLabels that I could read. The code in LoadFcn would look something like this...
labels = get_param(gcb, 'VariantControlLabels');
m = Simulink.Mask.get(gcb);
p = m.getParameter('LabelToActivate');
Sadly, VariantControlLabels doesn't exist. I can't seem to find any property that stores all of the labels as a cell array of character vectors. Somehow the 'Variant choices' table in the Block Parameters dialog shows the labels in the 2nd column so where are those strings stored?