Cancel
Showing results for 
Search instead for 
Did you mean: 

How to show PlantSimulation bugs on C# COM Interface

Experimenter
Experimenter

I'm currently running a PlantSimulation model from a C# code I wrote, using the COM Interface.

 

When an unexpected SimTalk error happens, PlantSimulation shows a pop-up asking if I wish to stop the simulation. Is there anyway to disable this pop-up and make it send a message to my COM Interface instead?

4 REPLIES

Re: How to show PlantSimulation bugs on C# COM Interface

Legend
Legend

Haven't tested it myself, but maybe adding an ErrorHandler to your model will work?

Re: How to show PlantSimulation bugs on C# COM Interface

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello Gabriel,

You can use the method SetNoMessageBox of the COM interface to turn off message boxes.

 

Then, as verbalins suggested use an error handler in Plant Simulation to catch errors. You can then communicate back the message using the SimTalk function fireSimTalk Message.

 

This message can be received in your C# program by implementing an event handler. You will receive the message by a call to the method SimTalkMessage of the event handler.

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: How to show PlantSimulation bugs on C# COM Interface

Experimenter
Experimenter
Thanks for the quick answer! I think this will work.

I'm running PlantSimulation 13.1 and there is no method SetNoMessageBox of the COM interface. Is this something new?

Re: How to show PlantSimulation bugs on C# COM Interface

Siemens Phenom Siemens Phenom
Siemens Phenom

It's not documented yet, but you should be able to use it anyway. It's expecting a boolean parameter. Pass true to turn off message boxes.

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.