Hello Guest it is April 27, 2024, 05:17:52 PM

Author Topic: While IsMoving issue - Procedure - the loop freezes  (Read 579 times)

0 Members and 1 Guest are viewing this topic.

While IsMoving issue - Procedure - the loop freezes
« on: October 24, 2023, 08:25:11 AM »
Greetings,
I have a very unusual problem that I have never encountered before.
Basically, it is a very simple procedure that does not work on the machine where I have installed the latest version of MACH3 (Mach3Version3.043.066) and WIN11.
Mach3 is combined with CSMIO-IP-S
In any procedure where While IsMoving() is used, the loop spins endlessly even though the previous command - the G-code for moving an individual axis is finished (The axis is successfully moved to the required position)

Example:

Code: [Select]
Code("G01 G53 Z0 F200")
While IsMoving
Sleep(20)
Wend

Even without Sleep(20) it doesn't work
I tried reinstalling MACH3, also running it in compatibility mode with WIN7, XP,... without success

On another computer, the same procedure works without a problem.
I've tried many things but unfortunately I can't solve the problem.
Any other suggestions on how to solve the problem - without replacing the computer? (this one is new)

Thanks

Offline Tweakie.CNC

*
  • *
  •  9,200 9,200
  • Super Kitty
    • View Profile
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #1 on: October 24, 2023, 09:20:08 AM »
Mach3 v3.043.066 did suffer some problems and the recommendation is to download the latest version from the Artsoft / NFS website (which is actually a patched version of v3.043.062). Try it and see if it cures the problem you are having. It can be downloaded from here;  https://www.machsupport.com/downloads-updates/mach3-downloads/

Tweakie.
PEACE

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #2 on: October 25, 2023, 03:26:35 AM »
CS-Lab is recommending to use Version R3.043.022 for CSMIO controllers.
i have downgraded all my machines to this version, because i had some
strange behavios as well.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #3 on: October 25, 2023, 07:36:15 AM »
I installed the latest version of Mach3 as suggested by Tweakie.CNC - unfortunately the situation remained the same  :(
Then I tried the R3.043.022 version as suggested by TPS... at first it seemed to fix the problem. A few times even the axis shift procedure worked. Then the same thing again... the While Ismoving loop loops endlessly. If I interrupt the procedure and activate STOP, sometimes the axis moves successfully when trying again.
Sometimes all three axes start moving slowly, even though the movement in the procedure (macro script) is requested for only one axis.
Now I will try reinstalling WIN... hopefully I can report a successful fix...

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #4 on: October 25, 2023, 07:55:11 AM »
i use the While IsMoving on all of my machines without any problem.
but the "newest" of my machies is running on Win8.
so maybe Win11 causes the "problem"?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #5 on: October 26, 2023, 02:19:44 PM »
I almost lost hope...
I tried all possible versions of Mach3, reinstalled WIN (from win11 to Win10),... without success.
Sometimes the procedure executed normally, but mostly I got "Error on line: Internal error <While IsMoving>..."
After spending many hours, I found a conflict between the tool change procedure (where I used axis movements and While IsMoving...), and the Macropump procedure.
In Macropump I used the function "G52  X150"  and  "G52  Y150"
I used this because I have three spindles on the machine and according to the selected tool in the program, the movement was automatically performed...
Now, when I wanted to arrange automatic tool change on one of these spindles, it got complicated...

Is there any other possibility of automatic movement of the coordinate system without additional M-codes in the G-code itself - movement to the corresponding spindle according to the selected tool number?

I would like for tools 1-5 (Spindle1) to have no movement (only the zero point is taken into account), for tools 6-10 (Spindle2) a movement for the zero point + X150mm (this is the distance between the Spindles), and for tools 11-15 (Spindle3) for Y150mm .

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #6 on: October 27, 2023, 01:55:34 AM »
here is an example for M6Start.M1s i made a while ago.
maybe this helps. in this case we worked with workpiece offset's related to the
selected tool.

you have to insert your offset's to Config -> fixtures

Code: [Select]
'get new tool number
newtool = GetSelectedTool()

'select Offset by toolnumber
If newtool = 1 Then
Code "G54"
End If
If newtool = 2 Then
Code "G55"
End If
If newtool = 3 Then
Code "G56"
End If
If newtool = 4 Then
Code "G57"
End If
If newtool = 5 Then
Code "G58"
End If
If newtool = 6 Then
Code "G59"
End If
If newtool = 7 Then
Code "G59P7"
End If
 
SetCurrentTool(newtool)
Code "G43H" & newtool

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #7 on: October 29, 2023, 11:34:50 AM »
Hi TPS

Yes, this could be a solution... but...
In this case I need to set all this  offset's before starting G-code.
When I will touch my workpiece  X, Y and Z position (G54)  then I would need to calculate and set ofsets for G55, G56,...
I prefer a solution that offset's for Spindle2 and Spindle3 is set automatically. Someting like G54 + X150
With G52 in macropump this was a nice solution but unfortunately it does not work in combination with M6Start...

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: While IsMoving issue - Procedure - the loop freezes
« Reply #8 on: October 29, 2023, 11:47:09 AM »
but you can try to use G52 in M6Start macro, so it will only be excecuted once when tool changes.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.