i want to create Enumeration (data Unit Type) by using Script method "create_dut()". In online help written:
Zitat:
create_dut(name, type, baseType)
Creates a DUT with the specified name and type.
Parameter: name (str)
The name.
Parameter: type (DutType)
The type. Optional, the default is a structure.
Parameter: baseType (str)
The base type. This optional parameter is necessary for for Alias types, optional for STRUCTs and enums, and currently not allowed for unions.
Returns: (IScriptObject)
The IScriptObject of the newly created POU.
But I don't know, how to name the DutType in script. as written in help Int or str. can not be accept.
Thanks for any replay!
BR.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
after long time search and probe. It works at the end.
Here just a exsample for someone, who this use-case also interested. The complete command shall be :
myDUT=Application.create_dut("STATE", DutType.Enumeration)Â Â Â # adddeclarationoftheENUM
    # hereparameter"DutType"canbe DutType.Structure(default), DutType.Enumeration , DutType.Alias, DutType.Union .
implementation=myDUT.textual_declaration.replace("""TYPE STATE :(
  Examples_INT :=0,   (**)
  SEND,    (*Sendmessages*)
  READ,    (*Receivemessages*)
  ERROR    (*errorsingle*));END_TYPE""")Â
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i want to create Enumeration (data Unit Type) by using Script method "create_dut()". In online help written:
But I don't know, how to name the DutType in script. as written in help Int or str. can not be accept.
Thanks for any replay!
BR.
after long time search and probe. It works at the end.
Here just a exsample for someone, who this use-case also interested. The complete command shall be :