Hello Guest it is April 25, 2024, 04:16:11 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Steffen_Engel

Pages: « 1 2 3 4
31
Hi,

I'm working at a plugin for Mach3 which will implement some movement.
At the moment it is normal VBA as screen buttons but due to the size of the screenset and software maintenance it is of interest to transfer the code to a DLL/Plugin.

Everything is working fine and on the basics of the plugin-tutorial it was just a simple way to the first code (thanks to James for this nice work).

Now as an example my problem:

Code: [Select]
Code("g01x1000");
while(IsMoving())
{
  Sleep(10);
}
Code("g01x2000");
while(IsMoving())
{
  Sleep(10);
}

Now if there is ESCAPE pressed while doing the first move, this move is stopped, then the second move is done.
With VBA the whole script is stopped.

My intention is to stop the whole script as in VBA and so I need the information, if movement has been stopped by the user (or some other condition).

So my code would be
Code: [Select]
try
{
  Code("g01x1000");
  while(IsMoving())
  {
    Sleep(10);
  }
  if (MovementHasBeenEscaped())
  {
    throw (ESCAPEDMOVEMENT);
  }
  Code("g01x2000");
  while(IsMoving())
  {
    Sleep(10);
  }
}
catch(int breakcode)
{
}

So, what chance do I have to implement MovementHasBeenEscaped()?

I sought at TractoryControl, Engine an Mach4View, but until now I did'nt find a way to check for the break.

By, Steffen

Pages: « 1 2 3 4