Hello Guest it is December 08, 2019, 06:18:33 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 - TPS

1401
VB and the development of wizards / Re: Act sometimes
« on: September 03, 2014, 03:48:14 AM »
ok then i expanded the sample a little bit:

Code: [Select]
let's say
'marker red = tool 5
'marker blue = tool 6
'marker black = tool 7

' Get actual tool # and new tool #
ToolOld = GetCurrentTool()
ToolNew = GetSelectedTool()

'here we do the marker things

'here we do the code to deactivate the markers
If ((ToolOld = 5) or (ToolOld = 6) or (ToolOld = 7))
    'code to desactivate markers
    code "G01 X?? Y??"
    'and so on
End If


If ((ToolNew = 5) or (ToolNew = 6) or (ToolNew = 7))

    If (ToolNew = 5) Then
        'add here the code activate red marker
        code " G01 X?? Y??"
        'and so on
    End If

    If (ToolNew = 6) Then
        'add here the code activate blue marker
        code " G01 X?? Y??"
        'and so on
    End If

    If (ToolNew = 7) Then
        'add here the code activate black marker
        code " G01 X?? Y??"
        'and so on
    End If
    Exit Sub

else
'here we do the original M6Start things

End If

regards Thomas

1402
VB and the development of wizards / Re: Act sometimes
« on: September 03, 2014, 03:10:29 AM »
Hello,

i think i understans now what you want.

needs a little bit of code in the start macro:

lets say
marker red = tool 5
marker blue = tool 6
marker black = tool 7

' Get actual tool # and new tool #
ToolOld = GetCurrentTool()
ToolNew = GetSelectedTool()

If (ToolNew = 5) Then
    'add here the code activate red marker
    code " G01 X?? Y??"
    'and so on
End If

If (ToolNew = 6) Then
    'add here the code activate blue marker
    code " G01 X?? Y??"
    'and so on
End If

If (ToolNew = 7) Then
    'add here the code activate black marker
    code " G01 X?? Y??"
    'and so on
End If

hope i understood what you realy wnat to do.

Thomas

1403
VB and the development of wizards / Re: homing macro and Ismoving
« on: September 03, 2014, 02:52:12 AM »
Hello Brett,

i thought this HOME OFF DISTANCE is the distance
witch is driven after the homing, i am gona test this today.

what i want to do with my script is to clear the homing limits
before i start a homing, because it is not homing when its
on an limit.

Thomas

1404
VB and the development of wizards / Re: Act sometimes
« on: September 02, 2014, 03:16:40 PM »
hello Daregone,

for my mind i think you have to find your 'own' way for
a tool change macro, however its called.

i think with this M6Start stop thing you will not get happy.

excuse my bad english.

Thomas

1405
VB and the development of wizards / Re: homing macro and Ismoving
« on: September 02, 2014, 03:12:01 PM »
ok, small update,

i am sure it is not the Ismoving() thing.

replaced it with:

While GetOEMled(999)
Wend

should be the same i thought.
but i am geting no internal error anymore, it just hangs.

for the moment i am out off any ideas.

looks like i have to to accept, that it is not
working 'sometimes'.
with no idea what i can do if it is not working (automaticly)

just frustraiting.

Regards Thomas

1406
VB and the development of wizards / Re: homing macro and Ismoving
« on: September 02, 2014, 04:26:50 AM »
Hello Brett,

i emailed CSlabs the problem.
will get back to you with the response.

Thomas

1407
VB and the development of wizards / Re: Act sometimes
« on: September 02, 2014, 04:15:06 AM »
Hi,

this needs a little bit of code like this

Code: [Select]

'move to tool change position
Code "G1 X?? Y?? Z??"

'check tool present
Again:

If IsActive(INPUT1) Then
    ' tool is present       
    ' do code when tool present
Else
    'tool not present
    'ask operator
    Response = MsGBox ("tool loaded ?" , 4)
    If Response = 6 then
        Go To Again
    Else   
        GoTo Ende
    End If   

End If

'Code if everything was fine

Exit Sub

Ende:
   'code if operator pressed abort



it's just a sample not tested.

regards Thomas

1408
VB and the development of wizards / Re: homing macro and Ismoving
« on: September 02, 2014, 02:14:15 AM »
Hello,

back again after additional testing.

i tryed

Code: [Select]
Sleep(200)
While IsMoving()
Wend

crashed at line While IsMoving() with internal error

i tryed

Code: [Select]
While IsMoving()
Wend

did not stop after the DoButton(24)

i tryed

Code: [Select]
Sleep(200)
While Not IsStopped()
Wend

crashed allways at line While Not IsStopped() with internal error


maybe i am searching at the wrong side of the road, because i am
using a csmio/ip motion controller and do not know whether this
function call (IsMoving()) is only handled by Mach Software or
also by the plugin.

possibly i have to talk to the csmio/ip people.

Thanks Thomas






1409
VB and the development of wizards / Re: homing macro and Ismoving
« on: August 31, 2014, 01:25:26 PM »
Hello Gerry,

tryed this already, but i figured out
that without the sleep it does not
wait after the

DoButton(24)

for z-reference.

Thanks Thomas

1410
VB and the development of wizards / homing macro and Ismoving
« on: August 31, 2014, 10:18:48 AM »
Hello together,
first of all excuse my bad english.

after hours of searching i will post my problem here.

i have written a small macro for auto homing and clearing home limit swtiches if
necessary.

here the code:
Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 30.08.2014 
' Referenzschalter freifahren und anschliessend Referenzieren
' -------------------------------------------------------------------------------
'beim Laden des Files Abbrechen
If IsLoading() Then
    GoTo Ende
End If

Message ("Automatische Referenzfahrt")

'Referenz INI Z freifahren
If GetOEMLED(836) Then
Code "G91" ' Inkremental Modus
Code "G0 Z-50" ' Freifahren
WaitMoving
Code "G90" ' Absolut Modus
End If

'Z referenzieren
DoButton(24)   'Zuerst Z
WaitMoving

'Referenz INI X freifahren
If GetOEMLED(830) Then
Code "G91" ' Inkremental Modus
Code "G0 X-50" ' Freifahren
WaitMoving
Code "G90" ' Absolut Modus
End If

'Referenz INI Y freifahren
If GetOEMLED(833) Then
Code "G91" ' Inkremental Modus
Code "G0 Y-50" ' Freifahren
WaitMoving
Code "G90" ' Absolut Modus
End If

'X und Y referenzieren
RefCombination(3) ' dann X und Y
WaitMoving
Code "G54" 'Koordinatenverschiebung ein
Sleep(200) 'warten
    Message (" ") 'Stauszeile löschen
Exit Sub
 '--------------------------------------------------------------------------------

Ende:
 
 Message ("Automatisches Referenzieren Abgebrochen")
   
End Sub   

'Funktion zum warten bis Antrieb steht
Function WaitMoving()
Sleep(200)
While IsMoving()
Sleep(200)
Wend
End Function 


sorry for the german comments.

the problem ist that the macro hangs in about 1 of 50 tryes
at the line

   While IsMoving()

line. if i press the stop button
i get the message:

internal error at line ..


i have no idea what i am doing wrong.

Thanks Thomas