'Add a new data element.
Arguments:
typename   -- The type of data element (numeric, string, boolean, dateTime, timeSpan or enum)
value      -- The value of the data element
module     -- [optional] language module to use for the data element
stringIds  -- [optional] The stringIds used to find associated text in the language module
unit       -- [optional] The unit. Only applicable for type numeric
dataType   -- [optional] The dataType. Only applicable for type enum'

def add_data(self, typename, name, value, module=None, stringIds=None, unit=None, dataType=None, flags=None):

    if (name not in self._datas):
        dataObj = None
        if (typename == 'numeric'):
            dataObj = DataNumeric(parent=self)
            dataObj['unit'] = unit
        elif (typename == 'string'):
            dataObj = DataString(parent=self)
        elif (typename == 'boolean'):
            dataObj = DataBoolean(parent=self)
        elif (typename == 'dateTime'):
            dataObj = DataDateTime(parent=self)
        elif (typename == 'timeSpan'):
            dataObj = DataTimeSpan(parent=self)
        elif (typename == 'enum'):
            dataObj = DataEnum(parent=self)
            dataObj['dataType'] = dataType
        dataObj['name'] = name
        dataObj['value'] = value
        dataObj['module'] = module
        dataObj['stringIds'] = stringIds
        if (flags is not None):
            dataObj._set_flags(flags)
        self._datas.add(name)
        self.iterables.append(dataObj)
        return dataObj
    return None
