MetaData variables in Python XMC scripts

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
Hello all,

how is the correct value assignement for variables in the META section of an python script?

TCL scripts show's like these:


# @ScriptDescription "Copy config while onboarding"
# @SectionStart    (description = "Select configuration" )
#
# @VariableFieldLabel (description = "ConfigName"
#      type        = String
#     scope       = device
#    )
set var ConfigName  ""
# @SectionEnd

How do you have to replace set var ConfigName  "" in python?
If I try ConfigName = "" the Device Settings section is empty if I run the script.

So what is the correct syntax?

Best regards
Stephan
Photo of SH

SH

  • 4,234 Points 4k badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of SH

SH

  • 4,234 Points 4k badge 2x thumb
Hello,

here is the working solution for my problem for the sake of completeness:


# @VariableFieldLabel (description = "ConfigName",
# type = String,
# scope = global
# )
set var ConfigName

#To use the variable
configfile = emc_vars["ConfigName"]



Best regards
Stephan