get pml variable value in c#

I am not able to get the result of command executed by c#, refer below code tries with .Result and also with the GetPMLVariableString(). please help me

Command labelSpreadCmd = Aveva.Core.Utilities.CommandLine.Command.CreateCommand("!eq = STRING() !eq Q FIND " + elementName + " IN " + sheetName);
labelSpreadCmd.RunInPdms();
Command getCommand = Command.CreateCommand("");
getCommand.RunInPdms();
string res = getCommand.GetPMLVariableString("!eq");

Parents
  • try make it global variable 

    Aveva.Core.Utilities.CommandLine.Command commandLineRun;
    string commandString = string.Empty;
    commandString = "VAR !!REMMODE MODE";
    commandLineRun = Aveva.Core.Utilities.CommandLine.Command.CreateCommand(commandString);
    commandLineRun.RunInPdms();
    string Mode = commandLineRun.GetPMLVariableString("REMMODE");


Reply
  • try make it global variable 

    Aveva.Core.Utilities.CommandLine.Command commandLineRun;
    string commandString = string.Empty;
    commandString = "VAR !!REMMODE MODE";
    commandLineRun = Aveva.Core.Utilities.CommandLine.Command.CreateCommand(commandString);
    commandLineRun.RunInPdms();
    string Mode = commandLineRun.GetPMLVariableString("REMMODE");


Children
No Data