Hello Guest it is March 28, 2024, 02:56:03 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.


Topics - HimyKabibble

Pages: « 1 2 3 4 5 6 7 8 9 10 »
41
General Mach Discussion / New Mach3 v4 VB Interface
« on: October 16, 2009, 09:45:49 PM »
Below is the proposed set of VB functions to be supported in the first release of the Mach3 v4 VB interface, excluding Modbus and Serial.  Modbus will remain unchanged for now, and Serial support will be completely new, but is, as yet, undefined.

All you VB users, please review, and if you see any missing functionality, or have questions about what some of the functions do, or how, please let me know.  The interfaces have been "regularized", to make them more consistent, and in the hopes of making the functions more clear just from the names.  Redundancy has been eliminated, and arguments and return values are now also consistent.  So, for example, in the old interface, FeedRate returned the FeedRate in units/min, but SetFeedRate set the new FeedRate in units/second, the new GetFeedRate and SetFeedRate both operate in units/minute.  The "Is" functions now all return Booleans, rather than Integers.   Overall, it should be FAR easier to learn to write and debug Mach3 macros. 

There are also countless "invisible" changes that will eliminate some of the more frustrating aspects of Mach3 programming.  For example, it should normally *never* be necessary to insert wait loops or Sleeps in the code, as it currently is.  Execution will be far more deterministic, with far fewer hidden pitfalls.

Port/Signal I/O:
Sub AssertOutput(Signal As Integer)
Sub DeassertOutput(Signal As Integer)
Function IsInputAsserted(Signal As Integer)As Boolean
Function IsSignalDefined(Signal As Integer) As Boolean
Function IsOutputAsserted(Signal As Integer) As Boolean

File I/O:
Sub OpenDigFile()
Sub CloseDigFile()
Function OpenTeachFile (Filename As String) As Integer
Function AppendTeachFile(Filename As String) As Integer
Sub CloseTeachFile() As Integer
Sub LoadTeachFile() As Integer
Function GetFileName() As String
Function GetMach3Folder() As String
Sub LoadProgram(FilePath As String) As Integer
Sub LoadAndRunProgram(FilePath As String) As Integer
Sub RunProgram() As Integer
Sub LoadWizard(WizardName As String) As Integer

Screenset/UserI/O:
Function AskUserForDouble() As Double
Function AskUserForText() As String
Function AskUser(Prompt, “Title” As String, DialogType As Integer) As Integer
Sub ErrorMessage(MessageText As String)
Sub TickerMessage(TickerNum As Integer, TickerText As String)
Function AskUserForCoords(Prompt As String) As Integer
Function GetXCoord() As Double
Function GetYCoord() As Double
Function GetZCoord() As Double
Function GetACoord() As Double
Function GetBCoord() As Double
Function GetCCoord() As Double
Sub DoOEMButton(OEMButtonCode As Integer)
Function GetOEMLED(LEDNum As Integer) As Integer
Sub SetOEMDRO(DRONum As Integer, DROVal as Double)
Function GetOEMDRO(DRONum As Integer) As Double
Sub SetUserLED(LEDNum As Integer, State As Integer)
Function GetUserLED(LEDNum As Integer) As Integer
Sub SetUserDRO(DRONum As Integer, DROVal As Double)
Function GetUserDRO(DRONum As Integer) As Double
Sub SetVar(VarNum As Integer, Val As Double)
Function GetVar(VarNum As Integer) As Double
Sub SetUserLabel(LabelNum As Integer, LabelText As String)
Function GetUserLabel(LabelNum As Integer) As String
Sub SetButtonText(Text As String)
Function GetButtonText() As String
Sub SetScreensetPage()
Function GetScreensetPage() As Integer
Sub ToggleScreenset()
Sub ReloadScreenset()
Sub SetTriggerMacro(Signal As Integer, MacroName As String)

G-Code:
Sub SetBufferedCodeState(Boolean)
Function GetBufferedCodeState() As Boolean
Sub Code(Gcode As String)

Machine Control:
Sub SpindleOn(DIR)
Sub DoSpinCW()
Sub SpindleOff()
Sub SetRPM(RPM As Integer)
Function GetRPM() As Double
Function IsSpindleOn() As Boolean
Sub SetFeedRate(FeedRate As Double)
Function GetFeedRate() As Double
Sub Function CoupleSlave(MasterAxis As Integer, SlaveAxis As Integer)
Sub UncoupleSlave()
Function GetCurrentTool() As Integer
Sub SetIJIncremental(Boolean)
Function IsIJIncremental() As Boolean
Sub SetSafeZPos(SafeZ As Double)
Function GetSafeZPos() As Double
Sub GotoSafeZ()
Function IsSafeZEnabled() As Boolean
Sub SetAxisScale(Axis As Integer, Scale As Double)
Function GetAxisScale(Axis As Integer) As Double
Function GetSelectedTool() As Integer
Sub SetCurrentTool(ToolNum As Integer)
Function GetAxisToolChangeStartPos()
Function GetToolDesc(ToolNum As Integer) As String
Sub SetToolParam(ToolNum As Integer, ParamNum As Integer, ParamVal As Double)
Function GetToolParam(ToolNum As Integer, ParamNum As Integer)
Function ToolLengthOffset() As Double
Sub SetParam(ParamName As String, ParamVal As Double)
Function GetParam(ParamName As String) As Double
Function IsInEStop() As Boolean
Function IsProgramLoading() As Boolean
Function IsMoving() As Boolean
Function GetXMaxExtent() As Double
Function GetYMaxExtent() As Double
Function GetXMinExtent() As Double
Function GetYMinExtent() As Double
Sub WaitForTrigger(Signal As Integer)
Sub SwapAxis(FirstAxis As Integer, SecondAxis As Integer)
Sub UnSwapAxis()
Sub AxisJogOff(Axis As Integer)
Sub AxisJogOn(Axis As Integer, Dir as Integer)
Sub FeedMove(X, Y, Z, A, B, C As Double)
Sub RapidMove(X, Y, Z, A, B, C As Double)
Function SingleVerifyReport(Axis As Integer)
Sub SingleVerify(Axis As Integer)
Sub VerifyAxis(Silent As Boolean)
Sub RefCombination(Axes As Integer)
Sub THCOff()
Sub THCOn()
Sub ZeroTHC()
Sub ResetTHC()
Sub NotifyPlugins(Event As Integer)
Function QueueDepth() As Integer
Function CannedCycleRetractMode() As Integer
Sub SaveWizard() As Integer
Function SetAxisFormula(Axis As Integer, Formula As String) As Integer
Sub SetSpindlePulley(Pulley As Integer)

Lathe Only:
Function IsDiameterMode() As Boolean
Function GetToolTurretAng() As Double

VB/Misc:
Function PParameter() As Double
Function QParameter() As Double
Function RParameter() As Double
Sub PlayWave(Filename As String)
Sub Sleep(Time As Integer)
Sub Speak(TextToSpeak As String)
Function GetVBVersion() As String
Function GetMach3Version() As String

42
All,

Below is the first draft of the Programmers Reference Manuals for Mach3 v3.x posted for user comment.  This manual documents almost all of the existing Mach-specific VB functions for Mach3 v3.x.  The Modbus and Serial chapters are still in-process, and will be posted in an updated version shortly.  Everything here has been tested against Mach3 v3.042.020, so, as pointed out in the introduction, you may find some differences with other, particularly earlier, versions.

Brian and I have had a significant shift of focus since this project began a few months ago.  Our original intent was to thoroughly document the existing interface in a Programmer Reference, and add to that a detailed step-by-step tutorial manual, aimed at making it possible for almost anyone to learn to write Mach macros.  However, as we started working on the documentation, we realized the interface itself, as a result of its rather "organic" growth, actually made learning to write Mach macros much more difficult than it needed to be - there were missing functions, duplicated functions, and the function naming and argument conventions had little consistency.  For example, Feedrate() returns the current feedrate in units/minute, while SetFeedRate() sets the new feedrate in units/second.  GetRPM() and SetRPM() don't actually Get and Set RPM, but the S-word value.  In addition, there is the need to insert delays in certain operations, in order to get the result you expect.

As a result, we made the decision that Mach3 v4, while it would continue to support the v3 interface, would also begin the shift to a completely new VB interface with very regular naming and argument conventions, and a GREAT deal more functionality.  This new interface will make it far easier to write well-documented macros, to do more with less code, and to make maintenance and updates of the underlying code far easier.  It will greatly simplify macro writing, and enable you to do many things that are difficult, if not impossible, with the current interface.  And, it will be much easier to learn and use, with far fewer of the quirks that those of us who've done a lot of macro programming have torn our hair out over.

This manual is being published to document what is there now, primarily so that existing macro code can be more easily maintained and, if necessary, extended.  But development on this interface will eseentially cease.  So, what you see is what you get, and there will likely be no further updates or bug fixes to this code.  Instead, all efforts will be focused on the new v4 interface going forward.  The v3 interface will continue to be supported, and you will be able to enable the "legacy mode" on a script-by-script basis.  Once Mach3 v4 is released, it is *strongly* recommended that all new code be written using the new v4 VB interface.

A v4 Programmers Reference will be published in the near future, as a preview of the great things to come.

So, happy reading, and comment away!

Regards,
Ray L.

43
General Mach Discussion / Draft Mach3 v3.x Programmers Reference Manual
« on: October 01, 2009, 11:01:54 AM »
All,

Below is the first draft of the Programmers Reference Manuals for Mach3 v3.x posted for user comment.  This manual documents almost all of the existing Mach-specific VB functions for Mach3 v3.x.  The Modbus and Serial chapters are still in-process, and will be posted in an updated version shortly.  Everything here has been tested against Mach3 v3.042.020, so, as pointed out in the introduction, you may find some differences with other, particularly earlier, versions.

Brian and I have had a significant shift of focus since this project began a few months ago.  Our original intent was to thoroughly document the existing interface in a Programmer Reference, and add to that a detailed step-by-step tutorial manual, aimed at making it possible for almost anyone to learn to write Mach macros.  However, as we started working on the documentation, we realized the interface itself, as a result of its rather "organic" growth, actually made learning to write Mach macros much more difficult than it needed to be - there were missing functions, duplicated functions, and the function naming and argument conventions had little consistency.  For example, Feedrate() returns the current feedrate in units/minute, while SetFeedRate() sets the new feedrate in units/second.  GetRPM() and SetRPM() don't actually Get and Set RPM, but the S-word value.  In addition, there is the need to insert delays in certain operations, in order to get the result you expect.

As a result, we made the decision that Mach3 v4, while it would continue to support the v3 interface, would also begin the shift to a completely new VB interface with very regular naming and argument conventions, and a GREAT deal more functionality.  This new interface will make it far easier to write well-documented macros, to do more with less code, and to make maintenance and updates of the underlying code far easier.  It will greatly simplify macro writing, and enable you to do many things that are difficult, if not impossible, with the current interface.  And, it will be much easier to learn and use, with far fewer of the quirks that those of us who've done a lot of macro programming have torn our hair out over.

This manual is being published to document what is there now, primarily so that existing macro code can be more easily maintained and, if necessary, extended.  But development on this interface will eseentially cease.  So, what you see is what you get, and there will likely be no further updates or bug fixes to this code.  Instead, all efforts will be focused on the new v4 interface going forward.  The v3 interface will continue to be supported, and you will be able to enable the "legacy mode" on a script-by-script basis.  Once Mach3 v4 is released, it is *strongly* recommended that all new code be written using the new v4 VB interface.

A v4 Programmers Reference will be published in the near future, as a preview of the great things to come.

So, happy reading, and comment away!

Regards,
Ray L.

44
General Mach Discussion / VistaCNC iMach/iMachPro pendant Driver
« on: September 15, 2009, 07:49:26 PM »
Below is my Mach3 macropump driver for the VistaCNC iMach and imachPro pendants.  This driver exactly (as near as I can tell) duplicates the functionality of the VistaCNC plug-in driver, but allows the user to customize the functionality to better suit his/her needs. It also allows a great deal more functionality than the plug-in driver, as it supports separate actions for MPG/Action_MPG/DoubleClick for ALL modes, which amounts to about 30% more functions that can be supported. For example, I did a custom version for myself that include the following functions beyond what the plug-in supports:

Zero X/Y/Z/A DROs
X+/Y+/Corner/Z- probing
Mist Coolant On/Off
Jog Speed +/-
Jog Speed Reset

Unlike the plug-in, this driver also allows the iMach and iMach pro to be interfaced through a SmoothStepper or Modbus, with no loss of functionality or performance.

Regards,
Ray L.

45
How can you tell, in a VB script, if a g-code program is currently running?

Regards,
Ray L.

46
General Mach Discussion / Wierd Raggedy Pulsing.....
« on: August 26, 2009, 04:41:39 PM »
This morming I decided to finally get off my lazy butt and ressurrect my old X2 CNC, to use for drilling and tapping.  I grabbed the old E-box off that was on my knee mill until a couple of weeks ago, and the old PC that was running the knee mill until a couple of months ago, installed some G201s, and connected everything up.  After re-configuring Mach, and installing the same version I've been using for months (3.042.020), it's working.  Well, sorta....  kinda....  The Z axis works fine, nice and smooth and fast.  But X and Y are *really* ragged, and very slow.  Funny thing is, they're all running on the same parallel port!  I looked at the pulse timing on Z, and the pulses are nice and consistent, and pretty evenly spaced.  On X and Y, they're all over the place!  How can that be?

I ran DriverTest, and, despite the fact that this is a lowly 540MHz machine, DriverTest says it's excellent, even at 45kHz, though I'm only running 25kHz.  I ran this machine for years on both the X2 and then the knee mill, and it always performed very well, and I never had a single problem that was positively pinned on the low CPU speed (though it is a dual CPU machine).

I also tried moving to a different printer port (I have 3), and they were no better.

So, how can I get good pulsing on Z, and lousy pulsing on X and Y??

Regards,
Ray L.

47
Brian has drafted me to write a real Customization/Macro Programming manual for Mach3 v4.  This will eventually be a complete tutorial/reference document covering everything from creating custom screensets, to writing complex macros, like a toolchanger macros, with detailed descriptions of every Mach-specific function, variable, constant, etc., as well as liberal examples and usage recommendations, to make proper things as clear as possible.  This should make it possible for almost anyone to learn how to write Mach3 macros. 

Since there is much I currently do not know, I suggested that rather than bugging Brian with a bunch of stupid questions, I would first see if I could get what I needed from folks on here, since many of you have actually done more macro programming than I have to date.  I am starting by writing a reference manual for the Mach macro functions.  I have a comprehensive list of what functions exist from the Mach3 source code, along with their argument lists and return values, but I do not know what the functionality of some of them is (like nFmt()??).

So, how many of you are experienced Mach3 macro programmers that can help out by answering some questions?

First question:  What is the difference between StraightFeed() and StraightTraverse()?

Regards,
Ray L.

48
General Mach Discussion / CAT30 vs BT30 vs NMTB30 vs ????
« on: August 10, 2009, 05:17:16 PM »
Are CAT30/BT30/NMTB30 the same, different, interchangeable?

Regards,
Ray L.

49
General Mach Discussion / Setting Tool Length Offsets....
« on: July 24, 2009, 07:09:44 PM »
What is the normal procedure, if there is such a thing, for setting tool length offsets in the tool table for a mill?  Here's what I envision, which may be completely wrong:

Gather up the set of tools to be used for a given job, and one-by-one, probe each tools length, and set its offset into the tool table using G10L1.  When done, probe, using any tool, to set the fixture offset to the top of the workpiece.

Also, when I tried modifying the M6 macros, I found M6End never gets called on a toolchange unless "Stop Spindle, Wait For Cycle Start" is checked.  What's up with that??  How do I write a toolchanger macro if M6End never gets called??

Regards,
Ray L.

50
General Mach Discussion / Are We Losing CNC Vendors???
« on: July 01, 2009, 01:20:10 PM »
I've been shopping for BOBs lately, to replace the bug-infested one I have now, and I'm wondering if some of our suppliers have perhaps gone belly up?  I first wanted to go to Peter Homann.  I found several dead links and other rather obvious problems on the website, which left me wondering he's still operating.  An e-mail has gone unanswered for several days now.  I started looking elsewhere, and stumbled across CandCNC.com.  Their website is an absolute disaster!  MANY dead links, a LOT of obviously wrong and out-of-date information.  Their "Special Deals" expired in Feb 2008!

So, anybody know if these guys are still in business?  Just on vacation?  Have we lost them?

Regards,
Ray L.

Pages: « 1 2 3 4 5 6 7 8 9 10 »