Hello Guest it is November 30, 2021, 10:48:01 AM

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 - RedBlob

Pages: 1 2 3 »
VB and the development of wizards / Re: SetParam() strange behaviour
« on: June 26, 2015, 06:46:46 AM »
Hello Thomas,

That function not working correctly here.

The cycle work always with the same speed ...... the speed change only if I go manualy on the Homing Table and press OK (  in the Homing table there is the speed I have set in the macro !!! but is not operative if I not press the OK button ).

What can I do ?

The macro move the axis in Jog until an external switch is pressed ( like an automatic pallet finder ).

I need to move the axis in manual Jog with a VB macro ......... I don't understand why this function is available but don't work in my application .

What is wrong ?

VB and the development of wizards / SetParam() strange behaviour
« on: June 26, 2015, 04:32:05 AM »

I want change the XRefPer parameter by VB script and I use SetParam("XRefPer",10).

When I execute the macro the value in the "Homing/Limits" table change to target value but the real axis speed don't change.

The speed change only if I load the "Homing/Limits" window, I press OK and from now the value is operative.

In other words the SetParam function change the value in the Homing table but the value became operative only if I call the windows and press OK button.

What can I do to have the speed changing operative directly from VB macro ?

Thanks for help.

General Mach Discussion / G28.1 with very long axis
« on: June 25, 2015, 12:13:05 PM »

I have a very long axis and I need to use a G28.1 command to find the zero ( a precision mechanical switch ) .

If I use a low speed return to zero the cycle is very long but the precision is very goog.

If I use an high speed return to zero I have a very low precision in zero procedure.

I need to find the zero with an high speed in the first step of cycle and after to find the zero with a low speed procedure.

Have you an idea to switch the speed on the fly with a G28.1 command ?

Thank you for Help.

I think to have find the problem , but not the solution ......

The macro don't execute the instruction JogOn(Zaxis,Plus) .

If I disable the JogOn the script is executed correctly.

How is possible ?

The macro is this .... in the VB Editor it work without problem.


  Xaxis = 0
  Yaxis = 1
  Zaxis = 2
  Plus = 0
  Minus = 1

  If GetCsmioIn(6) = False Then JogOn(Zaxis,Plus)
    If GetCsmioIn(6) = True Then Exit Do

  If GetCsmioIn(6) = True Then JogOn(Zaxis,Minus)
    If GetCsmioIn(6) = False Then Exit Do

  Code("G01 Z-10 F1000")


'*                         SUBs & FUNCTIONs

Sub SoftLimitsOff ()
   If(GetOEMLED(23)) Then
   End If
End Sub
' -----------------------------------------------------------------------------
Sub SetSoftLimits (state As Boolean)
   If(state) Then
      If(GetOEMLED(23) = 0) Then
      End If
      If(GetOEMLED(23)) Then
      End If
   End If
End Sub
' -----------------------------------------------------------------------------
Sub WaitForMove ()
   While IsMoving()
End Sub
' -----------------------------------------------------------------------------
Public Function GetCsmioIn (n As Integer) As Boolean
   Dim reg As Integer
   If(n < 16) Then
      reg = 90
      reg = 91
      n = n - 16
   End If
   If(GetInBit(reg, n)) Then
      GetCsmioIn = true
      GetCsmioIn = false
   End If
   Exit Function
End Function
' -----------------------------------------------------------------------------
Public Sub SetCsmioOut (ByVal n As Integer, ByVal state As Boolean)
   If(state) Then
      SetOutBit(90, n)
      ResetOutBit(90, n)
   End If
End Sub
' -----------------------------------------------------------------------------         


I have tested some VB macro with VB Script Editor and is all OK.
I have saved the macro on my profile with extension m1s ( M901.m1s , M902.m1s ....... )
When I execute the macro from the VB Script Editor the macro is executed correctly.

When I call from Gcode with M901 command ( or M902 ) the macro don't work ...... and I need to press the RESET button to stop because the machine is like freezed.

What can be the problem ?

Thank you for help

General Mach Discussion / Re: Path not correct
« on: June 11, 2008, 01:39:28 PM »
I have tried also this test.

The problem is not the acceleration or the speed because I work at 30% of jog speed.
The jog speed is 60 % of maximum speed of CNC.

The problem is always present when I move at work speed ( very lower the maximun speed ) and never when I move at jog speed.

I have also tried to make a demo program with 1000 step of moving back and forward at maximum speed.
The start and the stop position after 1000 step is exactly the same ( each step has 800 mm of travel path for a total of 800 meter of travel )

Another strange thing is that when I program 1000 step of 800 mm forward and back the stop position is 0.000 exactly.
If I load a G code program for a work after 300000 step of program the start and the stop position is different of 0.006 mm ( is non importat for me but is strnage because the start and the stop position must be the same for simple path without complex path ).

Thanks Hood for your help.

General Mach Discussion / Re: Path not correct
« on: June 11, 2008, 09:32:47 AM »
No, for the spindle problem I don't see nothing .... the Pc is operative, the timer if elapsed time work ok, the other commands are operative, I can make all I want but the program is freezed.

But this is not a big problem because the machine has not start to work and I must only stop with F5 the spindle, I close the program, restart the program and all is OK ..... the other problem is very hard because I broke the tool and I jump off the piece ( and money ! )


General Mach Discussion / Re: Path not correct
« on: June 11, 2008, 07:43:17 AM »
Thanks for your help.

I produce about 22 piece per day ( always the same pieces, always the same material, always the same program, always the same CNC setup )

If it is a problem of missing step, acceleration/deceleration time, mechanical parts....... why some days I produce for the entire day a good products without problems ?

When the machine work good all the particulars have the same accuracy and the same dimensions ( tollerance +/- 0.01 mm !!! )

When the machine work no good I have error of 10/20/30 mm ...... Is possible that there is an error on calculation of path when I repeat 20-30 times the same program ?
I make this question because there is also another strange thing ...... for 3 times in last 2 month the program stop the execution when the spindle is turned on ( M3 command ) . I don't know what it is waiting ..... If I don't make a restart the CNC stay with spindle on for hours ..... I restart the machine and the machine go good for days.


Pages: 1 2 3 »