I think I found what the problem is. Once I enable the 4th axis through interpreter command, the traverse works as expected.
Is there a cleaner way of enabling/disabling axes in .NET without resorting to interpreter?
I'm doing the following to enable axes, as per example:
==============================================================================
_Controller.WriteLine(String.Format("DefineCS = {0} {1} {2} {3} {4} {5}", 0, 1, 2, 3, -1, -1));
_Controller.WriteLine(String.Format("EnableAxis{0}", 0));
_Controller.WriteLine(String.Format("EnableAxis{0}", 1));
_Controller.WriteLine(String.Format("EnableAxis{0}", 2));
_Controller.WriteLine(String.Format("EnableAxis{0}", 3));
_Controller.CoordMotion.StraightTraverse(111.0000, 222.0000, 333.0000, 444.0000, 0.0000, 0.0000, false);
==============================================================================
And one more question. Is there a way in .NET dll to do something similar to: "while (!CheckDone(1))"
Thanks again,
Kyryl
| Group: DynoMotion |
Message: 2075 |
From: brad murry |
Date: 10/30/2011 |
| Subject: Re: 4th-axis in .NET |
For configuring/enabling, and handy features like IsMotionComplete()- [you canactually subscribe to a MotionComplete event if you do not want to poll in your code] :: I reccomend you check out the CNCTW download. You do not need to use the GUI framework to take advantage of the IO, Axis and AxisGroup objects. They are essentially wrappers around the hardware to represent the behaviors in a clean .net object. It also lets you configure IO/Axes/Axis groups from XML files so it is 100% self-contained. Some example axis commands: void StartMoveTo(double pos, bool scurve);
void MoveTo(double pos, bool scurve);
void StartRelativeMoveTo(double pos, bool s_curve);
void RelativeMoveTo(double pos, bool s_curve); void Jog(double velocity);
void Pause();
void Resume();
void Stop();
void Abort();
void Enable();
void Disable();
bool CheckEnabled();
void Reset();
bool ClearError();
bool IsError();
string GetError();
bool LimitNegSW();
bool LimitPosSW(); bool MotionComplete();
bool WaitforMotionComplete(int timeout);
bool WaitforInPosition(double pos); You can download it here: http://sourceforge.net/projects/cnctw/files/Machine%20Manager/Source/CNCTW.zip/download It is heavily commented, so hopefully should be semi-self explanatory. -Brad Murry | | | |