This sample shows how to create a interna variable in the zenon Workspace (WorkspaceAddIn)

try
{
    Var = m Zenon.MyWorkspace.ActiveDocument.Variables().
    CreateVar((string )VarNameList [ i ] , VarInfo.zDriver ,
    VarInfo.kType , VarInfo.vType ) ;

    Var.Tagname = ( string ) VarDescList[i] ;
}
catch ( Exception )
{
    MessageBox.Show( " zenon variable could not be created " ) ;
    throw;
}