read variable from runtime

read variable from runtime

Hi,
i am a beginner with zenon and have Problems with reading a variable from the runtime.
public void Macro1
{
int x=0;
zenOn.IVariable yVar = this.Variables().Item("testvar1_2");

x = (int)yVar.get_Value(0); <------does not work , x is always 0

.....

}
but it does not work. The x Value is always 0

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