![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
10/12/2022
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hi all,
currently I am trying to set the EnumDictionaryEntries property value of a MultiStateDictionaryEntryDiscreteBaseType variable.
In the corresponding model compiler information model XML the properties' ValueRank is defined as "OneOrMoreDimensions", but in the generated C# code this is mapped to a PropertyState<NodeId> type. How can I set a (multidimensional) array value on this property?
E.g.:
var multiStateDictionaryEntryDiscreteState = new Opc.Ua.MultiStateDictionaryEntryDiscreteState<uint>(null);
multiStateDictionaryEntryDiscreteState.EnumDictionaryEntries = new PropertyState<NodeId>(multiStateDictionaryEntryDiscreteState);
multiStateDictionaryEntryDiscreteState.EnumDictionaryEntries.Value = new NodeId(); // how to assign (multidimensional) array ?
Any hint is greatly appreciated!
Kind regards,
Jonas
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/admindefault.png)
05/30/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
The ModelCompiler has been fixed. It will take a few days to push to the public repo.
You can apply the changes to this function in ModelGenerator2.cs
private string GetClassName(InstanceDesign instance)
Add this to the bottom of the function:
if (variable.ValueRank == ValueRank.OneOrMoreDimensions)
{
scalarName = "Variant";
}return String.Format("{0}State<{1}>", FixClassName(variableType), scalarName);
The updated auto generated files are in this pull request:
1 Guest(s)