krisj - 2025-03-17

Hey!
I am trying to generate a function block with properties from a list with script engine.
Codesys/ScriptEngine creates both the Get and the Set accessor.
I cannot find a way to delete the Set method/accessor.
Anyone encountered the same problem or have a solution for this?

for prop_name, prop_type in list:
    property = pou.create_property(prop_name, prop_type)

    get = pou.find("Get", recursive=True)[i]
    get.textual_declaration.replace("")
    get.textual_implementation.replace(prop_name + " := " + struct_name + "." + prop_name + ";")

    set = pou.find("Set", recursive=True)[i]
    set.textual_declaration.replace("")
    set.textual_implementation.replace("")

    i += 1
 

Last edit: krisj 2025-03-17