0

When using StartDebugServer it is possible to enable remote debugging of your application like shown here.

HaEngine = new HDevEngine();
HaEngine.StartDebugServer();

When using an exported library it gives you a wrapper .cs file that does not use a global HDevEngine like in the examples, but only this reference to the HDevEngine:

private static void AddResourcePathToProcedurePath() 
{
  lock(_procedure_path_lock)
  {
    if(!_procedure_path_initialized)
    {
      new HDevEngine().AddProcedurePath(ResourcePath);
      _procedure_path_initialized = true;
    }
  }
}

I know there is a HDevEngine initialized here but have no idea how to add StartDebugServer.

How to remotely debug the generated wrapper program generated by Halcon?

albert
  • 8,285
  • 3
  • 19
  • 32
Malinko
  • 124
  • 11

1 Answers1

0

I haven't figured out how to do it with an exported library, but I did get it to work with exported procedure files (.hdvp).

Put procedure files in bin folder.

using HalconDotNet;
HDevEngine eng = new HDevEngine();
eng.SetProcedurePath("./");
eng.StartDebugServer();
string procedureName = "testProcedure_long";
var procedure = new HDevProcedure(procedureName);
var procedureCall = new HDevProcedureCall(procedure);
procedureCall.Execute();

Then:

@ Halcon IDE -> Execute -> Attach to process -> Default values -> Go

Malinko
  • 124
  • 11