Hello Guest it is March 29, 2024, 10:15:21 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 - David Thomas

Pages: 1
1
VB and the development of wizards / Re: Macro only runs in editor
« on: October 20, 2016, 05:58:23 PM »
The problem actually came down to how I had the button configured, I configured it to standard code 34.

2
VB and the development of wizards / Re: Macro only runs in editor
« on: October 20, 2016, 07:50:41 AM »
Thanks for the input High speed and Stirling,
I will remove the SubMain() and End Sub, give it a try.

I would rather not run it in a macro pump it was just a trial. I am collecting the data to correlate DRO data with vibration, temperature and spindle load Data. This is somewhat a science project but it is very interesting to see the data and how it reflects quality and processing time.

Thanks again for the feedback

3
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



                 

4
VB and the development of wizards / Re: Export DRO values (again)
« on: October 01, 2016, 11:22:13 AM »
This is the macro that I am trying to use. It works as an Mcode but not as a macro pump. any ideas?

Private Type SYSTEMTIME

Year As Integer

Month As Integer

Day As Integer

Hour As Integer

Minute As Integer

Second As Integer

Milliseconds As Integer

End Type

Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)

Public Function GetMySecond() As String

Dim tSystem As SYSTEMTIME

Dim sRet

GetSystemTime tSystem

sRet = Format(tSystem.second, "0000")

GetMySecond = sRet


Open "c:\TESTFILE.txt" For Output As #1 ' Open to write file.

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

 Write #1, oldX , oldY, oldZ, oldl
 
   While GetoemLED (999)
 
     newx = GetOEMDRO (800)
     newy = GetOEMDRO (801)
     newz = GetOEMDRO (802)
     newl = GetOEMDRO (816)     

 If oldX <> newX Or oldY <> newY Or oldZ <> newZ Or oldl <> newl Then
  oldX = newX
  oldY = newY
  oldZ = newZ
  oldl = newl
  Write #1,"X",oldX ,   "Y",oldY,   "Z", oldZ,   "Line",oldl
 
     End If
 
Wend
Close #1

END Function   


5
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.

6
General Mach Discussion / Re: G04 hangs up
« on: August 30, 2016, 06:40:33 PM »
Thanks Rob, I think I just got it fixed, I used auto tune for the step counts, and I accepted a value with a decimal. Apparently using a non whole value messes up the controller.

7
General Mach Discussion / Re: G04 hangs up
« on: August 28, 2016, 07:15:51 PM »
Thanks for the very quick response Gerry!

I uninstalled Mach3 and did a clean install, I then loaded the Machmill profile, With nothing configured I loaded the Gcode test and it worked ok. I configured the motion controller plugin, ran the test and it was ok. I then configured each axis motor and ran the test at each configuration and it was good. With everything configured and ready to run I ran the test and it worked ok no more G4 problems. I powered down the controller and the PC. The G4 problem is back. I tried every Machmill.XML back up and the problem returned in each one. I loaded an unconfigured Mill profile ran the test and it worked ok.

8
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






9
VB and the development of wizards / Re: Macro Linear move help
« on: April 22, 2013, 11:10:41 PM »
Thanks BR for the reply, I see that I have mis wrote my question,

I my part program I need to write G0 x(value) and G0 z(value) on two separate lines many many times. I would like to have 1 macro number say M9999 with x(variable)  and  z(variable) and move linear.
Example
N10 M9999 X5 Z10 = X moves to 5 then Z moves to 10
N20 M9999 X15 Z2 = X moves to 15 then Z moves to 2
N30 M9999 X11 Z22 = X moves to 11 then Z moves to 22
M30

Thanks again for your help
Dave

10
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