Hello Guest it is May 06, 2024, 03:59:18 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

1331
General Mach Discussion / Re: Spindle Relay Configuration Questions
« on: May 02, 2019, 12:23:29 PM »
Currently my spindle direction is controlled with a switch (FWD-OFF-REV) and speed is with a potentionmeter.

so there must be a Kind of Controller, maybe it has got control Inputs to Switch ON/OFF instead of switching
the powersupply. just a thought.

1332
General Mach Discussion / Re: Spindle Relay Configuration Questions
« on: May 02, 2019, 04:05:31 AM »
btw witch spindle Controller are you using?

1333
to talk about safety in context with macropump or other "enable" signals  or estop Input
(on a 5v switching on everything BOB) is just ridiculous.

1334
code to turn a Output ON

Code: [Select]
Sub Main()
 ActivateSignal(Output1)
End Sub

code to turn a Output OFF

Code: [Select]
Sub Main()
 DeactivateSignal(Output1)
End Sub

feel free to read any manual

1335
this would bo the complete code, with refernce check and X/Z move.

Code: [Select]
Public NewTool As Integer

Sub Main
'//Declarations
Dim StartTime, ActTime As Single
MaxToolNum = 4      'Max number of tools for the changer

OldTool = GetCurrentTool()
Tool = GetSelectedTool()

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

If Tool > MaxToolNum Then
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
End If

'X-Axis not in reference
If GetOEMLED(807) Then
DoButton(3)
Sleep(500)
Message ("X-Axis not referenced -> Abort !!")
Exit Sub
End If

'Z-Axis not in reference
If GetOEMLED(809) Then
DoButton(3)
Sleep(500)
Message ("Z-Axis not referenced -> Abort !!")
Exit Sub
End If

Message "ATC X-Axis to TC position"
Code "G90 G53 G0 X2"
While IsMoving()
Sleep(15)
Wend

Message "ATC Z-Axis to TC position"
Code "G90 G53 G0 Z2"
While IsMoving()
Sleep(15)
Wend


doagain:

Call StartTool

While NewTool <> Tool
Call CheckPins
Wend

Call StopTool

're check
Call CheckPins
If NewTool <> Tool Then
GoTo doagain
End If

SetCurrentTool(NewTool)
End Sub


'//// Subroutines /////////

Sub StartTool
   ActivateSignal(Output8)
End Sub

Sub CheckPins
   If GetCsmioIn(91,6) = True Then
      NewTool = 1
      End If
   If GetCsmioIn(91,5) = True Then
      NewTool = 2
      End If
   If GetCsmioIn(91,4) = True Then
      NewTool = 3
      End If
   If GetCsmioIn(91,3) = True Then
      NewTool = 4
      End If
End Sub

Sub Stoptool
   DeActivateSignal(Output8)
   ActivateSignal(Output9)
   'wait for input 23 or timeout
StartTime = Timer

   
   While GetCsmioIn(91,7) = False
Sleep(20)
ActTime = Timer
If ActTime > StartTime + 3 Then
DeActivateSignal(Output9)
MsgBox "Timeout Input23!!"
DoButton(3)
Sleep(300)
Exit Sub
End If
   Wend
   DeActivateSignal(Output9)
End Sub 

'CSMIO Eingang lesen
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


IMPORTANT:

it will move first X than Z axis!

the values of this two code lines:

   Code "G90 G53 G0 X2"

   Code "G90 G53 G0 Z2"

are in machine coord's and maybe Need to be adjusted.




1336
Code: [Select]
Public NewTool As Integer

Sub Main
'//Declarations
Dim StartTime, ActTime As Single
MaxToolNum = 4      'Max number of tools for the changer

OldTool = GetCurrentTool()
Tool = GetSelectedTool()

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

If Tool > MaxToolNum Then
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
End If

doagain:

Call StartTool

While NewTool <> Tool
Call CheckPins
Wend

Call StopTool

're check
Call CheckPins
If NewTool <> Tool Then
GoTo doagain
End If

SetCurrentTool(NewTool)
End Sub


'//// Subroutines /////////

Sub StartTool
   ActivateSignal(Output8)
End Sub

Sub CheckPins
   If GetCsmioIn(91,6) = True Then
      NewTool = 1
      End If
   If GetCsmioIn(91,5) = True Then
      NewTool = 2
      End If
   If GetCsmioIn(91,4) = True Then
      NewTool = 3
      End If
   If GetCsmioIn(91,3) = True Then
      NewTool = 4
      End If
End Sub

Sub Stoptool
   DeActivateSignal(Output8)
   ActivateSignal(Output9)
   'wait for input 23 or timeout
StartTime = Timer

   
   While GetCsmioIn(91,7) = False
Sleep(20)
ActTime = Timer
If ActTime > StartTime + 3 Then
DeActivateSignal(Output9)
MsgBox "Timeout Input23!!"
DoButton(3)
Sleep(300)
Exit Sub
End If
   Wend
   DeActivateSignal(Output9)
End Sub 

'CSMIO Eingang lesen
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





1337
ok mistake found.

Code: [Select]
Public NewTool As Integer

Sub Main
'//Declarations
Dim StartTime, ActTime As Single
MaxToolNum = 4      'Max number of tools for the changer

OldTool = GetCurrentTool()
Tool = GetSelectedTool()

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

If Tool > MaxToolNum Then
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
End If

doagain:

Call StartTool

While NewTool <> Tool
Call CheckPins
Wend

Call StopTool

're check
Call CheckPins
If NewTool <> Tool Then
GoTo doagain
End If

SetCurrentTool(NewTool)
End Sub


'//// Subroutines /////////

Sub StartTool
   ActivateSignal(Output8)
End Sub

Sub CheckPins
   If GetCsmioIn(91,6) = True Then
      NewTool = 1
      End If
   If GetCsmioIn(91,5) = True Then
      NewTool = 2
      End If
   If GetCsmioIn(91,4) = True Then
      NewTool = 3
      End If
   If GetCsmioIn(91,3) = True Then
      NewTool = 4
      End If
End Sub

Sub Stoptool
   DeActivateSignal(Output8)
   ActivateSignal(Output9)
   'wait for input 23 or timeout
StartTime = Timer

   
   While GetCsmioIn(91,7) = False
Sleep(20)
ActTime = Timer
If ActTime > StartTime + 3 Then
MsgBox "Timeout Input23!!"
DeActivateSignal(Output9)
DoButton(3)
Sleep(300)
Exit Sub
End If
   Wend
   DeActivateSignal(Output9)
End Sub 

'CSMIO Eingang lesen
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




1338
you mean the last code with the timeout included?
do you get any message in the statusline?

very hard to test here without the real Hardware.

1339
ok sorry for the delay.
here the code with a 3 second timeout for input23

Code: [Select]
Sub Main
'//Declarations
Dim StartTime, ActTime As Single
MaxToolNum = 4      'Max number of tools for the changer

OldTool = GetCurrentTool()
Tool = GetSelectedTool()

If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If

If Tool > MaxToolNum Then
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
End If

doagain:

Call StartTool

While NewTool <> Tool
Call CheckPins
Wend

Call StopTool

're check
Call CheckPins
If NewTool <> Tool Then
goto doagain
End If

SetCurrentTool(NewTool)
End Sub


'//// Subroutines /////////

Sub StartTool
   ActivateSignal(Output8)
End Sub

Sub CheckPins
   If GetCsmioIn(91,6) = True Then
      NewTool = 1
      End If
   If GetCsmioIn(91,5) = True Then
      NewTool = 2
      End If
   If GetCsmioIn(91,4) = True Then
      NewTool = 3
      End If
   If GetCsmioIn(91,3) = True Then
      NewTool = 4
      End If
End Sub

Sub Stoptool
   DeActivateSignal(Output8)
   ActivateSignal(Output9)
   'wait for input 23   or timeout
StartTime = Timer

   
   While GetCsmioIn(91,7) = False
Sleep(20)
ActTime = Timer
If ActTime > StartTime + 3 Then
MsgBox "Timeout Input23!!"
DoButton(3)
Sleep(300)
Exit Sub
End If
   Wend
   DeActivateSignal(Output9)
End Sub 

'CSMIO Eingang lesen
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

IMHO i think for a save TC on a lathe some more things are necessary.

1. homing Limit Switches
   machine should have homing Limits to have the possibillity to drive TC to a defined Position
   (in machine coords) to be save for rotate the TC

here some code witch check' that X and Y axis are referenced
Code: [Select]
'X-Axis not in reference
If GetOEMLED(807) Then
DoButton(3)
Sleep(500)
Message ("X-Axis not referenced -> Abort !!")
Exit Sub
End If

'Z-Axis not in reference
If GetOEMLED(809) Then
DoButton(3)
Sleep(500)
Message ("Z-Axis not referenced -> Abort !!")
Exit Sub
End If

2. drive Z and X axis to a defined Position (in machine coords)

here some code:
Code: [Select]
Message "ATC X-Axis to TC position"
Code "G90 G53 G0 X2"
While IsMoving()
Sleep(15)
Wend

Message "ATC Z-Axis to TC position"
Code "G90 G53 G0 Z2"
While IsMoving()
Sleep(15)
Wend








1340
Mach Screens / Re: chinese cnc probing macros?
« on: April 25, 2019, 07:06:16 AM »
GetVAR() is not a "legacy" function. It's the proper and only accurate way to read the trip point. And the majority of chinese controllers do not support it's use.

thats what i tryed to say. ;)