Hello Guest it is April 18, 2024, 08:06:38 PM

Author Topic: And today's question is...  (Read 5003 times)

0 Members and 1 Guest are viewing this topic.

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
And today's question is...
« on: September 26, 2012, 03:55:08 PM »
I am trying to modify the standard toolchange macro to best suit my carousel ATC with little knowledge of how VBscript works and why, sometimes, it doesn't.
Stepping into the program it alarms a syntax error on the subroutine shown below. The original code described Sub MovePos(ByVal ToolNumber As Integer) which I guees means "move" to the "position" identified by the correct tool "number"
What I am trying to do is as below which I hope makes sense to read, if not to run as script but I don't know what instruction to type within the Sub???(ToolNumber As Integer)
The GetUserDRO's are boxes into which I have already typed the specific tool numbers installed in 1of6 carousel slots

Sub (ToolNumber As Integer)

Select Case ToolNumber
       Case Is = GetUserDRO(1001)
          If IsActive(INPUT1) Then
          SendSerial("B0000133E9>7R25")
      
   Else
   Message("Toolchange failed")
   DoOEMButton(1021)
   End If
       
       Case Is = GetUserDRO(1002)
   If IsActive(INPUT1) Then
      SendSerial("B0000133E:?7R25")
   Else
   Message("Toolchange failed")
   DoOEMButton(1021)
   End If
         
       Case Is = GetUserDRO(1003)
   If IsActive(INPUT1) Then
      SendSerial("B0000133E;08R25")
   Else
   Message("Toolchange failed")
   DoOEMButton(1021)
   End If
EndSelect

Not sure how I can thank you Guys for the support other than to say that beer is available if you're ever in the area.

Thanks ...Sweep
Re: And today's question is...
« Reply #1 on: September 27, 2012, 10:15:25 AM »
Hi Sweep,
You're welcome.  :)
I think I feel a little thirsty :D

I attached a file how I would do it.
should be running so far.
There may be different ways to do it.

hope that helps.

Alex

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: And today's question is...
« Reply #2 on: September 27, 2012, 06:27:29 PM »
Hi Alex,

Let me know where to send the beer tokens!
The part of the M6 program you built worked spot-on 'grabbing' the tool number from the dro and indexing the correct carousel position.
I will try adding the rest of the procedure after work on Friday so the 3 axis move to their tool change positions before the cycle starts. No doubt I will make a mess of it but i'd like to have a go myself first before calling in the cavalry ...and i'm not sure how much more beer I can afford!

Really appreciate your support.

...Sweep

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: And today's question is...
« Reply #3 on: September 27, 2012, 08:38:52 PM »
 :)

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: And today's question is...
« Reply #4 on: September 28, 2012, 05:57:17 PM »
Hi Sweep,
 ;D ;D ;D

I attached another file which looks a bit clearer without using the g code variables.

I'm here in the north of germany.

Alex

Offline Sweep

*
  •  150 150
    • View Profile
    • pollz.co.uk
Re: And today's question is...
« Reply #5 on: September 28, 2012, 06:12:12 PM »
Thanks again Alex.

Not sure I should be sending English beer to Germany as you have that department well and truely sorted!
I didn't get chance to play with the code tonight as I have just finished work for my German employers.
I am going to try and put the first part of the standard macro on the front of yours as I need the axis to travel to a safe tool change position, z particularly, before the atc cycle starts. When i tried it last night, without fully reading the code, i crashed the carousel into the spindle. Fortunatley its air powered so no danage done.

...Sweep
Re: And today's question is...
« Reply #6 on: September 28, 2012, 06:56:03 PM »
Hi again,
here a advice
at the beginning of the macro you should have checked all conditions. What i mean is
does the tool exist
which tool is in the spindle
which tool is called
and so on ...
When the mechanically part ( movement ) starts then
1) turn the carousel to the positon of the tool thats in the spindle
2) index the spindle
3) do the axis movement
and so on ...
If you want to use T0 command ( bring the tool that is in the spindle away)
then you need conditions for that.

just a thought

Alex