Hello Guest it is April 24, 2024, 06:11:29 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.


Topics - David Thomas

Pages: 1
1
VB and the development of wizards / Macro only runs in editor
« on: October 19, 2016, 06:45:36 PM »
Hey all, I have been working on this script and it will only run within the editor. I tried to run it in the Macro pump and via the part program as "M1000". As a Macropump it does nothing as M1000 the program halts at the M1000 command.

I created a button to call the script and it also halts the Gcode from processing.

I added the DoOEMbutton (1000) to the script for testing and it works perfectly.

Any help would be appreciated.

Sub Main()
SetuserLed (1003,1)

Open "c:\TESTFILE.csv" For Output As #1 ' Open to write file.
Dooembutton (1000) 'added to  test the script

oldX = GetOEMDRO (800)
oldY = GetOEMDRO (801)
oldZ = GetOEMDRO (802)
oldL = GetOEMDRO (816)

Write #1, "X", "Y","Z","Line","Time","Date"
Write #1, oldX, oldY, oldZ,oldL, Time (Now), Date()

Do While GetoemLED (804)
 
newx = GetOEMDRO (800)
newy = GetOEMDRO (801)
newz = GetOEMDRO (802)
OldL = GetOEMDRO (816)
       
If oldX <> newX Or oldY <> newY Or oldZ <> newZ Then
   oldX = newX
   oldY = newY
   oldZ = newZ
   OldL = oldL
 
Write #1, oldX, oldY, oldZ,oldL, Time (Now), Date()
End If
     
'Filter timer - a low value will collect more data points
'a high value will collect fewer data points
'1 sample per second = 1000, 10 persecond = 1

Sleep (500)
Message "Recording Started"     

Loop               

Close #1
SetuserLed (1003,0)
Message "Recording Stopped"

End Sub



                 

2
VB and the development of wizards / Export DRO values (again)
« on: September 29, 2016, 04:39:25 PM »
Hello all,

I have read through the post in regards to exporting the DRO values and I cant seem to make it work all that well. so I hope maybe I can get some assistance with VB. here is exactly what I need to end up with... I need to export the X,Y,Z part coords and the line number DRO. I also need a system time stamp in milliseconds for each value. The XYZ and Line values can be on a single stamp.

This will run in the macro pump so I will need to add a on/off button to only activate the recording when I need it. I know how to add buttons and leds to my screenset. I just have no experience with VB.

If I could export the information to excel that would be the cats meow!

Thanks in advance for any help! Dave T.

3
General Mach Discussion / G04 hangs up
« on: August 28, 2016, 03:33:54 PM »
Hello all, I am setting up a (new to me) router. I have all the axis motors and I/O working properly. When I first started the spindle M3S5000 it powered up and ran to speed, The dwell LED continues to flash for several minutes.  I entered M5 and the spindle stayed powered up. I hit reset and the spindle stopped. I wrote a small program (below) and it looks like the problem is actually with the G04 timer.

Spindle dwell parameter is 0

N10 G04 P5
N20 M3 S5000
N30 G04 P5
N40 M5

The program hangs at N10 so the spindle never turns on, The dwell LED flashes till I hit reset.

Does anyone have any idea what the problem could be?

Thanks in advance, Dave

Windows XP
USB motion card HXC MK4
Chinese VFD and Stepper drives
Mach3






4
VB and the development of wizards / Macro Linear move help
« on: April 20, 2013, 07:53:31 PM »
I have created this macro... I want Z to move then X to move. When I write Z2 X3 Both X and Z move at the same time. If I write Z2 and X3 within the macro X moves then Stop then Z moves.

What am I doing wrong?

G Code is M178 Z3 X2

Message"Moving to Plunge Cut Position..."

Code "G0 Z #" 

While IsMoving()

Sleep(250)

Wend 

Code "G0 X #"
 
While IsMoving()

Sleep(250)

Wend

Message "Arrived at Plunge cut Position"

Pages: 1