CSharp HowTo 4.x throw Engine Error after Advance Time

Hello:
I were trying to setup the CSharp HowTo csproject.
Build successful. And want to try HowTo_RunScenarios.cs
But I always got false for “pulse.ExecuteScenario(execOpts)” and output “Error running scenario” after “Advance Time” with “Final SimTime(s)”
There is no other information to tell me what the engine wrong, and how to resolve it.
I am guessing if there is something wrong for creating the result cvs data?
How can I resolve this?
I attached the screenshot.
I had reduce the AdvanceTime to 1 min. And removed most of DataRequest, only keep 1 data request. So that to keep the test simple

Thank you .

Are you building master or 4.x?

4.x is the latest, so I would work with that.

I follow the README.md. and clone from github.
git clone https://gitlab.kitware.com/physiology/engine
I think it is master.

There has been a good bit of scenario support added to C# for the next release
Can you check out 4.x and give that a try?

Thank you for your replied.
I switched to 4.x. And working well for HowTo_RunScenarios.cs and generated the cvs output file.
And I noticed the master is using protobuf 3.8.4 version. the 4.x branch uses protobuf 21.4. Maybe it is casuse by it to serialize to PulseC.dll confuse. Just for guessing.
And I met new issue for HowTo_EngineUse.css for 4.x version.
It throws “Engine was unable to process requrested actions” for SEHemorrhage.ExternalCompartment.RightLeg.
Anything I missed?

Thank you.

You are correct, the howto did have a problem.

I also replace references to pbb files with json files, as we are not auto generating pbb files in our build any longer. (We may generate those in the future, but json will always be generated, so examples should refer to those)

I also notices we were not logging/captureing the error given by ProcessAction on the C# side, so I fixed that as well, so you will see those in the cosole, and/or your LogHandler will now be given those messages

I was also missing the severity of the hemorrhage, so I set that

So this example now works!

Thanks for bringing that to our attention

If you find anything else, please let us know!

Note, I pushed all that to the head of 4.x

Thank you. works for head of 4.x.
I am learning engine and reading the csharp howto and cpp exploer codes.
There is SetAdvanceHandler in cpp engine., but couldn’t find it in CSharp engine API, Is it not implemented in CSharp interface version?
Thank you

No, I dont think that is in C#
The advance handler is there to run custom code after each time step, when you don’t have control of the time step. That was put in primarily to inject writing values to our csv file after each time step as a scenario execution loop runs and processes a scenario.

Generally, I think most applications control the advance loop in their integration, and are not running static scenarios via a static execution loop.

I believe the C# just pushes a scenario over to C++ to run it when you call ExecuteScenario
I am not sure exactly how we would get a callback from a static advance loop in C++ call C# code.
If your in C#, you should be able to implement an advance loop and inject a callback/forwarding mechanism in it.

I guess it just depends on what you are planning to do with Pulse and what your time advancement logic needs to support. I can point you directions/combinations of classes