Add Variables with C# to Zenon (Editor-Mode)

Add Variables with C# to Zenon (Editor-Mode)

Hi,
I am searching for a solution to add variables with C# to an open Project in the Zenon Editor.
I am currently using the following code...
C# Code:
this.zVariable = this.zProject.Variables()
.CreateVar(psVariableName, null, tpKanaltypes.tpSystemVariable, GetDataType("STRING"));

But I cannot see the created Variable in the Zenon Editor?!
What's wrong?
Regards...

This is a migrated post! Originally posted on 09.03.2015 by user nollh. Please be aware that information can be outdated.