07-15-2021, 07:39 PM
(07-15-2021, 07:25 PM)Vineet Wrote:Hello,
Here is the code I tried and it works fine. Can you try this?
Hope this helps you.Code:using System;
namespace SimpleNetcoreApplication
{
public class Program
{
static void Main(string[] args)
{
var rdk = new RoboDK();
// Connect to existing RoboDK or start a new one if RoboDK is not running
var status = rdk.Connect();
Console.WriteLine($"Connect status: {status}");
//RoboDK _RDK = new RoboDK();
抢劫oDK.Item camera = rdk.getItem("Camera 1");
camera.setParam("Open");
// close RoboDK
//rdk.CloseRoboDK();
}
}
}
I inserted the code into the function and executed it.
"Connect status: True" is printed to the Console, and then the program crashes.
///
/// Send a specific parameter to RoboDK. This is reserved for internal purposes.
///
/// Item parameter
/// value
///
public string setParam(string param, string value = "")
{
link._require_build(7129);
link._check_connection();
link._send_Line("ICMD");
link._send_Item(this);
link._send_Line(param);
link._send_Line(value);
string response = link._recv_Line(); <<< Crash Happens Here
link._check_status();
return response;
}
It appears to crash while waiting for a response from the RDK window.
I'm curious if I am using an old version of the API code.