Hello Guest it is April 27, 2024, 06:58:24 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 - rhtuttle

571
Mach SDK plugin questions and answers. / Re: Com Interface Questions
« on: February 18, 2009, 01:23:11 PM »
Good day Jim,

Thanks for taking time to respond.  As to why would I want to connect and disconnect in single session, I use my DIY beveller in several modes.  As such I write modules that are designed to perform specific tasks ( woodworking tasks like mortise and tenons, box joints, dado's and rabbits.  Bamboo rodmaking tasks like mortising reel seats, sawing strips, flaming culms, and of course bevelling individual strips.).  Mostly they generate the gcode automatically but I have conceived of several other uses and have modules to perform those tasks.  Having to restart Mach each time I want to utilize one of these is a PITA.  I could write one master app that does it all but you know how much harder that is to maintain.  I guess I could write one that calls dlls for each task and reuses the scripting object but it just would be nice if the com objects would play nice and allow for connecting and disconnecting like you would expect. 

Every time I try to do something out of the ordinary I get stymied.  I would like to write some new screens but screen4 won't work on the vista64 bit machine that I use for development.  Jason's controls are at this time are still limited.  My attempts at creating Dll's accessed by VB scripts is fallling short since I can't seem to get access to the main Mach hWnd to allow for new forms/windows.

After 20 years of programming in object pascal I am loathe to pay for another development environment and relearn C++ just for this when I have access to the interface.  Even then I don't think you can change plugins on the fly easily (maybe I am missing something here).

Sorry for the rant but it's just one of those days. 

RT

PS I have looked at your examples many times and you are to be lauded or your work.  I have SDK 2.62 which I think is the last version.  My type library generated from mach matches you scriptObject.

572
Mach SDK plugin questions and answers. / Com Interface Questions
« on: February 17, 2009, 04:49:43 PM »
I am experiencing some difficulties using the  com interfaces:
        mach:=TCMach4Doc.create(self);
        mach.ConnectKind:=ckRunningInstance;
        mach.Connect;
        iMach:=mach.GetScriptDispatch as iMyScriptObject;

It instantiates and connects to a running instance fine.  I am able to utilize all of the functions and procedures of the scriptObject.
If however I try to disconnect and then reconnect, Mach fails and closes.  If I set my mach variable to nil, mach fails and closes.  If I close my app, Mach fails and closes. 

If I use a connectKind of ckNewInstance I get a dialog box with several unknown profiles.  I can create a profile but then I get an invalid license prompt, followed by a user agreement dialog and then several failed dll calls.

How robust are the interfaces? 
Has reference counting been implemented for each new interface?
Am I using these incorrectly?

TIA

RT

PS.  I have written several com applications and am able to utilize com interfaces with many other applications like M$ excel,word, powerpoint. 

573
VB and the development of wizards / Probe macro
« on: May 08, 2008, 01:58:22 PM »
This is my first attempt at writing a macro for Mach3.

All suggestions welcomed.

My approach is to take my home made probe that has 3 contact points, one on each side on one for the top.
The probe straddles the workpiece which is narrow.
I will be using the A-axis limit input to determine when the probe has made contact



sub Main
  dim yStart,yMin,ymax,yMid,z as double;

  rem get the yAxis value
  rem increment until probe connects

  yStart=getOEMdro(86)
  yMax=yStart
  while not getOemLed(837) do
    yMax=yMax+0.0001
    Code "g0 y"&yMax
  wend;

rem reset and go the initial yAxis value
rem decrement until probe connects

  yMin=yStart
  code "g0 y"&yStart
  while not getOemLed(838) do
    yMin=yMin-0.0001
    Code "g0 y"&yMin
  wend;

rem calculate midpoint and move to it
rem set yDro to 0

  yMid=yMax-yMin
  code "g0 y"&yMid
  setOEMDro(801,0)

rem get the zaxis value and plunge until probe connects

  z=getOemDro(802)  ' zDRO value
  while not getOemLed(839) do
    z=z-0.0001
    Code "g0 y"&z
  wend;

rem Set the z dro to the standard's height

  setOEMdro(802,1)
end sub


574
G-Code, CAD, and CAM discussions / Newbie basics
« on: February 26, 2008, 05:14:12 PM »
I hope this is the right area to post this question.

As someone new to CNC I think one example would help me a lot.  If someone has an example of the following and is willing to share I think I can glean a lot of what I seem to be missing.

2 pieces of code.

first: code for a router based machine to mill a 3/8 by 1 inch mortise 1/2 inch deep using a 1/4 inch straight bit.
second: code for a matching tenon.

Assume that the the workpieces have been set up with x and y at lower left corner of 3/4 by 2 in piece with z zeroed at the workpiece surface.

Dimensions are not critical, just the process.  Multiple passes, finish pass, direction of cut.

If this is a unreasonable request let me know.

Also, is there a book or site that you could recommend that might cover such processes?

TIA

RT