Hello Guest it is March 29, 2024, 06:44:54 AM

Author Topic: OEM Buttons ???  (Read 10342 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
OEM Buttons ???
« on: July 14, 2010, 08:44:42 PM »
ANYONE know HOW to create an OEM BUTTON that can be called from VB??

(;-)
Re: OEM Buttons ???
« Reply #1 on: July 14, 2010, 09:15:10 PM »
Terry,
The question does not make sense to me - I'll break it down to explain why...

First I'll try to understand "... create an OEM BUTTON..."

I know you know how to create a button, so I'm wondering: what the qualifier "OEM" is intended to mean in this context?
A button is a screen control object that Mach implements. Mach can do one of three things when a button is "pressed":
1) call a mach internal function
2) run some cypress basic script (FYI - I've stopped calling this "VB" as the language supported is "Cypress Basic" which is not the same as "Visual Basic".)
3) run some gcode

By "OEM BUTTON" do you mean a button that does #1?

Then I puzzled over "... OEM BUTTON that can be called from VB"

A button does not get "called". Cypress scripts can call subroutines or functions. Functions come in two flavors: those built into Mach and those which are defined by a script programmer.

If you mean that you want a Cypress script to invoke the same function that the button would invoke when pressed, just have the script make the desired call to Mach (DoOEMButton()).
(The name of the Mach API "DoOEMButton" is misleading - it would be more correct for it to have been called "InvokeMachFunctionByPassingMagicNumber").

If you mean that you want to create some new function, which is not already part of Mach, then just write it as a sub or function and call it as needed.

As a user, there is no way to define new "OEM functions inside mach" - you gotta change the mach source code to do that.
You can define all the functions you like and call them whatever you like - they just won't be globally known by a magic mach function number.

Dave

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: OEM Buttons ???
« Reply #2 on: July 14, 2010, 10:39:23 PM »
DAVE if in VB I say   DoOembutton(100) I can get a Machfunction. The question was can you create your own OemButton() to do a function(not an internall mach function) AND it be callable from VB or BRAINS for that matter.  That way you only create the piece of code once AND Can call it into use with a simple DoOemButton(444).

"InvokeMachFunctionByPassingMagicNumber should read    "InvokeFunctionByUSINGaScreenButtonPlacedOnaScreenKnownByTheMAGICBUTTONNumber()"  EXACTLY what we were looking for(;-) Can you fix that up for us????

And Yes numbers make perfect sense to a CNC programmer everything we program in is numbers, Gcode,vars,parameters, gotos,subs,etc.

(;-) TP






« Last Edit: July 14, 2010, 10:51:48 PM by BR549 »
Re: OEM Buttons ???
« Reply #3 on: July 14, 2010, 11:04:13 PM »
Terry -
See below
Dave

DAVE if in VB I say   DoOembutton(100) I can get a Machfunction. The question was can you create your own OemButton()

[DB]: No - you (user) can't. OEMButton #s can only be created by changes to the mach sources.

to do a function(not an internall mach function) AND it be callable from VB

[DB]: You can create a function that is callable from a Cypress Basic script
(Yes, I am playing Don Quixote and using my lance to tilt at this wind mil  ;D   Mach does not implement VB scripts - it implements Cypress Basic scripts. While similar, they are different language specifications. Sorry, it's not you, but I'm tired of questions that result from people calling cats dogs and then wondering why they don't bark....).


or BRAINS for that matter.  

[DB]: I'll skip brains calling scripts for now - that's a whole 'nother ball game... and one I have not looked at in some time so I don't really remember the possible brains to scripts connections.

That way you only create the piece of code once

[DB]: You can create it once, and you can store it in one place, and you can call that single copy of the script from any other script, and it will be called in a straight sequential fashion (not an async execution). This is enabled by the new facilities in 3.43.6+  Get the latest programmer docs from the doc page and look up RunScript().

Let presume that you created a function called "DispenseIceCream" and it now lives in a file called DispenseIceCream.m1s on your hard disk.

AND Can call it into use with a simple DoOemButton(444).

[DB]: NO. since you can not make a new magic #, you can't do DoOEMButton(NewMagicNumber).
(however, only a buggy whipper would want to... ...for those wondering, it's a running gag between Terry and I)

What you can do is run a named script. The call would look like:
RunScript(GetMainFolder() & "\TerrysMacros\" & "DispenseIceCream.m1s")


And Yes numbers make perfect sense to a CNC programmer everything we program in is numbers, Gcode,vars,parameters, gotos,subs,etc.

[DB]: Might be time to learn a new trick - or do you also stick to only metal alloys that were available in the era when gcode was defined...  ::)
 
(;-) TP

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: OEM Buttons ???
« Reply #4 on: July 15, 2010, 08:23:21 AM »
HiYa Dave,  HUM

Lets see  I could do this

DoOemButton(444)   (Simple Call)     or

RunScript(GetMainFolder() & "\TerrysMacros\" & "DispenseIceCream.m1s")     (Reminds me of Egyptian hieroglyphics)

Modern is not always better and change for the sake of change is rarely productive. IF the wheel turns smoothly DON"T cut a flat spot in it just because you got a new saw. On the other hand IF the wheel is squeeky and drags a bit DO put some grease in the bearing.

The problem with Brians IS you cannot call a script to terminate a function. Art left that part out of the ladder structure before he retired. AND it would be darn handy to have when you have to do a work around.

Metal as a matter of fact I do still use a lot of chromeoly that has been around for ages and gues what it STILL works great.

Buggywhipper ??  Better to be an old buggywhipper than a GAMEboydriver.   

Take Care(;-) TP

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: OEM Buttons ???
« Reply #5 on: July 15, 2010, 08:41:40 AM »
OK Guys, I was doing alright with this thread and understanding most of it  but wtf is a Buggy Whipper ?.

Tweakie.
PEACE

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: OEM Buttons ???
« Reply #6 on: July 15, 2010, 09:19:19 AM »
Hiya Tweakie, It is a long running joke between us. A buggy whipper is an old machinist that grew up in CNC and tinks and dreams in Gcode. They rarely need a High end Gameboy type graphics program runnning on the screen to know what they are working on OR to know if the machine is doing what it is suppose to do. They have the blueprint in the job package and KNOW how to read it. Buttons with names like like Cycle start, feedhold,block delete, dry run, rewind make perfect sense.

The GameBoy Driver on the other hand HAS to have a full high end graphs display running in conjuntion with full all axis DRO dispayed. That way the machine DRAWS you a picture as it runs so you know where you are at and where it is suppose to go.

 AND you cant push a button unless it is shaded and boxed in. Also the button can't have names they MUST have fancy Icons in order for the NEW cnc machinst to understand what they are for.  Also need are fancy Birght colored flashy things for controlls that constatinly go blinky blinky.

In the old days a Blinking light meant you had serious problems. If you had NO lights blinking you were good to go. SIMPLE concept(;-)

Buggy Whippers understand Numbers in computer code. GameBoy drivers have to have to declare what they useing in stead of a numer and use a substitute then they assign a LONG drawn out abbreviated name to that number substitute so they can remember what is they were suppose to do with it.

Buggy way
  SetParam(10,GetOemDro(10)/2)

Game way

Dim newway as double
Dim NewStylenumberthat youneed to use   as double
Dim Anumberusedasadivisorinyourformula as double
NewwayTO doThings= Getoemdro(10)
Anumberusedasadivisorinyourformula= 2
NewStylenumberthatyouneedtouse = (NewwayToDOThings / Anumberusedasadivisorinyourformula)
SetParam(10,"") & NewStylenumberthatyouneedtouse

(;-) Remember it is a long standing joke don't take it TOO seriously, I do have ALL the respect in the world for Daves work. Even IF it is Gamboyish in nature(;-) AND I hope he knows I will help him get up to speed if he wants to be a real cnc machinist BUGGY WHIPPER style.

 

« Last Edit: July 15, 2010, 09:23:18 AM by BR549 »
Re: OEM Buttons ???
« Reply #7 on: July 15, 2010, 10:07:58 AM »
Hi Tweakie,

Well, I  could give you a overly slanted, one sided explanation as Terry did (although my slant would probably be opposite of his   ;) ).... A buggy whip is American slang for something that is obsolete, and a buggy whipper is one that is reluctant to change with the times.

From wikipedia:

Buggy whip and coachwhip

"A buggy whip is a horsewhip with a long stiff shaft and a relatively short lash used for driving a horse harnessed to a buggy or other small open carriage. A coachwhip, usually provided with a long lash, is used in driving a coach with horses in front of other horses. Though similar whips are still manufactured for limited purposes, the buggy whip industry as a major economic entity ceased to exist with the introduction of the automobile, and is cited in economics and marketing as an example of an industry ceasing to exist because its market niche, and the need for its product, disappears. In discussing market regulation, it is often held that the economy would be disadvantaged as a whole if the automobile had been banned to protect the buggy-whip industry.

Buggy whips are not entirely gone. A resurgence of interest in the international sport of combined driving and historical carriage driving, sports enjoyed by people of all ages, has allowed some buggy whip manufacturers to stay in business, serving this specialty niche market. "

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: OEM Buttons ???
« Reply #8 on: July 15, 2010, 10:35:54 AM »
Terry,

The tools added to mach 3.43.6+ have the syntax they have for good reasons. Yes, they are a more modern approach than being restricted to only naming scripts by numbers (and are still quaintly old fashioned when compared to modern computer science techniques). 

One of the nice things about more modern programming techniques, is that they can be used to do do the buggy whipper approach too. :o

Make your script,
call it 444.m1s
put it in mach's dir
call it via RunScript("444.m1s").

You asked how to do something and got an explanation of how you can do it using the tools recently added to mach.

If RunScript("444.m1s") is to different from your preferred DoOEMButton(444), you have a choice to make....
In this case, you can choose to use the available tools to accomplish what you asked about, or you can choose not to.

If you don't want to use/learn the new features, that's fine too, life's full of choices.

Dave

HiYa Dave,  HUM

Lets see  I could do this

DoOemButton(444)   (Simple Call)     or

RunScript(GetMainFolder() & "\TerrysMacros\" & "DispenseIceCream.m1s")     (Reminds me of Egyptian hieroglyphics)

Modern is not always better and change for the sake of change is rarely productive. IF the wheel turns smoothly DON"T cut a flat spot in it just because you got a new saw. On the other hand IF the wheel is squeeky and drags a bit DO put some grease in the bearing.

The problem with Brians IS you cannot call a script to terminate a function. Art left that part out of the ladder structure before he retired. AND it would be darn handy to have when you have to do a work around.

Metal as a matter of fact I do still use a lot of chromeoly that has been around for ages and gues what it STILL works great.

Buggywhipper ??  Better to be an old buggywhipper than a GAMEboydriver.   

Take Care(;-) TP

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: OEM Buttons ???
« Reply #9 on: July 15, 2010, 10:36:18 AM »
HIYA DAVE good explanation of the term but not the application(;-)  Most all of the "NEW" machines I have seen or run lately seemed to follow the buggy whipper mode so I don't think it is quite obsolete YET. Yes they have improved the actual button switch mode BUT it still says Cycle Start on the button.

There is still a great deal of if its not broke don't fix it "wisdom" loose in the machine world today . Thank Goodness(;-)

BUT back to the original question, The idea was to "USE" an existing function call that is already in use by "VB and Brians". Even if it meant possible EXPANDING its scope a bit. Rather than creating an all new approach that  stilll can't be called from a Brain(;-)

Nothing More Nothing less

« Last Edit: July 15, 2010, 10:45:53 AM by BR549 »