Returns the OPC UA Variant type corresponding to the given type name. This function is used for getting the correct Variant type when writing
values to the OPC UA server. This can be ignored if opcua.ua.uatypes.VariantType
is used for writing values.
name
(str): The name of the OPC UA data type.
Possible names:
bool, boolean, byte, int, int16, int32, int64, float, real, double, string, datetime, bytestring, guid, variant, datavalueua.VariantType
: The OPC UA Variant type corresponding to the given type name.
ValueError
: If the provided type name is not recognized.
from OPC_Connector.Helpers import get_variant_type
# Get the Variant type for 'int32'
variant_type = get_variant_type('int32')
print(variant_type) # Output: ua.VariantType.Int32