Hello Guest it is October 20, 2021, 09:05:50 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 - TPS

1511
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 04:31:48 AM »
sorry seems i going to get bild

Function CW()'Rotation CW
   Dim x As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0
   ActivateSignal(OUTPUT9)'Turns the AC Motor On cw

   Sleep(50)

   For x=0 To CWPos
           While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
      Sleep(10)
      Wend
           While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
      Sleep(10)
      Wend

            x=x+1
        Next x
this is wrong,not needed, the for next Loop is counting itselv.

1512
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 04:24:43 AM »
if you put some Addition MSGBox instruction to your CW Routine you can how often
Input gets triggered

Function CCW()'Rotation CCW
   Dim y As Integer
   Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
   CTPos=0
   Activatesignal(OUTPUT9)'atc motor revirsing relay
   ActivateSignal(OUTPUT10)'Turns the AC Motor On
    Sleep(50)
    
     For y=0 To CCWPos
           While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
      Sleep(10)
      Wend
MSGBox "Input is off"
           While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
      Sleep(10)
      Wend
MSGBox "Input is on"
            y=y+1
        Next y
   CTPos=y
   DeactivateSignal(OUTPUT9)
   Deactivatesignal(OUTPUT10)'atc motor revirsing relay
End Function

1513
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 03:50:34 AM »
so why do you not read the Input drectly.
this work 100%, if have used it many times.

for eample

While GetCsmioIn(91,15) = False  
   Sleep(20)
Wend


'CSMIO read input
Public Function GetCsmioIn (ByVal adr As Integer, ByVal n As Integer) As Boolean
   If(GetInBit(adr, n)) Then
      GetCsmioIn = true
   Else
      GetCsmioIn = false
   End If
End Function




here is a links witch Shows the adresses:

http://en.cs-lab.eu/wp-content/uploads/2016/06/csmio-ip-s-konfiguracja-we_wy-artykul.pdf


1514
a simple search for "tooltable Import" in the Forum:

http://www.machsupport.com/forum/index.php/topic,27640.0.html

1515
VB and the development of wizards / Re: centerpiece full (change)
« on: April 05, 2018, 01:43:43 AM »
Rem VBScript To center probe outside diameter Metric Version
Speak (" psizionarsi CINQUE millimetri sopra il pezzo") 'Avviso Vocale
response = MsgBox ("   5 mm    SOPRA IL PEZZO")

Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo pieno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO PIENO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO PIENO")
 
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentToolDiameter = GetOemDRO(43) 'gets the current tool diameter

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty

    Call ProbeGrounded()
    Exit Sub

Else

    XCurrent = GetDro(0)
    YCurrent = GetDro(1)
    OutsideDiameter = GetUserDRO(1152)

    Code "G4 P1" 'Pause 1 second to give time to position probe plate
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    Code "F50" 'slow feed rate to 100mm/sec
    Code "G90 G0 X" &XNew + OutsideDiameter * .6
    Code "G91 G0 Z-10"



anyhow this XNew is set nowhere before it is used.


1516
VB and the development of wizards / Re: centerpiece full (change)
« on: April 05, 2018, 01:40:44 AM »
Rem VBScript To center probe outside diameter Metric Version
Speak (" psizionarsi CINQUE millimetri sopra il pezzo") 'Avviso Vocale
response = MsgBox ("   5 mm    SOPRA IL PEZZO")

Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo pieno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO PIENO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO PIENO")
 
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentToolDiameter = GetOemDRO(43) 'gets the current tool diameter

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty

    Call ProbeGrounded()
    Exit Sub

Else

    XCurrent = GetDro(0)
    YCurrent = GetDro(1)
    OutsideDiameter = GetUserDRO(1152)

    Code "G4 P1" 'Pause 1 second to give time to position probe plate
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    Code "F50" 'slow feed rate to 100mm/sec
    Code "G90 G0 X" &XNew + OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe Left

    XNew = Xcurrent - OutsideDiameter * .6
    Code "G31 X" &XNew
    While IsMoving() 'wait for the move to finish
    Wend
    XPos1 = GetVar(2000) 'get the probe touch location
    Code "G91 G0 X2"
    Code "G91 G0 Z10"
    Code "G90 G0 X" &XCurrent 'rapid move back to start point
    Code "G91 G0 X" &XCurrent - OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe Right

    XNew = XCurrent + 75 'probe 75mm to right
    Code "G31 X" &XNew
    While IsMoving()
    Wend
    XPos2 = GetVar(2000)
    Code "G91 G0 X-2"
    Code "G91 G0 Z10"
    XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
    Code "G90 G0 X" &XCenter 'rapid move to the x center location
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    Code "G4 P0.25"
    Code "G90 G0 Y" &YNew - OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe up

    YNew = YCurrent + 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos1 = GetVar(2001)
    Code "G91 G0 Y-2"
    Code "G91 G0 Z10"
    Code "G90 G0 Y" &YCurrent
    Code "G91 G0 Y" &YCurrent + OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe down

    YNew = YCurrent - 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos2 = GetVar(2001)
    Code "G91 G0 Y2"
    Code "G91 G0 Z10"
    YCenter = (YPos1 + YPos2) / 2

Rem move To the center

    Code "G90 G0 Y" &YCenter
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    While IsMoving ()
    Wend
    Call SetUserDro (1152,YPos2 - YPos1 - CurrentToolDiameter)

    Code "G4 P0.25"

    Code "F" &CurrentFeed 'restore starting feed rate
   Call ReturnG90G91State()
   Exit Sub
End If
 
Sub ProbeGrounded()
   Code "(Probe plate is grounded, check connection and try again)"
   Call ReturnG90G91State()
End Sub

Sub ReturnG90G91State()
   If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
      Code "G91"
   End If
   If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
      Code "G0"
   End If
   
   
End Sub 

1517
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 01:27:32 AM »
try to use a Input instead of OEMTrig.

what Controller are you using?

1518
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 04, 2018, 12:21:41 PM »
Hello,

i think the Problem is in this Sub:


'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
   NTool = 16 ' Number of tools changer holds
   CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
   If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
      CWPos = CWPos + NTools
   End If
   CCWPos = NTools - CWPos
   If CWPos < CCWPos Then
      call CW()
   Else
      call CCW()
   End If
End Sub

should be IMHO


'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
   NTools = 16 ' Number of tools changer holds
   CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
   If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
      CWPos = CWPos + NTools
   End If
   CCWPos = NTools - CWPos
   If CWPos < CCWPos Then
      call CW()
   Else
      call CCW()
   End If
End Sub


1519
G-Code, CAD, and CAM discussions / Re: Mach3 stops at the macro. Why?
« on: April 04, 2018, 01:43:39 AM »
HI,
there is a fault in your M20 macro at the SUB StopRewindSleep

Code: [Select]
'-------------------------------------------
Sub StopRewindSleep ()
   DoOEMButton(1003)
   DoOEMButton()
   Sleep(150)
End Sub


the DoOEMButton(), because the Argument is not optional.

because of the Name of the SUB i think it should be:

DoOEMButton(1002)


1520
General Mach Discussion / Re: Probing - what would i need?
« on: April 03, 2018, 02:23:33 PM »
But do you measure tool lengths "on" the machine i.e. tell you want to load tool 10 into the carousel so you fit tool 10, it goes and measures the offset, stores it and then unloads the spindle into the carousel??

that's what i am doing on my older machine, but on the Tongil, i measure them offline with
the function, that the length is written direct into tooltable.