Hello Guest it is April 18, 2024, 09:57:10 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 - Oldraven

Pages: « 1 2 3 »
11
VB and the development of wizards / need help!
« on: February 20, 2015, 05:36:49 AM »
Hello all,

I really could use some help with one command in the VB script below.

This statement works but also seeds the X- and Z-axes DRO's with random digits!
Call SetOEMDRO(824,number)                  'Set tool # in DRO
Why ??
I am working on this for almost a week now.
For the rest the script works OK.

Jos

'REM _________Script to advance ATC/Turret 1 position.____________
 
  maxtool = 6                        '# of tools in turret
  extraAngle = 6                             'Extra angle added to turret rotation
  round = 360                        'One turn in degrees of turret
  oldtool = getcurrenttool                       'Tool # before rotation
  newtool = GetOEMDRO(824)               'Get Tool #
  Angle = round/maxtool                                     'Angle of rotation i.e. 60 degrees
  number = GetOEMDro(824)                                 'Get Tool #
  
Code "G91"                        'Incremental Distance Mode  
If GetOEMDRO(824) = 0 Or GetOEMDRO(824) >6 Then
   number1 = Question("What is current tool # ?")
   Call SetOEMDRO(824,number1)
   Call SetOemDro(803,number1*round/maxtool) '803 = A Turret DRO
   Exit Sub
End If  
number=number+1                                            'add 1 to the #
If nummer>maxtool Then number=1                        'check if tool # is 6  

'After executing the next line the X- and Z- DRO's display random figures.
'I do not know why.
Call SetOEMDRO(824,number)                                 'Set tool # in DRO  

                                          'now calculate the rotation angle of turret
If number=1 Then Call SetOemDro(803,0)
ToolChange = GetOEMDRO(803)                    'Get A position
ToolChange = (round/maxtool)+extraAngle                  'Tool-change turret 60 + 6 CW
                                 
Code "G0 A" & ToolChange                                'execute rotation CW
code "G0 A" & -6                          '6 steps CCW

While IsMoving()
Wend
Call SetOEMDro(803,((number-1)*round/maxtool))
 
Code "G90"                             'back to Absolute Distance Mode

12
VB and the development of wizards / Re: Reaction time IsActive(INPUT)
« on: June 09, 2012, 01:08:14 PM »

@ TP,

I found that too, later I used G00 A10

Thanks for your code, I'll give that a try tomorrow.

This macro stuff is very difficult.

Jos
Holland
The G0 A360 command will cause the Axis to rotate to either A360 or cause it to rotate 360 degrees depending on if you are in abs or inc mode.

Nothing in your Macro will stop it from running to completion.


IF you want it to REF HOME to the switch use

Code"G28 A0.000" it will move to the switch then back off the switch untill it remakes.

(;-) TP


13
VB and the development of wizards / Reaction time IsActive(INPUT)
« on: June 09, 2012, 05:02:52 AM »
Hi,

I am trying to get my M6Start.m1s macro to home at tool #1.

I am using these lines to have the macro look at INPUT1 (port 1, pin 13)

Code "G00 A360"                        'Rotate the ATC
While Not IsActive(INPUT1)       ' Look for ATC Home pulse
 Wend               'Input #1 must be active now

However INPUT1 LED lights up but no reaction. The ATC keeps on turning.

What is happening? Is the input pulse too short?

Any help would be greatly appreciated.

Jos
Holland

14
Post Processors / Re: Solidcam 2006 Rev10 to mach2-mach3 post pro
« on: January 22, 2012, 09:21:51 AM »
Is there a solution for these messages?

I use SW2010 and Solidcam 2011. The postprocessor is from cncbasher above.
It is not possible to generate a G-code so the SC is in fact useless for me.

thanks.

Thanks Dave for the post processor. I am using Solidworks 2011 and Solidcam 2010 to Mach 3 to my new Taig mill. I am having trouble with the most recent version of this post processor. I am working in imperial units.

 I am getting error codes as follows:

"Line 430: invalid GENERATE statement"
"Line 430: unrecognized statement"


15
General Mach Discussion / Re: G53 Z0 Strange Behavior.
« on: July 11, 2011, 04:34:22 AM »
Hi Hood,

That's it !!

I just tried it, put the G0 in the line N0 along with the rest and the Z worked normal.

That simple!

Thanks,

Jos

Put a G0 before the G53Z0, either on the same line or  before and it will move at rapid rate. The reason your move will be slow on the first is it will move at the G1 feedrate you have set at the time, so if just started it is F6 as default. The second time there will have been either a G0 or a G1, with a faster feedrate, preceding the G53.
Hood

16
General Mach Discussion / G53 Z0 Strange Behavior.
« on: July 11, 2011, 03:57:45 AM »

Hello all,

I need some insight here.
At the first encounter of G53 Z0 the Z-axis rises very slow.
At the next tool changes a call for G53 Z0 is made and the Z-axis rises in normal speed.

I am at a loss, no idea what is going on.
I General Config I only have G21 in the Initialization String.

What is going on?

My G-code;
(PROGRAM NAME - BASE-2D-3.NC)
(POST - MACH 3 MILL METRIC)
(DATE - SAT. 07/09/2011)
(TIME - 09:33AM)

N01 G21 G40 G49 G54 G80 G90 G91.1
N02 G53 Z0. >>>>>                                        Here the Z-axis goes up very slowly <<<<<<

(JOB 1 CENTER HOLE RANDOM POINT PATTERN)
(2MM CENTER DRILL)

N03 M06 T1
N04 S1901 M03
ETC.

Thanks,

Jos
Holland

17
General Mach Discussion / Re: Mach3, Probe, and Digitize Wizard Issue
« on: July 05, 2011, 01:04:29 PM »


Hello Vic,

what software do you use for digitizing with your probe?
I have this one;

http://www.youtube.com/watch?v=lp0e9NqmbUI&feature=player_embedded

Under the Imperial screen from Hossmachine it would hardly move.
The screenset delivered with the digitizer did the same, hardly any movement. Certainly not as shown in the movie.

I am in contact with the seller and he will send me a pdf for user instructions.

But for now it works with the Hoss screen.

Thanks,

Jos
Holland

18

OK,
I have it working.
For the Emco5cnc ATC this macro now works.

First of all one has to Home the ATC in Mach3 Manual screen >> Home All.
Then , in Mach3 Auto, load the G-code to be executed.

The macro looks if the Homing has been done and sets a two variables.
One that homing has been done and one to make sure that Mach3 knows that the ATC homing position
is the Tool #1 position.
The hint to use SetVar helped me a lot.

Jos


' Based on Boxford 160TCL Toolchanger Macro.
' Modified for the EMCO5cnc Automatic Tool Changer.
' ATC has a steppermotor and an optical slot @ INPUT1
' Works by turning CW to just past the tool position
' and then CCW into a stop.
' Axis setup as rotary e.g. move 360 = 1 full turn.


If IsLoading() Then
' Do Nothing, program loading
Else

' Dim Variables

Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer
Dim moves As Integer
Dim total_move As Integer

' First check if Homing has been done

If GetVar(300) = 1 Then         ' Has homing been done?
  GoTo Main               ' Yes, is Homed, jump to Main
  Else
End If
 
' If Not, check if ATC is homed.

If IsActive(INPUT1) Then              ' Look for ATC Home pulse
    SensorState = "Active"
Else 
  Message " Input 1 is NOT Active, Home first."
  Code "M30"               ' End G-code execution
 End
End If

If SensorState = "Active" Then
    SetVar(300,1)                    'Is Homed
   Setvar(301,1)            'Set Current Tool as #1
End If

Main

' set up some vars

Num_Tools = 6               
CW_Move_Per_Tool = 62          '360/Num_Tools , not used
CCW_Move = 15

Requested_Tool = GetSelectedTool()
Current_Tool = GetVar(301)
CW_Feed = 700   
CCW_Feed = 700
Current_Feed = GetOEMDRO(818)

' start tool change

Message ("Requested Tool No=" & Requested_Tool)

If Requested_Tool > Num_Tools Then
Message "Requested Tool No. too high, program stopped."
Code "M30"
End
End If

If Requested_Tool < 1 Then
Message "Requested Tool No. too low, program stopped."
Code "M30"
End
End If

If Requested_Tool = Current_Tool Then
' do nothing
Else
' lets do some changing
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = (Num_Tools - Current_Tool) +Requested_Tool

total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)

Code "G91 G94"                'incremental & Feed per minute
Code "G0 A" & total_move               '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move            '& "F" & CCW_Feed

While IsMoving()
Wend

SetCurrentTool Requested_Tool
SetVar(301,Requested_Tool)      'Store Current Tool
Code "G90" ' back to absolute movement
Code "F" & Current_Feed
End If
End If

' end of tool change                                         

19
OK,

With this I have some direction.
I'll have a look at it tomorrow.

Shutting down for the evening it is past 8 o'clock in the evening here.

Thanks,

Jos

20
Never mind the delte the END stament I see where you are heading(;-)

(;-) TP

Yes, that was the idea. End the execution of the G-code and jump to the beginning.
That works.

I wanted to set a sort of register after the statement ; Current_tool = 1. I.E. Homing_Done = 1
But that info is lost every time M6Start is called by a subsequent tool change in the running G-code.

I need to put the info somewhere in a register so that I can have the macro look at it and determine its status.
By a second call to the tool change the macro can fetch its status and skip checking for the initial homing.

Regards,
Jos
Holland

Pages: « 1 2 3 »