MetaData variables in Python XMC scripts


Userlevel 5
  • Contributor
  • 266 replies
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

1 reply

Userlevel 5
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

Reply