Invoking a PML command in C# code

Hi,

I am currently trying to extract Dabacon data from an AVEVA project with a C# program, using the AVEVA .NET API. 

Everything works well until I try to use a PML command to filter the elements I want to collect.

I tried to use the DbExpression object to parse a PML command in the C# code : 

bool expressionResult = DbExpression.Parse("SEQ GT 5", out DbExpression ExpResult, out PdmsMessage Experror);

This simple PML expression should work great, but when I launch de debug, the following message appear on the console  : 

Dummy sp/SPSYN2 called
(47,62) CP: Incomplete command line

And expressionResult returns false, meaning that the expression is not valid.

 I have the exact same problem when I try to create a collection using DbCollection object.

I have also tried to run a PML command using the Command.CreateCommand() and get the same message.

I have tried with many different PML expressions, still the same issue.

It seems that everything is OK in terms of project connection and MDB, as I succeed in collecting db elements. 

Am I missing something ? Maybe there is a specific tool to load beforerhand so that C# can recognize PML commands ?

Thanks in advance for your precious help.

Brice

Parents
  • Never faced Dummy sp/SPSYN2 before and I cannot offer much help, except verify that calling Aveva.Core.Utilities.CommandLine.Command.CreateCommand from a standlone application is possible so it must be something you are missing.

    Start of Standalone following steps (and the .exe in E3D root directory)
    E3DStandAlone.Standalone.Start((int)module)
    E3DStandAlone.Standalone.Open(project, user, password, mdb, out pdmsMessage
    Command.CreateCommand(..




  • Hi Henrik,

    Thanks for your reply.

    I have finally found the cause of the problem.

    To start the Standalone, I was using "StartUpCore.StartCoreStandalone(...)" instead of "Standalone.Start(...)".

    This command works too, but in that case I needed to add the following line:

    Initialise.E3DAppInit(...) which, in my opinion, must load modules neeeded to parse PML expressions in a C# program.

    Once this line added, I am able to create PML expressions and collections, as well as execute PML commands.

    Thanks again for your help!

Reply
  • Hi Henrik,

    Thanks for your reply.

    I have finally found the cause of the problem.

    To start the Standalone, I was using "StartUpCore.StartCoreStandalone(...)" instead of "Standalone.Start(...)".

    This command works too, but in that case I needed to add the following line:

    Initialise.E3DAppInit(...) which, in my opinion, must load modules neeeded to parse PML expressions in a C# program.

    Once this line added, I am able to create PML expressions and collections, as well as execute PML commands.

    Thanks again for your help!

Children
No Data