@Phaedrux Thank you, I am waiting for the response.
Posts made by Kotteri
-
RE: The web request to move the machine axes not working
-
The web request to move the machine axes not working
I am developing an c# application to interface with the Duet3D machine to move the X, Y axes to different locations. Please see below the code snippet I am using .
for (double y = yScanStart; y < yScanEnd; y += 0.2)
{
for (double x = xScanStart; x < xScanEnd; x += 20.0)
{
oozNest.MoveAxes(x, y);
this.CaptureFrame();
if (this.stopCapturing)
break;
}
if (this.stopCapturing)
break;
}public void MoveAxes(double x, double y)
{
if (this.IsIdle())
{
var command = String.Format("/rr_gcode?gcode=G1 X{0} Y {1}", -1x, -1y);
var request = (HttpWebRequest)WebRequest.Create(“http://192.168.251.2 ”+ command);
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
while(!this.IsIdle())
{
//wait to complete the requested action.
}
}
}public bool IsIdle() { bool retVal = false; string[] result; string[] stringSeparators = new string[] { ":", ",", "\"","[","]" }; try { var responseString = this.SendCommand("/rr_status"); result = responseString.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries); if (result[2].Equals("I")) { retVal = true; } } catch (Exception ) { //do nothing } return retVal; }
The code is working fine for a duration and start misbehaving after that. The axes are not moving to the requested locations and it is moving to random locations.
Could you check this code and let me know the possible issues in interacting with the machine through the web services. -
Duet Web control interface using c# .net
Hi,
I am using a CNC machine supports the Duet Web control. Instead of using the Duet Web control interface, I need to interact with the machine from a custom program developed in C#.
Would it possible to send the G-code and M commands from a c# application and get the response form the machine?If possible could you send me a sample code of sending and receiving messages.
Kind Regards,
Jithesh