I want create an C# WPF SDK application that controler a Gocator camera.
When I connect my SDK application C# with the GOCATOR, I have no problem. But if I try to connect the same application with the GOCATOR ACCELERATOR the application returns the -999 Undefined Error.
My GOCATOR IP is XXX.XXX.0.5, and the IP of Accelerator is XXX.XXX.0.145. I used this last to connect the SDK with the gocator (in accelerator mode). I have also tried it with the first one, but the result is the same. I have also used all comunication protocols with no positive results.
I have taken my code from the examples.
public static void Accelerated () {
try {
KApiLib.Construct();
GoSdkLib.Construct();
Variables.System = new GoSystem();
Variables.Accelerator = new GoAccelerator();
Variables.IpAddress = KIpAddress.Parse(Constants.SENSOR_IP);
Variables.DataSet = new GoDataSet();
Variables.Accelerator.WebPort = Constants.WEB_PORT;
Variables.Accelerator.Start();
Variables.Sensor = Variables.System.FindSensorByIpAddress(Variables.IpAddress);
Variables.Accelerator.Attach(Variables.Sensor);
Variables.Sensor.Connect();
Console.WriteLine("Camera connected with ACCELERATOR.");
Variables.System.EnableData(true);
Variables.System.Start();
// Refer to <<SetupMeasurement.cs>> for setting up of the measurement tools.
Variables.DataSet = Variables.System.ReceiveData(30_000_000);
}
catch (Exception e) {
Exception(e);
}
}
This code returns the error:
ERROR:
A problem has ocurred while attempting to establish a connection with the Gocator camera.
Error code: Lmi3d.Zen.KException: A Zen API error occurred (Error Not Found, -999).
en Lmi3d.Zen.Utils.Internal.KInternalUtils.Check(Int32 status)
en Lmi3d.GoSdk.GoSystem.FindSensorByIpAddress(KIpAddress address)
en Continental.Gocator.Accelerated() en D:\Projectes\4795_Continental\Programes\Continental\Continental\Gocator.cs:línea 73
Error message: A Zen API error occurred (Error Not Found, -999).
Any idea?
Thanks!
after communicating with the gocator manufacturer and several trials and errors, I found a solution.
In my ignorance, I commited some mistakes:
If we use the SDK, the Gocator Accelerator must be are in stopped mode
Is not possible that more than one accelerator are in runinng. If i use the specific program for this, I souldn't use the SDK accelerator mode, and vice versa. The error code was very specific about this question, snif.
The manufacturer wasn'tspecific about this:
- In the SDK use IP address 127.0.0.1 i.s.o XXX.XXX.0.145
- Go to Gocator Accelerator. Stop acceleration. In the IP address field choose "Any" i.s.o. XXX.XXX.0.145. Then Start acceleration again and try to connect with SDK using 127.0.0.1 again.
My code was disorganized in some cases, the code updated is:
try {
KApiLib.Construct();
GoSdkLib.Construct();
Variables.System = new GoSystem();
Variables.Accelerator = new GoAccelerator();
Variables.IpAddress = KIpAddress.Parse(Constants.SENSOR_IP);
Variables.DataSet = new GoDataSet();
Variables.Accelerator.WebPort = Constants.WEB_PORT;
Variables.Accelerator.Start();
Variables.Sensor = Variables.System.FindSensorById(Constants.ID);
Variables.Accelerator.Attach(Variables.Sensor);
Variables.Sensor.Connect();
Variables.System.EnableData(true);
Variables.System.Start();
Variables.DataSet = Variables.System.ReceiveData(30_000_000);
Variables.Collection_tools = Variables.Sensor.Tools;
ReadMessage();
}
catch (Exception e) {
return Exception(e);
}
finally {
Variables.System.Stop();
Variables.Accelerator.Stop();
Console.WriteLine("Finally");
}
return 0;
The protocol must be GOCATOR.
All this works for me, at the moment. Nevertheless, I'm open to new suggestions.