Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Ya-Nvr-No on May 06, 2014, 06:08:35 PM

Title: Screen Set Ideas
Post by: Ya-Nvr-No on May 06, 2014, 06:08:35 PM
Thought Id show a couple screen ideas I am working on, so others might get some inspiration of their own.

Possibilities are endless.  8)
Title: Re: Screen Set Ideas
Post by: Brian Barker on May 06, 2014, 06:21:21 PM
Nice work! you are a mad man!
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 07, 2014, 07:36:56 AM
Thanks Brian and Steve
Your team has made it possible, its up to us to push, explore & create our own environment. Providing you with more work to keep up with our needs.
Get ready for grey or no hair ;D


Wanted to enlighten all, to the ability at looking at the root of the script, that is the Screen.set.

If you change the name of your screen set from dot set to dot zip
then Extract the zip file to a new folder you will find a folder named "images" with all the inserted graphic images

I find it easier to edit and add to the images folder this way.

You will also find a file called 'screen.xml"

The screen.xml file is the core of all the scripting code and the attributes of the controls. This file can be edited, it is a text file. Open with any xml editor or program that formats the file correctly and saves it as a text file. Make any edits you need or like. When done, select both the file and images folder and "Add to Archive" make them a zip file again. Rename the zip file back to the dot set extension.  You can put it back in the Screens folder, but I don't believe you have too.

Now to figure out how to merge two or more sets. My thinking is as individuals share their sets, and we would like to add some great features to our set. What is the best way to merge the data? Remember property device names can not be the same. And grouping is critical.

Image below shows a content clip of the xml file

Have Fun, keep exploring :)
Thanks again
Title: Re: Screen Set Ideas
Post by: BR549 on May 07, 2014, 10:39:10 AM
SAY WHAT ???????

(;-) TP
Title: Re: Screen Set Ideas
Post by: Jeff_Birt on May 07, 2014, 11:13:44 AM
For the love of God don't manually edit screen sets!!!!!

That is a sure way to cause endless problems, seriously.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 07, 2014, 11:45:59 AM
I learned this feature because I'd created an endless loop in the PLC Script and had to edit the xml file to make the screen set functional again.
Also used it to set position of buttons, led and dro's I find the the alignment features a pain at times. Would be nice if there was a nudge feature to move items using the arrow keys. Moving a selected group with a mouse is a bit touchy.
Title: Re: Screen Set Ideas
Post by: BR549 on May 07, 2014, 12:04:42 PM
HIYA Craig you must have never used SCREAM4 for screens this one is a piece of cake  ONCE you learn what buttons to push. Now there COULD be some improvements made to the Screen editor but we can cover that later on.

Good to know that it can be done though, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 07, 2014, 12:08:58 PM
Ya I thought this would be a great project for Klaus  the new version machscreen4
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 09, 2014, 06:05:56 PM
Got this idea from a great screen Illya created for his Modbus GUI interface  ;)

Made this to be a little more PLC Generic

Labels can be edited to suit future development.
Title: Re: Screen Set Ideas
Post by: Illya on May 09, 2014, 07:37:34 PM
Got this idea from a great screen Illya created for his Modbus GUI interface  ;)

Made this to be a little more PLC Generic

Labels can be edited to suit future development.


I use the following lua script to toggle output buttons great for diagnostics to test if they work :)

http://www.machsupport.com/forum/index.php/topic,27199.msg191959.html#msg191959
Title: Re: Screen Set Ideas
Post by: Overloaded on May 10, 2014, 12:05:48 AM
I find the the alignment features a pain at times. Would be nice if there was a nudge feature to move items using the arrow keys. Moving a selected group with a mouse is a bit touchy.

Have you tried the "Snap to Grid" function ?
I played with it a little bit and it seemed to allow quite precise positioning.

Russ
Title: Re: Screen Set Ideas
Post by: Overloaded on May 10, 2014, 12:11:16 AM
You can also use the Ctrl and up, dn, lt, rt. and items will move the entered grid increment.

FYI,
Russ
Title: Re: Screen Set Ideas
Post by: ger21 on May 10, 2014, 07:07:39 AM
You can also use the Ctrl and up, dn, lt, rt. and items will move the entered grid increment.

FYI,
Russ

Very handy, but there's a minor bug. When moving the control using CTRL+arrow keys, the position in the properties doesn't update until you click another control. I'll post this in the bug reports section.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 10, 2014, 09:05:42 AM
Have not used the grid as of yet, but what is it set too, and how do you change the grid step size?
Title: Re: Screen Set Ideas
Post by: ger21 on May 10, 2014, 09:23:51 AM
Upper left corner, change "Freehand" to "Snap to Grid".
Grid setting is right next to it.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 10, 2014, 09:27:54 AM
Opps, guess I should have looked, thanks Gerry

Now if I could just select multiples by boxing them instead of using Ctrl select for each.
Title: Re: Screen Set Ideas
Post by: Overloaded on May 10, 2014, 09:41:50 AM
Now if I could just select multiples by boxing them instead of using Ctrl select for each.

Now that would be very handy, I made a mess trying to figure that out.  :)

Russ
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 24, 2014, 11:17:09 PM
Added a tool change button, enter in new tool, press button, follow screen history messages to complete for manual tool change.
Title: Re: Screen Set Ideas
Post by: ger21 on May 24, 2014, 11:33:21 PM
How about sharing some of this code? ;)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 25, 2014, 06:32:55 AM
 ??? :o WHAT? Your the Screenset salesman you should be showing us how to do all this.  ::)

I've posted many snippets of code, ideas to inspire and show, it is not that difficult.
Is my screen set sale-able like yours? or you just looking for someone else to do the work?

Sorry Gerry your the last guy I would have thought, to ask that.
If you wanted to trade code you could have PM'd me.  :-\

Don't get me wrong there is a long time between now, and production ready for mach4
I'm  just taking this opportunity to get a jump on Lua programming and creating a few
screens features that would work for several applications and ideas I have in the works.

The code that Scott has written is fantastic for making it easier to address some of the tedious details.
Nick has provided some inspiring code snippets that drove me down a new adventure.
TP has poked a stick at the bear, and gotten me more involved with the probing scripts.
Illya modbus screen was an eye opener to the Modbus interface.
I'd never worked on modbus before but attempted it and now from that understand more
and found how easy it was to Write and Read to the Registers giving me a new tool to
share information to my MPG Wizzard for example.

Brian and Steve have provided us a whole new platform. New revisions and upgrades to Mach4 are now happening
I might find that my code wont work with the new LUA 5.2 and wxWidgets 3.0  
Just discovered this last week the Lua call stack and how vast and informative it can be.
I'm a bruised up kid in a ice cream shop with a big spoon. ;D
Give me more!


Title: Re: Screen Set Ideas
Post by: ger21 on May 25, 2014, 07:28:38 AM
That's fine. I'm not looking to copy code, just wanting to learn.
I don't know Lua, and don't have the time to learn it right now. I probably won't have time to get into it for another year or more.
I'm just trying to read every Mach4 post here and slowly get a basic Lua understanding, so that when I do have time, it might come a little easier..
Title: Re: Screen Set Ideas
Post by: RICH on May 25, 2014, 08:15:11 AM
Craig,
Thank you and all the others for posting anything on Lua coding. The examples are mounting and at some point I will start
the "study" of info and comments to enlighten myself.  So whatever is posted sure is a help.

I am the kid that is crying and at the back of the ice cream line wondering if the shop will give me a 1/4 of a cone.    :D  :D
Qoute from a Godfather movie..........."Just want a little to wet my beak, surely you understand"   ;D

RICH
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 25, 2014, 08:23:43 AM
No problem guys, a month or so ago I could not ever spell Lua  ::)
Title: Re: Screen Set Ideas
Post by: Fastest1 on May 25, 2014, 09:34:41 AM
I am at the point of still waiting on the beach, expecting a cooked in the earth pork product to be served. Are we in Hawaii? Isnt that what a Lua is? ;-)
Title: Re: Screen Set Ideas
Post by: poppabear on May 25, 2014, 11:58:09 AM
Quote
The code that Scott has written is fantastic for making it easier to address some of the tedious details.

thanks, I am glad someone is getting some benefit from that module!!

On Learning Lua....  From my own personal opinion.....   Tables are your friend! They are Crazy powerful and adaptable to all kinds of stuff. they are like a Container class, in which you can make tables (and tables within tables), act like a Class in a language that uses classes.  IMHO, "Modules" are a way to add "classes" to extend Lua.
For those wanting to learn Lua, it is WORTH you time to look at this website:

http://lua-users.org/wiki/SampleCode

Scott
Title: Re: Screen Set Ideas
Post by: ger21 on May 25, 2014, 12:06:48 PM
I've been programming in VB for 10-15 years, and still don't know what Classes are or how really to use them. :)
I learn what I need to know to get done what I need.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 25, 2014, 07:02:17 PM
been working on a variables tab and noticed some inconsistencies, not sure if it is an issue with internal calculations or just a convoluted mix-up.
variable number on left
values on right
Title: Re: Screen Set Ideas
Post by: BR549 on May 25, 2014, 08:41:53 PM
Craigs a LOT of the #vars are set to machine corrds not work coords. Check that out first.

Just a thought, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 25, 2014, 08:46:14 PM
my point was they were out of sequence
Title: Re: Screen Set Ideas
Post by: poppabear on May 25, 2014, 08:46:56 PM
Can someone test this? I am trying to get and set of ToolPath colors... not having any luck, sometimes the set works, but mostly the Get will Crash the lua interpreter.
Can someone look over this code.

function TestFunc()
        local inst = mc.mcGetInstance();
        local rc = 0;
   local OldTopColor = 10485760;
   local OldBottomColor = 8404992;
   local rc = 0;
   
   rc, OldTopColor, OldBottomColor = mc.mcToolPathGetBackColor(inst);
   mc.mcToolPathSetBackColor(inst, 16777215, 0);
   --mc.mcToolPathUpdate(inst);
   mc.mcToolPathGetBackColor(inst, OldTopColor, OldBottomColor);
   --mc.mcToolPathUpdate(inst);
   local dummy = 0;  
end

if (mc.mcInEditor() == 1) then
    TestFunc();
end
Title: Re: Screen Set Ideas
Post by: smurph on May 25, 2014, 09:11:53 PM
mc.mcToolPathGetBackColor() has a bad binding.  Thanks for finding that Scott!  It will be in the next update.

Steve
Title: Re: Screen Set Ideas
Post by: poppabear on May 26, 2014, 10:22:17 PM
Hey Steve,

I suspect if there was a bad binding in ONE color func, the others may also be buggy...

Scott
Title: Re: Screen Set Ideas
Post by: smurph on May 26, 2014, 11:24:39 PM
I found and fixed over 15 of them!  All bad bindings.

Steve
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 27, 2014, 02:35:44 PM
Did manage to get persistent DRO's to work but it took a lot of coding, hopefully next revision will resolve this issue. My plan this week is to cut some parts with Darwin.
Now write and read variables to the machine.ini file. Write by button, Read by the Load Script
Title: Re: Screen Set Ideas
Post by: poppabear on May 27, 2014, 03:24:12 PM
I found and fixed over 15 of them!  All bad bindings.

Steve

THANK YOU STEVE!!!!!!!!!!!
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 30, 2014, 12:33:27 PM
Added a start/stop timer and the Screen.set Profile name.
Title: Re: Screen Set Ideas
Post by: poppabear on May 30, 2014, 03:41:22 PM
hummm, who wuda thunk it about putting the screen set name............. :)

scott
Title: Re: Screen Set Ideas
Post by: BR549 on May 30, 2014, 04:49:33 PM
Does that mean that Craig was born in 1955 ??

(;-) TP
Title: Re: Screen Set Ideas
Post by: Overloaded on May 30, 2014, 04:59:34 PM
Added a start/stop timer and the Screen.set Profile name.

Cool stuff !
I also found an early need for the .set name. Had several different screens for different experimental purposes and wanted to know which was loaded as some were very similar.
Mine was not so elegant ... just plopped a dummy button in the corner with a label depicting the screen name. ::)

Craig, I hope you have your screen ready for sale bout the time 4 is released. :)
It must be pretty impressive by now.

Thanks,
Russ
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 30, 2014, 06:42:55 PM
No Terry few years before that, just when I happened to hit the button good guess thou.

Russ, Ya-Nvr-No I might be ready before them.  ;)

how to get the Screen name (placed in the the PLC script)
you do have to create the text and label on the screen page and give them the correct name.

    ScrName = mc.mcProfileGetString(inst,'Preferences','Screen',ScreenName);  --Screenset name
    scr.SetProperty('lblScreenName', 'Label', ScrName);
Title: Re: Screen Set Ideas
Post by: BR549 on May 31, 2014, 10:18:30 AM
IF you just need something to do how about a TIME to next tool change button. THAT is a NICE one to have when you are a 1 man show. You can plan your time to match the tool changes or program end.

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 31, 2014, 11:46:56 AM
If you can tell me how i could compute/predict the future tool change.

Is that something your controllers do?

I use an output to turn on my stack light a few lines before it happens, or you could send it to your shock collar. ;D

Or schedule your naps better.
Title: Re: Screen Set Ideas
Post by: BR549 on May 31, 2014, 01:53:38 PM
Well actually YES it can tell me the time to the next tool change. It basically finds the next TC and gets the Line Numbers between where you are and where it ends and runs the sim to caluclate the time based on Feedrate and inches traveled.

Modern controllers are pretty high up on the Operator functions so do you want a Cadillac or a modelT .  Heck in mach3 we could find the next tool change and get the next tool #.

No nap for you, get busy. (;-)  TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on May 31, 2014, 02:48:59 PM
What part of bend over and beware... are you missing? ;D

Now that your a Lua coder its up to you now, how you want create your wake up calls.
Title: Re: Screen Set Ideas
Post by: BR549 on May 31, 2014, 03:21:41 PM
Maybe a LUA Cobbler but NOT LUA coder.

I am still waiting for LUA "sockets" so I can do a "M4 Call Home" where it sends you an email to report errors/end of program.

AND YES we had it in MACH3.

I vote for a Cadillac , (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 06:46:00 AM
added a parts counter feature
created a M60 script some screen features and
added this to the end of the PLC script

    partscounter = mc.mcCntlGetPoundVar(inst, 3901);
    scr.SetProperty('drovar3901', 'Value', tostring(partscounter));
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 10:56:11 AM
HIYA Craig,  looks good(;-)

Hopefully the parts counter will be an internal function that you do not have to create.

Unless Steve changed it the G65  E  local var #8 is a reserved word. Mach4 uses it for the EXP function.

I vote to send that # var script to Steve and let them put it in Mach4 permanantly.

(;-) TP

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 01:12:33 PM
Even in Fanuc you have options to set. they don't come in the door without needing set up
that's why most companies get it turnkey or have a written contract of all obligations, before final payment.
If your buying used, better know what questions to ask what options are on it and what to look for.
what parameter to look at to see what the backlash is set too, or the system & run hours, and then how to set the time and date using the parameters not the user screen. See the number of total parts ran, what the lube pump and conveyor time is set to. Its all in there its just a matter of knowing where and what it all means. that's why most of fanuc's books are close to an 1" thick and there are several. and they don't provide you all of the parameters descriptions or hardware interfaces. Or you get documentation that says one thing and you find out its a mistake. Good luck getting that corrected.

3901 is the parts counter
3902 is parts required
3000 Alarm
3001 Clock in ms
3002 Clock in hour

3011 is the year,month,day
3012 Hour, minute, second

(the problem is the pound variables are numbers and date and times are strings)
Will have to convert the date and time to a number and then back to a string so you know what it represents.
kind of like what I did to create the start and stop timer.

the M60 mcode will have to be created so it knows what variable to increment.
some way to reset the counter. A way to set parts required.
Other mcodes that you use to interface with other outputs or used as syncing codes with a gantry loader and palatalizing units
Spindle orientation, mcodes for spindle lock, lift stations, clamping, blowoffs, turnarounds, inspection interfaces, tail-stock quill movements, load cells, air & hydraulic sensors and the list goes on and on.

Months maybe years yet to go to be industrial ready. But it just might be your only option, have not heard anyone else take on an elephant this big for the hobbyist/home builder/oem

If nothing else it gives you something to do. hate to see anyone bored. ;D
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 02:35:54 PM
The fanuc part counter does not require you to add any Mcodes to make it work. I believe it just counts the program M99's as they go by.I believe it also is cofigureable to count program m99s or Sub mm99s. Set the correct parameter.


The control manf does NOT know exactly how the OEM is going to set up their machines they just provide a MEANS to do so.

Trouble is we do not HAVE those Fanuc #vars (;-) or parameters .

As to set up YES you have to set the proper parameters BUT you do NOT have to write Scripts for your CNC functions THAT is done at the controll Manf.

Once the machine is setup ALL the OP has to do is program the Gcode and RUN the program to make parts
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 03:30:10 PM
all I can say I been doing controls for lot of years now and there is a mcode that has to get setup buts its up to you what you want to use.
I never use M99 for part counters, counter intuitive to functional programming. You might want to read the manual again, might be missing some real nice features. I have Fapladder and I can make it do anything i want too within reason its all about bits, ya have to love ladder.

The parameters are there, just not quite the same as this is a PC and not a PLC so they have not been address as of yet or can be quite the same.
And no matter their just a holding cell for information. Its up to you what you put in them. So if you dont want to follow Fanuc numbering system have at it.

thats why i get calls to come back and add features and I/O as they learn what the limitations are and want more functionality.

I have to write scrips to orient a chuck. their just called gcode. Still need to set some parameters that let the controller know what it need. Scripts to re-reference a paletalizer.

Different duck, Different quack but same crap in the end.
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 04:05:03 PM
OK right out of the Fanuc manual, you can create and  use a M60 if you want but I am going to let the Control do all the work(;-)
Param#  0040.3 = 1   (disables M2/M30 counting)
Param#  0219    = 99 (M code for counting # of parts, 0=not used)

The Part Counter #var may also vary with Models of the control

You can also turn BOTH on for a single cycle part count.

QUACK QUACK, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 04:13:23 PM
your getting the idea
fanuc is full of quack quacks
now we have mach4 a new duck
I can create my own M7734 for what ever in fanuc
ladder dont care
ya just have to have access to it.  >:D
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 05:01:58 PM
NO , YOU have a new duck. as soon as this TEST experiment is over I go back to the PIG PEN where I belong. All this Game Boy programming makes my head hurt and burns up WAY TOO MUCH TIME. I have parts to make and chips to sling, Beads to weld and pretty Metal Metal  art work to cut.


NOW IF you get tired of the Fanuc QUACK there is always HAAS. A very much IMPROVED Fanuc(;-) Probaly more of a TWEET TWEET

OWINK OWNIK , (;-) TP
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 05:17:51 PM
IS there a way in the SCREEN to set the {TAB} ORDER of each page,box,etc. Right NOW the screen is NOT {TAB} friendly.

Just trying make the screen keyboard friendly for the NO MOUSE users. (Yes that is ME as well)

If it has a mouse(PC) leave it at the house.

(;-) TP
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 05:27:33 PM
OK never mind that question.

 Mach4 does NOT even do {TAB} to the object (button) and {ENTER} to DO. IT is mouse or nothing .  :'(

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 06:19:43 PM
I've worked on HAAS MC and TC too, lot more bells and whistles. Same smelly coolant and way lube. Just a lot prettier screen set with more to play with.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 10:36:35 PM
Added ms timer & Date and Time parameter values
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 10:53:35 PM
NOW if you can create the CURRENT TIME and DAY and DATE I would know when to go take my coffee break  (;-) AND verify it wasn't Saturday.

Good Job, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 02, 2014, 11:03:18 PM
That is the time and date calculated from the pound variable #3011 show in real time as does the ms timer. Use a push button to start and stop. I added a second button for cumulative times.
So you can see how long you were on that nap you call a coffee break   :D
Title: Re: Screen Set Ideas
Post by: BR549 on June 02, 2014, 11:59:12 PM
You really expect me to be able to SEE that. I need a FULL page display WITH very large FONT.  I did have a TOOL change blinkin page with Mach3 one time it was a FULL page LED blinking. I could see it across the shop. Every one knew it as the One Eyed Blinky Monster.

Took too much teasing over that one HAD to take it OFF.

(;-) TP
Title: Re: Screen Set Ideas
Post by: BR549 on June 03, 2014, 12:26:53 AM
OK How would you get sys Time date and DAY to display ??

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 03, 2014, 07:12:53 AM
How about something like this  ???
Title: Re: Screen Set Ideas
Post by: BR549 on June 03, 2014, 10:54:57 AM
NOW THAT is more like it. Now how about the day ???   That takes a table as far as I read.

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 03, 2014, 11:08:42 AM
What part of "Tuesday" is not the day?  ::)

        ibDay=os.date("%A", DateTime);


Just messing with ya  ;D
Title: Re: Screen Set Ideas
Post by: BR549 on June 03, 2014, 12:57:43 PM
I am like everyone else I just look at the FIRST picture or read the FIRST line of a responce
GOOD Job.

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 03, 2014, 01:55:43 PM
Started working on the Lathe Screen Set, same thing for the most part just a lot of editing. And the Tool routine is different of course.
Title: Re: Screen Set Ideas
Post by: BR549 on June 03, 2014, 08:27:17 PM
HEY how come THEY get Spindle orientation (M19)

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 03, 2014, 09:27:09 PM
Its just another mcode, its up to the controller and drive to know what to do with it.
Like the sync codes that keep the gantry and Turning Center working hand in hand and the mcodes to control added blowoff outputs.
I had to add flip stations and a turnaround mcodes to produce these odd shaped parts. On the gantry side it Does a Side A-A to Side B-B process cycle.
so while it is machining the second part side A it is doing a rotate and flip of the first part for side B machining.

One gang style tooling machine and one turret style system. So the machining is reversed for each machine due to the tool locations.
Both machines needed ladder editing and hardware upgrades.
Fun project. One machine used T04 the other uses T0404 for tool changes Its all about the controller.
One cuts using M03 the the other M04 and of course the X dimensions are reversed. Had to keep the tooling standard as they were special grinds and stroke limitations in X.

And you can have spindle orientation in mach4 too, just have to have a means to move and check the rotary position and then write a script. Helps to have a spindle brake and a way to spin and blow the jaws and part off before load & unloading. I love automation and walk away manufacturing.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 04, 2014, 05:44:11 PM
Tool Touch off and Setting of Offsets for Tool Table
Plus the ability to call up and edit the Tool Table
and can do a Tool change with MDI button
Title: Re: Screen Set Ideas
Post by: RICH on June 05, 2014, 07:15:33 AM
Quote
Started working on the Lathe Screen Set

How about something like attached to fool with?

Not sure what is currrently in the works for a Mach4 Lathe screen.
Been 4 months since attached was posted. Need to see what the tool probing routine will be like since  the tool info
screen was done on best guess at the time.

RICH
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 05, 2014, 08:14:43 AM
those are cool Russ, ( :-[ Opps... Sorry Rich) lots to view that's for sure. you've had a jump on this.

I'm late, coming to the game. (you create or MM?)


edit: I can just fix em  ::)
Title: Re: Screen Set Ideas
Post by: RICH on June 05, 2014, 03:27:50 PM
Craig,
Think you have me .... RICH ..... mixed up with that fine, kind, loving, well spoken, tall dark good looking, intellectual fellow called RUSS. ;D

I copied a lot from the mill screen, added a lot of things i thought a one single lathe screen page should have all using Screen4.
That was  easy, but, what needs to be in place for the screen to work is another story.

RICH
Title: Re: Screen Set Ideas
Post by: Overloaded on June 05, 2014, 07:01:57 PM
Aww no, don't go pinning Hoods attributes on me.
I am quite the inverse of that description. Actually, in every  respect.

(nice try Rich, much appreciated)

Russ
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 05, 2014, 07:09:01 PM
so he must want something,  ;)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 09, 2014, 01:05:58 PM
I did manage a protection routine for my probe till they get the probing worked out. I can move and when it makes contact writes the value to a file and then goes into a estop then back to an enable state so I can jog off.
It uses some of Scotts DSC code and a couple of flags to check status. But it works for the most part to protect my renishaw and let me know the coords.
just functional enough to keep my heart from exploding.  :D

Code: [Select]
function TestDSC_Module()
local StateOfInputSig0 = DSC.GetInput(0); --GetInput(InputSig), InputSig is a # 0-63 i.e. ISIG_INPUT0 is "0" (zero)
                                             --a sequential Input 0-63
    local StateOfDigitize = DSC.GetOtherInput('DIGITIZE');--active when X axis jogging Pos Dir.
                                                   --a non sequential/named Input, controlled
                                                   --from keyboard plugin     

    if StateOfDigitize == 1 then
        local DigitalTrigger = 1; 
        DSC.OutputMiscSig('DIGTRIGGER', DigitalTrigger);
        getprobedata();
    else
        SETFLAG = 0;           
        SETFLAG2 = 0;           
    end
end
TestDSC_Module();

function getprobedata()
    local inst = mc.mcGetInstance();
local Xval = ReadReg("iRegs0/Xvalue");
local Yval = ReadReg("iRegs0/Yvalue");
local Zval = ReadReg("iRegs0/Zvalue");

        gcodecapture = string.format ("X%.4f, Y%.4f, Z%.4f \n", Xval, Yval, Zval);
 
    filename = "myProbeFile.txt";
     if (gcodecapture == gcodeold) then
        gcodeold = gcodecapture;
        SETFLAG=1;
    else
        if (SETFLAG == 0) then
            mc.mcCntlEStop(inst)
            if (SETFLAG2 == 0) then
                --mc.mcCntlSetLastError(inst, 'SETFLAG0 = ' .. tostring(SETFLAG));
                file = io.open(filename,"a"); -- create new file or add to it
                gcodeold = string.format ("X%.4f, Y%.4f, Z%.4f \n", Xval, Yval, Zval);
                file:write(gcodecapture)
                file:close()
                gcodeold = gcodecapture;
                SETFLAG2=1;
                mc.mcCntlSetLastError(inst, 'gcodecapture = ' .. tostring(gcodecapture));
            end
                DSC.DoFunc('CNTLENBL');
        end
   end
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 11, 2014, 09:12:37 AM
Been looking for a way to organize and merge xml screen.set data ... though it is a pain it is possible
One of the reasons is this particular screen set would be 433 printed pages, that makes for a lot of structure code.
And the places to merge the data is critical and has to be formatted correctly.
It is a very tedious task, hopefully some day the powers to be (Brian & Steve or some other code monkey) will have a tool to assist us.

http://msdn.microsoft.com/en-US/data/bb190600.aspx
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 12, 2014, 12:13:27 PM
Started working on modbus spindle control so I had to add some extra features.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 13, 2014, 07:21:21 PM
Had a need to store messages to a file, as some of them are longer than the available window. Puts the date and time stamp on each new message.
And as an added benefit it provides a log of errors.
When I don't want to use the write to file feature, I'll put the messages() call in an if then statement that looks for a toggle button state.

--put this at the end of the PLC script
Code: [Select]
messages();

--put this in the screen load script
Code: [Select]
function messages()
  err = mc.mcCntlGetLastError(inst);
  if (err ~= errold) then
    errold = err;
    file = io.open("messages.txt","a") -- open a new current file
    file:write(os.date("%x  %X ")..(err).."\n")
    file:close() -- close current file
  end
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 14, 2014, 11:40:24 PM
--got scaling figured out and working (code located in the PLC script)
yes... one for each axis , I love these registers.

Code: [Select]
    local chkVar3 = ReadReg("iRegs0/xscale");
    if (chk3 ~= chkVar3) then
        chk3 = chkVar3
        if (chkVar3 ~= 1) then
            code = string.format("G51 X%0.4f",tostring(chkVar3));
            scr.SetProperty('droX1', 'Fg Color', 'Red');
       else
            code = string.format("G50");
            scr.SetProperty('droX1', 'Fg Color', 'Green');
        end
        mc.mcCntlGcodeExecute(inst, code);
    end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 15, 2014, 08:50:18 PM
looks like there is a difference in the Feed rate override and the spindle override one uses 100 and the other 1 to scale. Both reset to 100%
not sure why they did not make the function labeling similar and the scaling too. just a heads up, or a kick in the ... ::)


Code: [Select]
function fro100()
    local inst = mc.mcGetInstance();
    fro = 100
    mc.mcCntlSetFRO(inst, fro);
end

function sro100()
    local inst = mc.mcGetInstance();
    sro = 1;
    mc.mcSpindleSetOverride(inst, sro);
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 15, 2014, 10:51:27 PM
playing around with modbus by passing data in, computing to display results
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 16, 2014, 08:29:05 AM
Found that a one second Sleep is needed to give the registers time to fill before I could read them.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 16, 2014, 08:55:13 AM
Feed and Speed control with buttons and hot keys (F keys) working.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on June 19, 2014, 12:28:24 PM
How to control states and led's

local SpinCCW = scr.GetProperty('ledSpindleCCW','Value','Value',0);
local SpinCW = scr.GetProperty('ledSpindleCW','Value','Value',0);

if (SpinCCW == "1") then
    scr.SetProperty('btnSpindleCCW', 'Label', 'SpindleCCW ON');
    scr.SetProperty('ledSpindleOFF', 'Value', '1');
    scr.SetProperty('btnSpindleOFF', 'Label', 'Spindle ON');
elseif (SpinCW == "1") then
    scr.SetProperty('btnSpindleCW', 'Label', 'SpindleCW ON');
    scr.SetProperty('ledSpindleOFF', 'Value', '1');
    scr.SetProperty('btnSpindleOFF', 'Label', 'Spindle ON');
else
    scr.SetProperty('btnSpindleCW', 'Label', 'SpindleCW OFF');
    scr.SetProperty('btnSpindleCCW', 'Label', 'SpindleCCW OFF');
    scr.SetProperty('ledSpindleOFF', 'Value', '0');
    scr.SetProperty('btnSpindleOFF', 'Label', 'Spindle OFF');
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 04, 2014, 12:44:02 PM
Came across this reference document thought it was a good resource for Lua 5.1
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 06, 2014, 12:44:46 PM
Been working on a universal function that writes to a file either the lathe or mill tool tables, based on mode.

(note: to nick) all mach4 tool data starts at variable 7781; so 7781-7790 is tool #1

the numbers in my graphics tables don't mean anything in this case, I just used them as fillers to get the routine to work.
but it does include any tool that has a description


//Tool Numbering
#define TOOLS_START 7781      //Start of Tools in Parameter list
#define TOOL_INC 10           //Inc from tool to tool in the param list

#define TOOL_MILL_X           0 //X offset
#define TOOL_MILL_X_W         1 //X Wear offset
#define TOOL_MILL_Y           2 //Y offset
#define TOOL_MILL_Y_W         3 //Y Wear offset
#define TOOL_MILL_HEIGHT      4 //Tool height offset
#define TOOL_MILL_HEIGHT_W    5 //Height wear Offset
#define TOOL_MILL_POCKET      6 //Tool changer pocket
#define TOOL_MILL_RAD         7 //Rad for comp
#define TOOL_MILL_RAD_W       8 //wear offset for comp

#define TOOL_LATHE_X          0 //X offset
#define TOOL_LATHE_X_W        1 //X Wear offset
#define TOOL_LATHE_Y          2 //Y offset
#define TOOL_LATHE_Y_W        3 //Y Wear offset
#define TOOL_LATHE_Z          4 //Z offset
#define TOOL_LATHE_Z_W        5 //Z wear offset
#define TOOL_LATHE_POCKET     6 //Pocket # (may not be needed)
#define TOOL_LATHE_TIPRAD     7 //Tip Rad for comp
#define TOOL_LATHE_TIPDIR     8 //Tool tip DIR
#define TOOL_LATHE_TOOLSLIDE  9 //AxisSlide number  and - for reversed
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 06, 2014, 02:01:56 PM
As a note to all:
Under the History button there is a 'Save' option button
Found that I had to create a history.txt file in the mach4 root folder for it to write to the file.

Update: This has been addressed and fixed in the latest versions.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 08, 2014, 08:13:11 AM
How to pass a number to a function and get or set variables. Note: Your dro names have to be consistent to write to them, because I am using the concant feature to add the number to the dro's name. I have a read function in the PLC and a write function button
Lot of messing with, but now its just one line of code to add new ones in the future.

Code: [Select]
function SCR_getset(varnum)
    local inst = mc.mcGetInstance();
    local varvalue = 0;
    varvalue = mc.mcCntlGetPoundVar(inst, varnum);
    scr.SetProperty('drovar'..varnum, 'Value', tostring(varvalue)); --Concant dro&number
end

function GetVariablePoundDouble(varnum)
     local inst = mc.mcGetInstance();
     local varvalue = 0;
     local val = 0;
     varvalue = mc.mcProfileGetDouble(inst , 'drovar'..varnum , tostring(varnum), val);
     mc.mcCntlSetPoundVar(inst, tonumber(varnum), varvalue);
end

function GetVariablePoundInt(varnum)
     local inst = mc.mcGetInstance();
     local varvalue = 0;
     local val = 0;
     varvalue = mc.mcProfileGetInt(inst , 'drovar'..varnum , tostring(varnum), val);
     mc.mcCntlSetPoundVar(inst, tonumber(varnum), varvalue);
end

function SetVariablePoundDouble(varnum)
    local inst = mc.mcGetInstance();
    local varvalue = 0;
    varvalue = mc.mcCntlGetPoundVar(inst, tonumber(varnum));
    mc.mcProfileWriteDouble(inst ,'drovar'..varnum, tostring(varnum),varvalue);
end

function SetVariablePoundInt(varnum)
    local inst = mc.mcGetInstance();
    local varvalue = 0;
    varvalue = mc.mcCntlGetPoundVar(inst, tonumber(varnum));
    mc.mcProfileWriteInt(inst ,'drovar'..tostring(varnum),tostring(varnum),varvalue);
end

function GetPoundDroVariables()
    SCR_getset(1); --pass number to function
    SCR_getset(3901);
end

function VariableRead()
     GetVariablePoundDouble(1);
     GetVariablePoundInt(3901);
end

function VariableWrite()
     SetVariablePoundDouble(1);
     SetVariablePoundInt(3901);
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 11, 2014, 08:28:25 AM
Was up late last night working with Steve on the new release, 1889 fixes several of my issues.  :-*

Also got my MPG wizzard buttons to control the axis.  ;D

so I had good day, but missed a lot of sleep ;)

thanks Steve
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 13, 2014, 01:55:05 PM
Major pita to format control items, but did get it to move incrementally and continuously  (b axis does not increment, slight bug in the core i'd say).

Update; July 16, 2014: seems that B- incremental just gets ignored but B+ incremental puts the wizzard in a state that needs a Close (not exit) to get it to restart correctly, all the buttons take on the same last commanded move so every button press does the same thing. Odd as hell.  ???

Few items to work out yet but its getting closer. Have to admit Widgets are a tough lesson to learn.

And sure hope someday they create a GUI program to create prettier screens.

Still pretty amazing what can be written in Lua to add features to interact with Mach4.

Update; October 13, 2014: revision 2038, I  just noticed addresses the issue with the B incremental problem I'd found. Cool thanks guys.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 18, 2014, 12:45:45 PM
Took Scott's modbus and the DL06 idea and made some changes so the buttons and inputs follow the display logic

Sorry... the photos not that great, it is taken with a "go pro" snap shot and it's little dark in the shop

So to manually set an output I just toggle a bit button
Title: Re: Screen Set Ideas
Post by: poppabear on July 18, 2014, 08:20:20 PM
The PLCs, Input Switches, and Output Lights of THE:  "Bat Desk"....

 ;D

Scott
Title: Re: Screen Set Ideas
Post by: Analias on July 19, 2014, 07:59:57 PM
For those who are blind or want to see more gcode on their screen.  My first trivial contribution:

I added buttons to my G-code display on the Program Run screen to allow increasing or decreasing the font size on the fly.  This allows the number of lines to be displayed to increase or decrease. 

To the button that increases the font size I added following code to the "Left Up Script" property:

Code: [Select]
local gcode1Lines = scr.GetProperty('gcode1','Lines','Lines',0);

scr.SetProperty('gcode1','Lines',tostring(gcode1Lines-1));

To the button that decreases the font size I added:

Code: [Select]
local gcode1Lines = scr.GetProperty('gcode1','Lines','Lines',0);

scr.SetProperty('gcode1','Lines',tostring(gcode1Lines+1));

I did say it was trivial.  It is useful if you want to see more G-code.

Oops I didn't crop the files :(



-Freeman
Title: Re: Screen Set Ideas
Post by: smurph on July 19, 2014, 11:59:39 PM
You guys are taking the ball and running with it!  These are all awesome ideas.  Complex or trivial it matters not.  They are all things that will help you out running the machines and they are all things that could not be done before.  So keep 'em coming!

Steve
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 20, 2014, 04:59:55 PM
Good job Freeman, I'd like to see this thread full of ideas and contributions.  :) so I second it, keep em coming.

Scott, you have a Nice work area, and you get to sit down at a desk to program. I'm either standing, sitting on a rolling stool or worse the floor.

Now if we can get those code monkeys to work out the mach4 core details.  ::)
Title: Re: Screen Set Ideas
Post by: Analias on July 21, 2014, 12:42:56 AM
A variation on this code:

Code: [Select]
local TotalLines = mc.mcCntlGetGcodeLineCount(inst);
local GcodeCurrentLine = mc.mcCntlGetGcodeLineNbr(inst);
scr.SetProperty('droTotal', 'Value', tostring(TotalLines));
local GcodePercent = (GcodeCurrentLine/TotalLines) * 100;
scr.SetProperty('droPercent', 'Value', tostring(GcodePercent));

is to use a gauge and set the "Code" property to track the "Current G Code Line".  I then added a SigLib handler to the startup script for mx.OSIG_RUNNING_CODE to initialize the "Range" property to either the total line count of the current file if running gcode or zero.

My SigLib block looks like:

Code: [Select]
[mc.OSIG_RUNNING_GCODE] = function (state)
        local inst = mc.mcGetInstance();
        local totalGcodeLineCnt = mc.mcCntlGetGcodeLineCount(inst);
        if (state == 0) then
            scr.SetProperty('guaMySMWorkGuage','Range','0');
        else
            scr.SetProperty('guaMySMWorkGuage','Range',tostring(totalGcodeLineCnt));
        end
    end,

As the gcode runs the gauge tracks the percentage of work done automatically.


-Freeman
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 21, 2014, 07:53:30 AM
Could be nice for monitoring during cycle runs, thanks

also I have found that gauges does not seem to work on some computers as the gauge display does not update properly.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 27, 2014, 08:05:51 PM
been playing with a new wizzard that uses combobox's to hold the machine variables that are not equal  to zero.

Thought others might like to play and experiment with a wizzard.

The number on the far left is how many variables are in the combobox on its right, as the number of variables increase combobox get added
maximum of 25 combo boxes

still learning too, so if you find some tricks to add to this; please post.

Title: Re: Screen Set Ideas
Post by: Analias on July 27, 2014, 08:41:03 PM
Thought others might like to play and experiment with a wizzard.

Thanks Craig,

Very timely since I'm trying to find where the current fixture # (not coordinates) are stored.  I'm trying to display which of G54-59 is current in effect.


-Freeman
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 28, 2014, 09:47:47 PM
Was playing around with timers and came up with a function call that incorporates all three.
made a series of buttons to test
pass the amount of time and the mode, does some minor error checking and resets the mode.
sleep(.5,0) would get you a 1/2 second delay converts it to a 500 millisecond sleep
not really that functional but it shows how to pass variables and do some calculations and toggle button actions

Code: [Select]
local inst = mc.mcGetInstance()
local butstate = 0;
butstate = scr.GetProperty('togTimer(0)', 'Button State', 0);
if (butstate == '1') then
     sleep(1,0);
end

Code: [Select]
function sleep(howlong, mode)
    local millitime = howlong;
    local microtime = howlong * 1000;

    if (mode == 0 and howlong < 1) then
        mode = 1
        millitime = howlong * 1000;
    elseif (mode == 2 and howlong < 1000) then
    mode = 1
        microtime = howlong;
    end
    if (mode == 0) then
        wx.wxSleep(howlong);
       -- mc.mcCntlSetLastError(inst, 'seconds = ' .. tostring(howlong));
        scr.SetProperty('togTimer(0)', 'Button State', '0');
    elseif (mode == 1) then
       -- mc.mcCntlSetLastError(inst, 'milliseconds = ' .. tostring(millitime));
        wx.wxMilliSleep(millitime);
        scr.SetProperty('togTimer(1)', 'Button State', '0');
        scr.SetProperty('togTimer(3)', 'Button State', '0');
        scr.SetProperty('togTimer(4)', 'Button State', '0');
    elseif (mode == 2) then
       -- mc.mcCntlSetLastError(inst, 'microseconds = ' .. tostring(microtime));
        wx.wxMicroSleep(microtime);
        scr.SetProperty('togTimer(2)', 'Button State', '0');
    else
        mc.mcCntlSetLastError(inst, 'Ya screwed up the delay time');       
    end
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 30, 2014, 06:41:52 PM
Very timely since I'm trying to find where the current fixture # (not coordinates) are stored.  I'm trying to display which of G54-59 is current in effect.

#4012
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 30, 2014, 06:58:33 PM
My Latest "Program Run" screen

this particular laptop does not display the blue horizontal graphic display correctly for program file run time position.
Not sure why my other laptop does ???
Lenovo G550 & G560 both running Win 7 Ultra 32bit
Title: Re: Screen Set Ideas
Post by: dude1 on July 30, 2014, 07:03:03 PM
very nice hope you going to let people have a copy or sale on Mach web site
Title: Re: Re: Screen Set Ideas
Post by: Analias on July 31, 2014, 12:40:47 AM

#4012

Ooooo thanks Craig.

I'll have to update my screen set tomorrow. I just got done with a big push on a project at work and I need to bleed the stress off a bit before I try to make progress on my screen set. I don't want playing with my toys to be confused with work stress, takes all the fun out of it.

-Freeman

Sent from my Xoom using Tapatalk
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 31, 2014, 12:09:12 PM
Freeman that sounded like a good idea to display that info, but I found there was a few issues with the fixture offsets and the associated table past G59.
Brian was very receptive in fixing the issues and should be resolved in one of the next releases. Thanks Brain  ;)

machine variable #15127 is the pnumber in g54.1p3

  
Code: [Select]
   local var4012 = mc.mcCntlGetPoundVar(inst, 4012);
    local var15127 = mc.mcCntlGetPoundVar(inst, 15127);

    fixtureNum = (53 + var4012)
    fixtureNum2 = (var15127)

    scr.SetProperty('droFixture', 'Value', tostring(fixtureNum));

    if (fixtureNum2 >= 0) then
        scr.SetProperty('txtFixture', 'Label', 'G54.1P' .. tostring(fixtureNum2));
    else
        scr.SetProperty('txtFixture', 'Label', 'G' .. tostring(fixtureNum));
    end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 02, 2014, 01:11:22 PM
Figured out a way to make a gradient temperature scale.
was wishing the gauge control had a way to change colors but was informed it wont happen till microsoft makes it possible.
(makes me wonder now; how all this will port over to the Mac or Linux OS)  ???

uses DRO's and the 'Z order' function. (finally found a very good use for that feature)
Title: Re: Screen Set Ideas
Post by: gadman58 on August 05, 2014, 01:48:47 PM
Added in a parts counter by adding in a increment for the #3901 in the M30 macro then in the PLC script added in a if statement so the count updates.
in M30 function of the M30 macro
Code: [Select]
   local var = mc.mcCntlGetPoundVar(inst, 3901);
    mc.mcCntlSetPoundVar(inst, 3901, var + 1);
In PLC script

Code: [Select]
elseif (inCycle ==0 and machStateOld ~= machstate) then
    local var = mc.mcCntlGetPoundVar(inst, 3901);
    scr.SetProperty('lblPartsCnt','Label',tostring(var));

end

Glenn
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 05, 2014, 10:27:07 PM
Took scotts idea of imbedding code and having a button to call a compiled wizzard

Here is a popup 6 axis MPG and variable search all, wizzard.

put the (MPG_Module.mcc) in the modules folder "c:/Mach4Hobby/MODULES" and
add this these iRegs0 variables or paste them in the machine.ini file for your profile
this gives you control of the axis positions with the buttons and updates the DRO's
the [iReg#] number is just the ones in my machine.ini file


[iReg9]
Name=Xvalue
Desc=Save X
InitialValue=0
[iReg10]
Name=Yvalue
Desc=Save Y
InitialValue=0
[iReg11]
Name=Zvalue
Desc=Save Z
InitialValue=0
[iReg12]
Name=Avalue
Desc=Save A
InitialValue=0
[iReg13]
Name=Bvalue
Desc=Save B
InitialValue=0
[iReg14]
Name=Cvalue
Desc=Save C
InitialValue=0

then create a button and put the below script under the clicked option. (make sure your path for the module is correct)
when the button is used the module loads into memory and pops up. (least it should)

package.path = "./?.lua;c:/Mach4Hobby/MODULES/?.mcc;" --where the module file is.  
local MP = require "MPG_Module";--load the module file

myMPG()
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 09, 2014, 09:39:09 PM
Starting to work on the MPG functions and features.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 21, 2014, 02:01:42 PM
Working on adding tool pocket location tracking and tool usage times using pound variables for storage and retrieval.

Title: Re: Screen Set Ideas
Post by: poppabear on August 21, 2014, 09:13:57 PM
wxGrid is awesome isn't it!!??
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 23, 2014, 06:31:08 PM
Took Scotts great idea and created an I/O screen
uses a toggle button to jump to the screen on cycle start to view status.
toggle buttons for outputs and leds for inputs & output states
Title: Re: Screen Set Ideas
Post by: dude1 on August 23, 2014, 06:41:56 PM
so when do you start working for brain LOL.
I wish i had half your brains
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 23, 2014, 06:46:20 PM
thanks that's nice to hear, but its more just tedious detail then anything
fun crap to learn, I'm sure you can do a lot of this, just takes never giving up.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 24, 2014, 09:10:28 PM
Had some excellent help from Scott on this project

Editable text help files

button presses brings up the list of codes that can be edited on the fly.
I'd like to add more buttons for notes or other resource data that might be useful on demand

Thanks again Scott, "you da man"
Title: Re: Screen Set Ideas
Post by: poppabear on August 24, 2014, 09:14:31 PM
Thanks Craig! for the shout-out!

Hopefully, MPG function outputs and probing will be fixed!

Scott
Title: Re: Screen Set Ideas
Post by: dude1 on August 24, 2014, 09:59:32 PM
So when do we get hold of your screen set
Title: Re: Screen Set Ideas
Post by: Overloaded on August 24, 2014, 11:31:03 PM
So when do we get hold of your screen set

 :)
?
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 25, 2014, 03:30:37 PM
Made a "Notes.txt" file script and then added an error catch, if the file is not found it creates one for you. (added that to all them)

Far as the screen.sets I'm just trying to do as much as I can to be ready for mach4 when it is ready and released.  :P
Not sure it would be a viable product for sale, as I did not plan on writing detail instructions and then supporting it as on ongoing revenue stream.
Thou the American way, if someone was to throw money at me I'd have to take notice. But your choices are wait for guys like Ger to learn to program Lua and then provide a mach4 screen.set or start learning to do this yourself and take control of your own needs.  

I'm trying to keep up and have a functional interface. Good time to dive in and mess with it as Ya-Nvr-No you too might be good at this.
Not like we have an alternative, other than an unsupported Mach3, that I'm thinking will not be addressed ever again!
So as in all things there is good and bad. Get over it and make a decision. Either find a way to adapt and learn or, use what you have. Everything has issues.

Sorry, years of being a Journeymen Tool & Die maker, Manufacturing & Controls Engineer and also a University of Alabama Instructor for a short period. Reminds me that it takes years to get proficient and apply ones talents to the task at hand. It's been a good life for me.  ;D   Lots to learn, lots of time left to apply it.

Damn that's not like me (see what a couple of Labatts will do on a hot day)  :D
Craig
Title: Re: Screen Set Ideas
Post by: poppabear on August 25, 2014, 06:00:02 PM
HAAHAHAHA........ yeap, what he said...

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 28, 2014, 08:45:16 PM
took brian's mpgtest.mcs program and added 3 more axis's

just to show how easy it is.

works good, now if he could provide a script to get an actual MPG dial to control my servos.

Thanks Brian and Brett now quit eating lobster and telling stories and get back to work,  ;D

Update:
and with one number changed you can change the look

local InputsGridSizer  = wx.wxFlexGridSizer( 2, 3, 0, 0 )

and then replaced the textbox with a combo selection dropdown box,
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 29, 2014, 03:59:06 PM
Freeman is correct I can link a button to a compiled script but not a embedded panel.

Kind of thinking I like the button better anyways, as I like popup functional screens.



Title: Re: Screen Set Ideas
Post by: poppabear on August 30, 2014, 12:02:33 PM
Well there is a "Work-A-Round" in a way for showing "Embedded" panels...
Have a Button that sets a variable in your Panel Script that toggles the "Panel:Show(true);" to show, and false to hide it...

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 31, 2014, 09:16:56 PM
Changed the output led's with buttons, Now I can set the condition of the output and/or it will show me the set conditions.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 02, 2014, 01:02:21 PM
Added a couple of Tool Tip images I'd found and cleaned up to the screen set image manager (Menu, Screen, Manage Images), then attached one to an open location as a Bitmap Buttons
wrote a script and placed it under the "Clicked Script", to toggle both the images and the added text box to show me the correct information.
Now by clicking the image/button it toggles back and forth.

Code: [Select]
function onPaint()
    if (tess == 0) then
    buttonImage = 'frontTP.JPG'
    scr.SetProperty('bbutton29', 'Image', buttonImage);
    scr.SetProperty('txtPost', 'Label', 'Front');
    tess = 1
    else
    buttonImage = 'rearTP.JPG'
    scr.SetProperty('bbutton29', 'Image', buttonImage);
    scr.SetProperty('txtPost', 'Label', 'Rear');
    tess = 0
    end
end

onPaint()
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 02, 2014, 09:36:55 PM
I did not quite like the Diagnostic tab so I moved them and added some more. Now I can see everything on one screen.
Title: Re: Screen Set Ideas
Post by: ger21 on September 02, 2014, 09:49:21 PM
Man, that's a lot of info.

I sure hope they add the ability to create our own LED's, as those round ones look like they came from a DOS program..
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 02, 2014, 09:58:39 PM
I had heard that the led's were being fixed, I was hoping the latest version 1953 would have addressed it. Guess not yet.
was going to change them but kind of want to wait to see the new graphics.

Between that screen and the ability to view and change the variables real time you can pretty much do it all. You can read and write to the registers including modbus, once you have them setup.

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 03, 2014, 07:06:34 PM
I've been playing around with a panel script Freeman had posted, Basically was trying to get an idea what is going on.
Thou have to admit not following all this Lua panel scripting. But did find I could get some basic information and compute some data from mouse events by using mouse down and and mouse up.
Found that the onSize() function is not working correctly

Code: [Select]
local panel = mcLuaPanelParent
inst = mc.mcGetInstance();

function onPaint (event)
    local dc = wx.wxPaintDC(panel);
    local image = wx.wxImage();
    if (not image:LoadFile('C://Mach3//Bitmaps//MachStdMill//test.png', wx.wxBITMAP_TYPE_PNG)) then
        wx.wxLogError("Could not load image from '%s'!", imagePath);
        dc:delete();
        return;
    end
    local bitmap = wx.wxBitmap(image);
    dc:DrawBitmap (bitmap, 0,0, true);
    dc:delete ();
end

function onLeftUp (event)
    local mouseXup = event:GetX();
    local mouseYup = event:GetY();
    local diffX = mouseXup-mouseXdn;
    local diffY = mouseYup-mouseYdn;
    mc.mcCntlSetLastError(inst,"Mouse Click Up Location is @  X: "..tostring(mouseXup)..", Y: "..tostring(mouseYup));
    mc.mcCntlSetLastError(inst,"Difference in X: "..tostring(diffX)..", Y: "..tostring(diffY));
end
function onLeftDown (event)
    mouseXdn = event:GetX();
    mouseYdn = event:GetY();
    mc.mcCntlSetLastError(inst,"Mouse Click Down Location is @  X: "..tostring(mouseXdn)..", Y: "..tostring(mouseYdn));
end


function onSize (event)
    local sized = event:GetSize();
    local width = event:GetWidth();
    local height = event:GetHeight();
    mc.mcCntlSetLastError(inst,"Width: "..tostring(width)..", Height: "..tostring(height));
    event:skip();
end

panel:Connect(wx.wxEVT_PAINT, onPaint)
panel:Connect(wx.wxEVT_LEFT_UP, onLeftUp);
panel:Connect(wx.wxEVT_LEFT_DOWN, onLeftDown);
panel:Connect(wx.wxEVT_SIZE, onSize);

Title: Re: Screen Set Ideas
Post by: smurph on September 03, 2014, 07:22:21 PM
Man, that's a lot of info.

I sure hope they add the ability to create our own LED's, as those round ones look like they came from a DOS program..
What is wrong with the LEDs?  The fact that they are round?  If so, you just change the shape property to square and get Mach3 style LEDs.

Steve
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 03, 2014, 07:44:38 PM
I do like the square better
Title: Re: Screen Set Ideas
Post by: ger21 on September 03, 2014, 11:30:40 PM
Man, that's a lot of info.

I sure hope they add the ability to create our own LED's, as those round ones look like they came from a DOS program..
What is wrong with the LEDs?  The fact that they are round?  If so, you just change the shape property to square and get Mach3 style LEDs.

Steve


The round ones appear to be very low resolution, and the graphic quality looks poor compared to everything else on the screen. Any chance of getting image based LED's like Mach3 has, so we can create our own?
Title: Re: Screen Set Ideas
Post by: Analias on September 03, 2014, 11:39:54 PM
I've been playing around with a panel script Freeman had posted, Basically was trying to get an idea what is going on.
Thou have to admit not following all this Lua panel scripting. But did find I could get some basic information and compute some data from mouse events by using mouse down and and mouse up.
Found that the onSize() function is not working correctly

Getting the size of the Lua Panel and resizing the inserted wxPanel containing my image is where I'm getting stuck.  There's no reason to move forward with the rest of my probing/touch off script until I can resize the embedded image correctly.  If Steve or Brian can enlighten us (especially me) I really would appreciate it.

Using the attached image, I have a Lua Panel (red border) with an inner wxPanel (yellow border).  The paint event draws my image fine.  My problem is that I cannot get the wxPanel to resize to the full extent of the outer Lua Panel.

WARNING - the attached script is very incomplete, it is a snapshot of what I'm doing at this very moment.


-Freeman

Title: Re: Screen Set Ideas
Post by: poppabear on September 04, 2014, 01:58:11 AM
Analias,

    If I am understanding you correctly, you want the Bit-Map to scale with the panel correct?
If so I have attached some code that will work.

It pulls the already existing "Bolt Hole" circle Jpeg for the example. so you will need to change your paths back...
it assumes the bolt hole jped is in the c:\Mach4Hobby\Wizards folder... you will also need to change back your bitmap
type to PNG.

When you change the size of your Screen set, the Bitmap that is in your lua panel resizes with the panel.
NOTE: you can use some of the High quality resize params, but your still going to lose some resolution at larger sizes.

in your event call, I put "--ADDED THIS!!!!!!!!!" after the crap I added to make it work.

Scott
Title:
Post by: Analias on September 04, 2014, 04:32:35 AM
Thanks Scott I'll have to look at the code later today after work. I appreciate the feedback.

-Freeman


Sent from my Xoom using Tapatalk
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 04, 2014, 12:17:29 PM
Had some luck with Freeman's Panel Scripting Code and Scott's Cool additions but had to make a couple of changes to get it to Scale and Stretch correctly for me.
works pretty good right to left but top to bottom its off a bit in stand alone mode,
but when embedded it needed tweaking to get it to work right. (framing was taking over I believe)

Sorry I'm not much on those message boxes, seem to be a distraction to me. (Maybe a timer to close would make it more functional and make me happier?)  ;D


Title: Re: Screen Set Ideas
Post by: poppabear on September 04, 2014, 01:20:34 PM
so, I compared your code with mine, where did you make the changes for it to scale right for you?
I don't see where you changed any of the scaling code...
:)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 05, 2014, 05:22:28 PM
I was playing around with adding timers to my tool sheet, and created a little script that I put in the plc script (at the end) to show me the what current modes I am in.
I needed to find a way to make sure the Tool timer only tracked cut/feed times. So during a run cycle the history gets updated with the current G codes. Helped me in seeing how gcodes are tracked and used.

Code: [Select]
local inst = mc.mcGetInstance();

if (inCycle == 1) then 
    mode1 = mc.mcCtrlGetModalGroup(inst,1,'0')
    mc.mcCntlSetLastError(inst, "mode1 = G" .. tostring(mode1));
    mode2 = mc.mcCtrlGetModalGroup(inst,2,'0')
    mc.mcCntlSetLastError(inst, "mode2 = G" .. tostring(mode2));
    mode3 = mc.mcCtrlGetModalGroup(inst,3,'0')
    mc.mcCntlSetLastError(inst, "mode3 = G" .. tostring(mode3));
    mode4 = mc.mcCtrlGetModalGroup(inst,4,'0')
    mc.mcCntlSetLastError(inst, "mode4 = G" .. tostring(mode4));
    mode5 = mc.mcCtrlGetModalGroup(inst,5,'0')
    mc.mcCntlSetLastError(inst, "mode5 = G" .. tostring(mode5));
    mode6 = mc.mcCtrlGetModalGroup(inst,6,'0')
    mc.mcCntlSetLastError(inst, "mode6 = G" .. tostring(mode6));
    mode7 = mc.mcCtrlGetModalGroup(inst,7,'0')
    mc.mcCntlSetLastError(inst, "mode7 = G" .. tostring(mode7));
    mode8 = mc.mcCtrlGetModalGroup(inst,8,'0')
    mc.mcCntlSetLastError(inst, "mode8 = G" .. tostring(mode8));
    mode9 = mc.mcCtrlGetModalGroup(inst,9,'0')
    mc.mcCntlSetLastError(inst, "mode9 = G" .. tostring(mode9));
    mode10 = mc.mcCtrlGetModalGroup(inst,10,'0')
    mc.mcCntlSetLastError(inst, "mode10 = G" .. tostring(mode10));
    mode11 = mc.mcCtrlGetModalGroup(inst,11,'0')
    mc.mcCntlSetLastError(inst, "mode11 = G" .. tostring(mode11));
    mode12 = mc.mcCtrlGetModalGroup(inst,12,'0')
    mc.mcCntlSetLastError(inst, "mode12 = G" .. tostring(mode12));
    mode13 = mc.mcCtrlGetModalGroup(inst,13,'0')
    mc.mcCntlSetLastError(inst, "mode13 = G" .. tostring(mode13));
    mode14 = mc.mcCtrlGetModalGroup(inst,14,'0')
    mc.mcCntlSetLastError(inst, "mode14 = G" .. tostring(mode14));
    mode15 = mc.mcCtrlGetModalGroup(inst,15,'0')
    mc.mcCntlSetLastError(inst, "mode15 = G" .. tostring(mode15));
end
Title: Re: Screen Set Ideas
Post by: Analias on September 05, 2014, 11:10:31 PM
Scott, after swapping back in the code to load my image, your changes worked flawlessly.  I'll spend some time this weekend writing up the code to convert mouse click X-Y into operations  (Probe-X, Probe-Z, Edge probe, etc.).

Thanks for the insight.


-Freeman
Title: Re: Screen Set Ideas
Post by: poppabear on September 06, 2014, 08:39:28 AM
I like what your doing with your probing code, I would love a copy when your done!
If it is commercial, then how about a discount!  Hehehehe

On your Bit Map, I see your putting hot spots, you might what to set those areas as a percentage of
the bitmaps X.Y since if a user scales it, then those locations in true x.y will change.
But if the areas of in some Percentage type of area, i.e.  spot 1 is from 20% X to 30% X, (same idea for Y).
Then those locations would also scale with the bit map scaling.

One last thing, the HTML dialogs/Bitmaps lend them selves better to hot spots.

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 07, 2014, 07:38:06 PM
Managed to get the tool use timers working, works by adding only feed move times for the current tool number. Then stores the time to a pound variable and also compares it to the used up time variable. Watches the incycle for starting the timers and looks at either no feed move or an out of cycle condition.

Update: Made a few revisions, changed the saved times to minutes and formatted.
Title: Re: Screen Set Ideas , how to name screen in label ?
Post by: machiner on September 18, 2014, 03:43:36 PM
i hope I posted in right 'area'. I have been trying to do something so simple. I want the screen set name to be visible in a label. I checked out the 'label code' clickee in the properties window , but its not listed. how to do  ? hopefully in one or fewer steps  :-`] 

by 'screen set name' I mean the name of the file that has been loaded from the 'screens' folder'
Title: Re: Screen Set Ideas
Post by: poppabear on September 18, 2014, 05:10:26 PM
pull the Key/Name from the GetProfile calls, then set the name to a text control on your screen.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 18, 2014, 08:43:15 PM
pull the Key/Name from the GetProfile calls, then set the name to a text control on your screen.

Sorry but, that was Clear as mud!

I had this posted somewhere but can't seem to find it

I'd created a text label, and put this in my plc script

ScrName = mc.mcProfileGetString(inst,'Preferences','Screen',ScreenName);  --gets the Screenset name from the machine.ini file Preferences section.
scr.SetProperty('lblScreenName', 'Label', ScrName); -- then put the ScrName in the text label called lblScreenName
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 21, 2014, 03:46:00 PM
Finally found some time to get the Tool pocket tracking routine working.  ;D
Note: then I found I did not like it and changed it.

Title: Re: Screen Set Ideas
Post by: poppabear on September 22, 2014, 09:09:50 PM
very nice job on the wxGrid tool display!
Looks very useful for real world apps.

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 04, 2014, 03:07:32 PM
With Arts fine Darwin upgrades I now have the ability to have up to three MPG encoders to either control separate axis's with each or map one per dial.

Using the slider I can assign an encoder/MPG to an axis, so encoder 1 = Y encoder 2 = Z and encoder 3 = B

or using the buttons below Each MPG will be mapped to each axis selected

Max selection is three and that seems like enough to keep track of ;D

My intentions is to be able to replace the hand dials on one of my mills with mpg dials
Title: Re: Screen Set Ideas
Post by: poppabear on October 05, 2014, 06:12:16 AM
Very, Very nice work!!  I am still waiting on Greg to get MPGs working in his ESS pluign to start using them here as well.
Love what you did with your screen!

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 05, 2014, 07:14:46 AM
Thanks

Now if Steve or Brian could map the Steps per, for each axis, We could set them up with something like  X at .001 Y at .0001 and Z at .01
The way I have the buttons programmed now I can do it, as the data gets passed to the functions on selection of an axis. So by changing the steps per between axis selection the next axis is passed that new step value. Little convoluted but is possible.

Makes it nice in so many ways, but would put a lot more responsibility on the operator to Pay Attention. One of the most dangerous features of using hand dials is setting the steps per. Snap a cutter off mighty quick, as a step of 1" would surely make short use of small cutters or could ruin your workpiece.

Now to figure a way to get a remote LCD display. Would like Ethernet for control and display. Anyone have suggestions and/or examples ???   Maybe something like Peter Homann, ModIO only TSP Ethernet as opposed to serial.
Title: Re: Screen Set Ideas
Post by: RICH on October 05, 2014, 07:46:58 AM
MPG's are a really nice. Mine are set so that i can just creep or rotate the mpg fast and the axis moves fast.
Maybe "intuitive feel " would be a better description.
Once you use them you'll wonder how you ever did without them.

Keep up the good work.........on the side and following,
RICH
Title: Re: Screen Set Ideas
Post by: poppabear on October 05, 2014, 12:55:40 PM
Quote
Now to figure a way to get a remote LCD display. Would like Ethernet for control and display. Anyone have suggestions and/or examples Huh   Maybe something like Peter Homann, ModIO only TSP Ethernet as opposed to serial.

Arduino with Ethernet shield and LCD

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 06, 2014, 02:38:43 PM
Had to make some upgrades to the mpg buttons, as only having three encoders available I had to come up with a way to map and limit the selections.  It is amazing how much coding and time goes into a compare and limit routine. So the top set of buttons are used, double duty I can map an encoder to any one of the axis's or I can add an encoder and map more than one encoder for each selected axis. Each button basically has one line of code that just passes the data to the functions() and they check status and conditions and sort out the details.

The bottom buttons are mapped for the 1-3 encoders x-z and then a-c same encoders numbers, but choosing a like encoder turns off the other associated mapped axis that might have been selected. Hope that makes sense, cause it was a pita to get straight.  ::)

Using color coding helped for the three encoders I can map an axis to the encoder and visual see whats active and know what encoder to use

Also pressing any one of the buttons puts it in the MPG mode.  Pressing Jogmode turns off all the mapping.

Starting coding for Shuttle Mode, but find its not ready for prime time. Hope one of the next few revisions will address that issue and I can finish this.

Lua is  >:D  but it does do some functional things very fast.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 08, 2014, 10:13:18 AM
Sorry had to move this, Scott did not want me to post this in his thread. Asked me to remove it.   :'(
whatever  ???

Cool, thanks guys
Added them to a panel script and used the fit too feature (that Freeman & Scott wrote)

now to get them associated to actual movement

Here are the images at 100x100
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 13, 2014, 08:44:18 AM
See latest update I posted:  :)

http://www.machsupport.com/forum/index.php/topic,27162.msg194707.html#msg194707
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 16, 2014, 11:30:45 AM
As a heads up to all:
Noticed that the machine units DRO display in the setup units only.

I had set up Mach4 in inch and MDI changed using g21 (metric) to run a test program. Found that I needed to create a new popup Wizzard that displays the Fixture & Machine DRO's in the units I am running in. As a side note also found that using the Jog Step feature increments to the setup units, so I guess I will have to address that by using a scaling function.

Scott suggested I compute to a more accurate value then the standard 25.4 (thou my wood don't seem to care  ::))

local metricval = 25.4000508001016
if (defaultunits == 200 and currentunits1 == 210) then
    WriteReg("iRegs0/XMachineValue", XMachineVal*metricval); --convert to metric
    WriteReg("iRegs0/YMachineValue", YMachineVal*metricval);
    WriteReg("iRegs0/ZMachineValue", ZMachineVal*metricval);
    WriteReg("iRegs0/Xvalue", Xval*metricval);
    WriteReg("iRegs0/Yvalue", Yval*metricval);
    WriteReg("iRegs0/Zvalue", Zval*metricval);
elseif (defaultunits == 210 and currentunits1 == 200) then
    WriteReg("iRegs0/XMachineValue", XMachineVal/metricval); --convert to inch
    WriteReg("iRegs0/YMachineValue", YMachineVal/metricval);
    WriteReg("iRegs0/ZMachineValue", ZMachineVal/metricval);
    WriteReg("iRegs0/Xvalue", Xval/metricval);
    WriteReg("iRegs0/Yvalue", Yval/metricval);
    WriteReg("iRegs0/Zvalue", Zval/metricval);
else
    WriteReg("iRegs0/XMachineValue", XMachineVal);
    WriteReg("iRegs0/YMachineValue", YMachineVal);
    WriteReg("iRegs0/ZMachineValue", ZMachineVal);
    WriteReg("iRegs0/Xvalue", Xval);
    WriteReg("iRegs0/Yvalue", Yval);
    WriteReg("iRegs0/Zvalue", Zval);
end


This had a fixture offset of x=1" y=1" just to check values
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 18, 2014, 07:09:53 PM
Looks like TCP modbus, Ardrino Ethernet and the MPG's will work  8)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 21, 2014, 01:42:50 PM
I'm now letting the Arduino do all the tracking and just passing the results thru Modbus for the mpg's

In this case using 0.001 per step 18 clicks gives me 0.018 increments Changing the step increment, automatically updates the step value for all mpg's

now to get the other two mpg's hooked in with the switches and LCD on the remote enclosure.

Lot of reading, coding and trial and error in this adventure.  ;D
Title: Re: Screen Set Ideas
Post by: Analias on October 21, 2014, 02:03:16 PM
Oooooooo... nice.  An ethernet based panel with keybooard, switches, MPGs and DRO outputs running off a BeagleBoardBlack was on my wish list.  Nice to see it can be done.
Title: Re: Screen Set Ideas
Post by: yahuie on October 25, 2014, 03:35:05 PM
With plugins coming out for the various hardware platforms, it seems like Mach4 is about to become usable by people who don't want to code.  I have a lathe that I am in the midst of a conversion on - a gang tool style lathe.  I am wondering if it would make sense to skip Mach3 and go to Mach4.  I am posting in this thread because it seems like all that is missing is a turning screen.  Am I right?  Is there one available yet?   I am hoping for a touchscreen screen.
Thanks,

Bill
Title: Re: Screen Set Ideas
Post by: ger21 on October 25, 2014, 04:46:40 PM
There are no plugins yet, and I'd guess that it would be several more months before the bugs are worked out of them?
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 25, 2014, 07:57:42 PM
Art's Darwin is available and runs great, I'd seen at the IMTS show that machmotion had I believe ESS, Galil and Hycon running. Thou at the time only three axis were active. As far as a lathe screen one is provided with mach4 and you do have the option to alter or create your own. I have one in progress along with my Mill screen, and try to keep them somewhat updated as I learn more and apply what i feel I will need for my future projects. Thou have to admit, have not even tried whether they are touch screen compatible. Good question. I have tested Darwin, Galil and the ESS Plugins. So have to say they are closer then you might think. But still a ways to go before all is ready for prime time.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 12, 2014, 11:15:27 AM
here's a nice little functional thing to know

I need to map a screw so I created a little routine that gives me the counts (in the history box) of the steps for the position i am at.
Put at the end of the plc script file for in this case "motor 2" my Z
it only updates if it has changed from the last plc scan.
So now I can move to a position and get the number of counts from home (don't forget to reference your axis to start this, - sets it back to zero)


counts2,rc = mc.mcMotorGetPos(inst, 2, 0);
if (oldcounts2 ~= counts2) then
   mc.mcCntlSetLastError(inst, "counts = " ..tostring(counts2));
   oldcounts2 = counts2;
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 12, 2014, 11:36:39 AM
so my understanding is that this is what the Motor_2_Map.dat file should look like
Seeing it's not ready yet, its just a prod to get er done. ;D

0,669905,7,0,47277,107740,188578,297665,445703,669905


--consist of the following info
-- start counts,length counts,num points, point0 count, point1 count, point3 count,...
Title: Re: Screen Set Ideas
Post by: pbarratt on November 12, 2014, 10:15:55 PM
Is there a way I can read encoder outputs from Darwin, do the count to position translation based on metric/imperial, and display the results on DROs like M3 settings tab?  I can't find how to get at the encoder outputs from Darwin.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 12, 2014, 10:58:02 PM
Your not reading encoder counts, I'm accessing the counts that mach4 sent to the drive.
So it does not matter what device/plugin you have interfaced with your drives. its all about steps or counts; which ever you want to call em.

As in my example above 1" travel is 55000 counts per unit, that was setup in the "Z" motor 2 configuration screen.

You could monitor the pulse stream at your break out board (BOB) that darwin is sending. But not necessary,  ??? unless you have an issue with losing steps/position. But that I would suspect a noise issue with wiring, a bad connection or loose physical couplings. (top three)

So the short answer is there is no encoder outputs from darwin.
Title: Re: Screen Set Ideas
Post by: pbarratt on November 13, 2014, 07:32:50 PM
Ya-Nvr-No,

I'm not sure if your last post was in reply to my question.  If so, we are not on the same page and I'd like to push the reset and start again.

In Mach 3, on the setting tab, there is a group of 3 DROs in the section called 'Encoder position".  These DROs show the counts from encoders and reflect the position of the axes.  They are not driven by Mach 3.  I use these in the manual mode (no pulses from Mach 3, drivers disabled) as my DROs for manual operation.  I want to duplicate them in Mach 4.  Darwin has configuration screens for encoders but I don't see where the pulses are passed to Mach 4.  I fully understand there would only be counts and it would be up to me or the designer of the DROs to turn this into meaningful positions according to the counts per unit.

The first question is how do I capture the counts being sent to Mach 4?  Do the encoder outputs need to be mapped as input signals in Darwin as well as encoders?

Thanks

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 13, 2014, 07:41:49 PM
Mach4 is not like mach3 so there is no encoder features other than MPG dial reading ability that darwin uses/calls them. Might be down the road that they will get added but as of yet, nope.
Title: Re: Screen Set Ideas
Post by: pbarratt on November 13, 2014, 08:08:27 PM
Ya-Nvr-No,

Thank you, that explains a lot.  It also says Mach 4 does not support MPGs to control jogging.

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 13, 2014, 08:13:17 PM
did you miss how i'm using MPG with Darwin?

http://www.machsupport.com/forum/index.php/topic,27162.msg197715.html#msg197715
Title: Re: Screen Set Ideas
Post by: pbarratt on November 13, 2014, 08:36:33 PM
Yes, because I can't do it with the latest versions (1.2075).   :D

What's the difference between seeing an encoder input and an MPG input?

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 13, 2014, 09:36:48 PM
not much other than mach4 does not support encoders other than use the signals from a MPG dial and Art called them encoders in Darwin.
Title: Re: Screen Set Ideas
Post by: pbarratt on November 14, 2014, 12:08:28 PM
Ya-Nvr-No,

How do you configure the MPGs?

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 14, 2014, 01:05:08 PM
I did them with function calls, I just pass the data from the button to a common function.

but this is basically what you need to set

    joginc = mc.mcJogGetInc(inst,0); -- get the present increment

    mc.mcMpgSetAxis(inst, encoderid, axisid); --mpg encoder , axis ;  encoder 0, X axis 0
    mc.mcMpgSetAccel(inst, encoderid, 15); -- 15%
    mc.mcMpgSetRate(inst, encoderid, 100); --100
    mc.mcMpgSetCountsPerDetent(inst, encoderid, 1); --one click give one incremental step
    mc.mcMpgSetInc(inst, encoderid, joginc); -- pass the increments from the MPG encoder steps
Title: Re: Screen Set Ideas
Post by: pbarratt on November 14, 2014, 04:18:19 PM
Where are these function calls listed/documented?

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 14, 2014, 05:56:28 PM
If you start typing mc.mcMpg you get a whole list of functions to choose from on a drop down list. All started from some scatted files created and shared. I spent hours copying and pasting what popped up when I started the wx.wx list. And then LOTs & LOTs of trial & error to start to grasp how to use Lua. There is scattered tidbits of info all over the mach4 forum section. And my understanding is they are working on a reference doc.

http://www.machsupport.com/forum/index.php/topic,27141.0.html
Title: Re: Screen Set Ideas
Post by: pbarratt on November 14, 2014, 07:59:25 PM
Ya-Nvr-No,

Thanks for the drop down hint, that'll help tremendously.  How did you get the argument lists?  None of these are in the reference doc that I can find.
I fully expect that learning how to write scripts for Mach 4 is either going to keep me out of the bars or in them.  I've learned a few programming languages this way and greatly appreciate any help in getting started.  Just getting to the point of writing and executing the first script can be intense.  A "Hello World" example for Mach 4 might help a lot of people get started.

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 14, 2014, 09:13:13 PM
Brian had provided a wizzard to use the mouse scroll wheel as a MPG so I picked up a lot in that example, sorry not sure where its at as I did a search but cant find it.
Title: Re: Screen Set Ideas
Post by: pbarratt on November 14, 2014, 09:59:53 PM
Ah hah, a mouse wheel.  That explains a lot to me!  Well, Mach 4 won't be soup until long after MPG support is incorporated.

Maybe I should spend my time trying to fix the homing routine instead.

Thanks for your help.

Peter
Title: Re: Screen Set Ideas
Post by: ger21 on November 14, 2014, 10:32:24 PM
Found this video, which has a link to the script:
https://www.youtube.com/watch?v=MRyaRQwhYWk
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 15, 2014, 06:36:17 AM
Thanks Gerry
I knew it was not lost, but I sure don't remember getting it from there.   :-[ Hell to get old.

I included the folder link. Hopefully Brian will add to it soon with other cool features

ftp://machsupport.com/Mach4_Lua_Scripts/Panel_Scripts/ (ftp://machsupport.com/Mach4_Lua_Scripts/Panel_Scripts/)
Title: Re: Screen Set Ideas
Post by: pbarratt on November 15, 2014, 01:39:12 PM
Ooo, ooo, ooo!  Thanks, that's the kick starter!
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 15, 2014, 07:01:27 PM
Just so you can see Darwin works with MPG, thou i have to admit I was rushing it a bit and was ahead of the speed set.

https://www.youtube.com/watch?v=l715pq7cis8
Title: Re: Screen Set Ideas
Post by: pbarratt on November 15, 2014, 07:18:46 PM
The video brings us back to: How do you read the MPG outputs in Mach 4?
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 15, 2014, 08:44:23 PM
Did you setup encoder 0 in Darwin for the MPG A & B (like pins 11 & 12) you have the MPG hooked to 5 volts and a ground?
make sure you test in Darwin to make sure you are getting the counts to read up and down as you turned the dial?
should see multiples of 4 counts up and back.

Once that's done you just use the functions I'd provided placed in a script under a toggle button.
0=encoderid from darwin
0=X axis in mach4
1=Y, 2=Z and so on
So when the button is down it accesses the axis and mpg you want and when up make sure you set the increments back to 0.

It's pretty simple, the hard part is setting up multiple dials and mapping, but really its just time consuming. Works sweet.
Title: Re: Screen Set Ideas
Post by: pbarratt on November 15, 2014, 10:51:24 PM
Actually, I have three shaft encoders that I use in Mach 3 driving the DROs on the settings tab.  Works great as DROs when in manual mode.
I can configure them in Darwin and see the counts increment / decrement, multiples of one, not 4.  Not sure why you see multiples of 4.
Anyway, if I can get that test working, then I'll try to set them up to drive the mouse wheel routine in manual mode just as a software test, nothing practical.  If that works, I can try to set up the DROs I want to replicate the ones in Mach 3.

Should keep me busy past Thanksgiving.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 16, 2014, 06:16:25 AM
I set it to four because these are quadrature signals

http://www.ni.com/white-paper/4763/en/

and the functions I provided is for the MPG hand dial, has little to do with the mouse scroll wheel example, other than that was my lesson in the logic.
Title: Re: Screen Set Ideas
Post by: pbarratt on November 16, 2014, 11:53:13 AM
Yes, I too have quadrature encoders as well as an index output for super accurate homing.  Quadrature with the 500 line pair wheel gives me 2000 counts per rev.  Darwin also shows 2000 counts per rev so everything is working right there.  In fact, I'm not sure where you can set the number of counts per pulse in Darwin  It seems to be just one.
I plan to mix your function calls with some of the stuff from the mouse wheel example for a proof of concept (and learning tool).  I should be able to get Mach 4's DROs to increment / decrement by turning my hand wheels (remember I'm in manual mode so no motor action).  Just substituting an encoder for the mouse wheel.  Not useful in itself but paves the way for other stuff.

Peter
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 18, 2014, 07:23:26 AM
liked the feature so much I created a toggle button to turn it on and off and added the other motor count values
Add toggle button, I named it togCounts
Labeled the Text Up and Down condition
set the Button Color and Text Color in both the Up and Down states
Then put this code is at the bottom of the PLC script

Code: [Select]
local togcountButState = scr.GetProperty("togCounts","Button State", "Button State",'0');
if (togcountButState = '1') then
    counts0,rc = mc.mcMotorGetPos(inst, 0, 0);
    counts1,rc = mc.mcMotorGetPos(inst, 1, 0);
    counts2,rc = mc.mcMotorGetPos(inst, 2, 0);
    counts3,rc = mc.mcMotorGetPos(inst, 3, 0);
    counts4,rc = mc.mcMotorGetPos(inst, 4, 0);
    counts5,rc = mc.mcMotorGetPos(inst, 5, 0);

    if (oldcounts0 ~= counts0 or oldcounts1 ~= counts1 or oldcounts2 ~= counts2 or oldcounts3 ~= counts3 or oldcounts4 ~= counts4 or oldcounts5 ~= counts5) then
        mc.mcCntlSetLastError(inst, "Counts".." X = "  ..tostring(counts0).." Y = " ..tostring(counts1).." Z = "  ..tostring(counts2).." A = " ..tostring(counts3).." B = " ..tostring(counts4).." C = " ..tostring(counts5));
        oldcounts0 = counts0;
        oldcounts1 = counts1;
        oldcounts2 = counts2;
        oldcounts3 = counts3;
        oldcounts4 = counts4;
        oldcounts5 = counts5;
    end
end
Title: Re: Screen Set Ideas
Post by: BR549 on November 21, 2014, 12:07:02 PM
Craig I "LIKE" the Tool table idea. A couple of questions .Did you build the table or modify the stock table.

Could it be made to SORT a couple of the columns like Dia , Description , Tool Number ???

Can it be made AS a page not a popout window.

IF you ever used teh HAAS tool table you will be spoiled. Yours looks similar.

Good Job, Care to share ??

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 21, 2014, 12:58:59 PM
Thanks but well it was from the basic grid pattern and I developed my own layout
and yes it can be sorted and I suppose it could be a page
but 6 months ago I could not spell Lua

And as far as Haas kind of where i got some of the idea from so yep have used it.
no where ready for prime time yet.

But Thanks, nice to hear  :-*
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 24, 2014, 10:40:31 PM
Started working on my laser screen set
Hopefully I can use the B axis as a Z' for the focus control.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on November 30, 2014, 11:44:35 PM
Spent some time on the probing screen and routines today. Uses variables for the various gcode files called.
Title: Re: Screen Set Ideas
Post by: BR549 on December 01, 2014, 12:01:00 AM
HIYA Craig, You need a Probe test LED on screen AND a probe # DRO to tell you which Probe to use. Maybe an exterior and interior probing array ?? or maybe a creepy crawl routine for profiling


Just a thought, TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 01, 2014, 12:10:03 AM
the led is there, only have one probe , The buttons on the left are for interior and exterior probing.

And if you can write the routine in macro B, gcode or Lua go for it. This is just a start for my needs long time before it will every be fully completed as the more I learn the more I can add to my screen set.
Title: Re: Screen Set Ideas
Post by: BR549 on December 01, 2014, 12:10:49 AM
Just a thought but do you know IF G31 on an arc was implimented ????
Title: Re: Screen Set Ideas
Post by: BR549 on December 01, 2014, 12:11:56 AM
Looking Good, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 01, 2014, 12:13:38 AM
your "Mach4 Alpha" I'm just learning how to use it for my needs.
Title: Re: Screen Set Ideas
Post by: dude1 on December 01, 2014, 12:42:24 AM
good reply Ya-Nvr-No

a request that's up to when M4 is finely realised can you shear your screen sets or sale them 
Title: Re: Screen Set Ideas
Post by: BR549 on December 01, 2014, 10:06:13 AM
Hiya Craig NOTHING ALPHA about me. I do not belong to the inner circle (;-) I am still running on the demo.

I did find some code to build a Simple calculator in Lua.

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 01, 2014, 10:12:32 AM
Just so you all know how these variables are passed from a screen DRO to a #variable that the gcode can read and use:
again placed in the plc script, it sees the values and passes them to the pound variable holding registers. Each has its own name and variable associated to it


local valPartDiameter = scr.GetProperty('droPartDiameter', 'Value');
mc.mcCntlSetPoundVar(inst, 200, tonumber(valPartDiameter));

daniellyall: have to give your credit for trying as you've posted several times that your loving what you see, Thanks  ;D

Here is a code snippet (modified from an original probe routine) for probing a hole:
Code: [Select]
g61
#98 = 20 (Rough probe speed)
#97 = 3 (Fine probe speed)
([#200] diameter of circle)
([#203] Probe X Travel distance)
([#204] Probe Y Travel  distance)
([#206] Retract distance)

g91
g01 z0.0
g31 y-[#200] f#98 (Rough probe for -Y Pos)
g01 y[#206]
g4p1
g31 y-[#204] f#97 (Fine probe for -Y Pos)
#102 = #5062
g0 y[#206]
g4p1

And now, just noticed that I need to make the feed rates also a passable feature. (You see how this is never ending)  ???
and not sure just why I need a dwell using the ESS but I hope that will be addressed and I can remove them.
Title: Re: Screen Set Ideas
Post by: dude1 on December 01, 2014, 01:35:33 PM
your doing good work on the screens I am just trying to save my self as I need to do 3 different screens
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 01, 2014, 04:34:03 PM
Thanks but, Who is saving ME?  :P
Title: Re: Screen Set Ideas
Post by: dude1 on December 01, 2014, 05:49:08 PM
true
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 02, 2014, 10:44:00 PM
Working on a typical gcode file for probing, uses variables passed back and forth to the screen set probing tab.
just to give you an idea.
BTW: I'm not a fan of G91 so you will hardly, if ever see that in my code, (sorry incremental is lazy coding to me) I like to know where I'm at at all times.
This is a work in process so might need some tweaking yet. Only tested in sim.

Code: [Select]
([#100] -X Probed Position)
([#101] +X Probed Position)
([#102] -Y Probed Position)
([#103] +Y Probed Position)
([#200] Estimated Diameter of hole)
([#202] Tip or Tool Diameter)
([#203] Probe X Travel Distance)
([#204] Probe Y Travel Distance)
([#206] Retract Distance)
([#225] Rough Probe Speed)
([#226] Fine Probe Speed)
([#230] Computed Diameter of hole)

([#5061] G31 X probe position)
([#5062] G31 Y probe position)

#320=[#5021] (Current machine X)
#321=[#5022] (Current machine Y)
#322=[#5023] (Current machine Z)

#323=[#4100] (machine X fixture offset difference)
#324=[#4101] (machine Y fixture offset difference)
#325=[#4102] (machine Z fixture offset difference)

#326=[#320 - #323] (machine X fixture offset)
#327=[#321 - #324] (machine Y fixture offset)
#328=[#322 - #325] (machine Z fixture offset)

#330=[#326 - [#200 * 0.7]] (X- New Position to Probe to)
#331=[#326 + [#200 * 0.7]] (X+ New Position to Probe to)
#332=[#327 - [#200 * 0.7]] (Y- New Position to Probe to)
#333=[#327 + [#200 * 0.7]] (Y+ New Position to Probe to)

g61
g90

g31 x[#330] f[#225]
#100 = #5061
g01 x[#100+#206]
g4p1
g31 x[[#100]+[#203*-1]] f[#226]
#100 = #5061
g0 x[#320]
g4p1

g31 x[#331] f[#225]
#101 = #5061
g01 x[[#101]+[#206*-1]]
g4p1
g31 x[#101+#203] f[#226]
#101 = #5061

#105 = [[#100+#101]/2]
g0 X#105


g31 y[#332] f[#225]
#102 = #5062
g01 y[#102+#206]
g4p1
g31 y[[#102]+[#204*-1]] f[#226]
#102 = #5062
g0 y[#321]
g4p1

g31 y[#333] f[#225]
#103 = #5062
g01 y[[#103]+[#206*-1]]
g4p1
g31 y[[#103]+[#204]] f[#226]
#103 = #5062

#104 = [[#102+#103]/2]
g0 Y#104
g4p1

z[#206]

#230=[[[[-#100+#101]+[-#102+#103]]/2]+#202]

g64
m30
Title: Re: Screen Set Ideas
Post by: BR549 on December 02, 2014, 11:15:36 PM
G91  ;D  So when you are using G31 you do it ALL in G90  ???

In some instances G91 is the only way to fly.   >:D

Nice screen by the way, (;-) TP

 
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 02, 2014, 11:18:58 PM
In some instances G91 is the only way to fly.   >:D

Only if your a hack  :D

Thanks Terry
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 04, 2014, 10:46:17 PM
Kind of liking these new Dual DRO's
Title: Re: Screen Set Ideas
Post by: dude1 on December 04, 2014, 10:52:04 PM
is there anything you cant do, I am stubling along just to do the scripts I wont
Title: Re: Screen Set Ideas
Post by: smurph on December 04, 2014, 10:54:45 PM
I'm liking that too!
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 04, 2014, 10:57:58 PM
Thanks, I'm trying to show what can be done and create Ideas that other fly with.  :)

Steve your the main man that's making this all possible,  8) Thanks again

this code is what was added to the PLC script, and of course had to make some additions and changes to the screen
I did add some registers to beable to pass the data to other resources.
but it takes very little to get a screen you might like.
 
Code: [Select]
   local valxinch = mc.mcAxisGetPos(inst, 0);
    local valyinch = mc.mcAxisGetPos(inst, 1);
    local valzinch = mc.mcAxisGetPos(inst, 2);
    local valadeg = mc.mcAxisGetPos(inst, 3);
    local metricConvert = 25.40007660663105

    local valxmm = valxinch * metricConvert;
    local valymm = valyinch * metricConvert;
    local valzmm = valzinch * metricConvert;
    hReg = mc.mcRegGetHandle(inst, "iRegs0/xmm");
    mc.mcRegSetValue(hReg,valxmm);
    hReg = mc.mcRegGetHandle(inst, "iRegs0/ymm");
    mc.mcRegSetValue(hReg,valymm);
    hReg = mc.mcRegGetHandle(inst, "iRegs0/zmm");
    mc.mcRegSetValue(hReg,valzmm);
    hReg = mc.mcRegGetHandle(inst, "iRegs0/xinch");
    mc.mcRegSetValue(hReg,valxinch);
    hReg = mc.mcRegGetHandle(inst, "iRegs0/yinch");
    mc.mcRegSetValue(hReg,valyinch);
    hReg = mc.mcRegGetHandle(inst, "iRegs0/zinch");
    mc.mcRegSetValue(hReg,valzinch);
    hReg = mc.mcRegGetHandle(inst, "iRegs0/adeg");
    mc.mcRegSetValue(hReg,valadeg);

    scr.SetProperty('xdro1', 'Units', '0');
    scr.SetProperty('ydro1', 'Units', '0');
    scr.SetProperty('zdro1', 'Units', '0');
    scr.SetProperty('xdro1mm', 'Units', '1');
    scr.SetProperty('ydro1mm', 'Units', '1');
    scr.SetProperty('zdro1mm', 'Units', '1');

    scr.SetProperty('xdro1', 'Value', tostring(valxinch));
    scr.SetProperty('ydro1', 'Value', tostring(valyinch));
    scr.SetProperty('zdro1', 'Value', tostring(valzinch));

    scr.SetProperty('xdro1mm', 'Value', tostring(valxmm));
    scr.SetProperty('ydro1mm', 'Value', tostring(valymm));
    scr.SetProperty('zdro1mm', 'Value', tostring(valzmm));
Title: Re: Screen Set Ideas
Post by: dude1 on December 05, 2014, 05:47:10 PM
this is what I have got working so far a on off switch for turning my centring laser on and off with a mouse click I really like have the ability to change colours on buttons for different states

I have got the laser zeroing working sort of it will do the move turn laser off, it just wont zero if I push laser zero button again it will zero the dro`s its a timing problem I just need to work out how to make it into a macro
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 05, 2014, 08:07:03 PM
Added some buttons so I can set the dros to either inch or metric equivalent.
Provided the screen set so you can learn a little and play.
You will have to create the Registers if you want, as those are stored in the machine.ini file on closing.

Take note, this was setup as Inch as the default so if you use metric its up to you to understand the issues and change the formulas to suit.


Update: Played around with some new buttons for scaling and orienting the toolpaths view
sets the toolpath for each tab based on knowing what tab is current

I replaced the screen.set with an updated one showing how its done.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 08, 2014, 09:58:33 AM
Was playing around with the Dry run function and noticed that it does not start the spindle, coolant, or pick up the tool changes for my testing.  ???

Is fast at jumping to the line I set and then moving from the last gcode line location after a Cycle Start
Title: Re: Screen Set Ideas
Post by: MachMotion Development Team on December 08, 2014, 07:56:30 PM
The only way to get the spindle data is through a plugin. There isn't a scripting API for it.

Code: [Select]
mcCntlGcodeInterpGetData(MINSTANCE mInst, interperter_t *data);

struct Interperter_info {
double ModalGroups[MC_MAX_GROUPS];
double FeedRate;
double SpindleSpeed;
int SpindleDirection;
bool Mist;
bool Flood;
int ToolNumber;
int HeightRegister;
int DiaRegister;
};

typedef struct Interperter_info interperter_t;
Title: Re: Screen Set Ideas
Post by: MachMotion Development Team on December 08, 2014, 08:00:46 PM
Also one other thing, there is a drop down in the actions for RunFromHere.  What did you want to do different in the "Dry Run" from the "Run From Here" feature that already exists?
Title: Re: Screen Set Ideas
Post by: poppabear on December 09, 2014, 01:52:27 AM
Andrew,

    I may be misunderstanding your statement on no API for spindle functions but, here is a list of spindle functions from the McLua users manual. There is quite a bit of data you can get or set, if the below is not
what your talking about, please clarify.

mc.mcCntlGetPoundVar(inst, mc.FEEDRATE);
mc.mcCntlSetPoundVar(inst, mc.FEEDRATE, val );

Mach4 Spindle:
Spindle Set:
rc = mc.mcSpindleCalcCSSToRPM(number mInst, number DiaOfCut, Bool Inch)
--For doing CSS in Lathe, DiaOfCut is a double, Bool Inch is: 1=inch, 0=mm
rc = mc.mcSpindleSetAccelTime(number mInst, number Range, number Sec)
   --Range is pulley range 0-19, Sec is time in seconds
rc = mc.mcSpindleSetCommandRPM(number mInst, number RPM)
   --Sets the commanded RPM, (like from running Gcode, or MDI)
rc = mc.mcSpindleSetDecelTime(number mInst, number Range, number Sec)
   --Range is pulley range 0-19, Sec is time in seconds
rc = mc.mcSpindleSetDirection(number mInst, number dir)
--dir is:  -1ccw, 1cw, 0 stop
rc = mc.mcSpindleSetFeedbackRatio(number mInst, number Range, number Ratio)
--Range is pulleys 0-19, Ratio is a percentage as double
rc = mc.mcSpindleSetMaxRPM(number mInst, number Range, number RPM)
   --RPM is the Max for that pulley range 0-19
rc = mc.mcSpindleSetMinRPM(number mInst, number Range, number RPM)
   --RPM is the Min for that pulley range 0-19

rc = mc.mcSpindleSetMotorAccel(number mInst, number Range, number Accel)
   --Spindle motor Accel is in seconds for the pulley range 0-19
rc = mc.mcSpindleSetMotorMaxRPM(number mInst, number RPM)
   --The Max RPM for the spindle motor itself
rc = mc.mcSpindleSetMotorRatio(number mInst, number Range, number Ratio)
--Sets the gear/ratio as a percentage as double for that pulley Range 0-19
rc = mc.mcSpindleSetOverride(number mInst, number percent)
   --this is SSOVR percent as a double
rc = mc.mcSpindleSetRange(number mInst, number Range)
   --Sets the Pulley range you want to use, 0-19
rc = mc.mcSpindleSetReverse(number mInst, number Range, Bool Reversed)
--Due to gearing pulley Range 0-19 has to be reversed for correct rotation, 1=is reversed, 0=not reversed
rc = mc.mcSpindleSetTrueRPM(number mInst, number RPM)
--RPM is a double, that is coming in from an outside source
Spindle Get:
 Sec, rc    = mc.mcSpindleGetAccelTime(number mInst, number Range)
                  --Gets Accel time in sec, for pulley range 0-19
 mRPM, rc = mc.mcSpindleGetCommandMotorRPM(number mInst)
                  --gets the commanded spindle motors’ RPM
 cRPM, rc = mc.mcSpindleGetCommandRPM(number mInst)
                  --gets the commanded spindle Gcode/MDI RPM
 Range, rc             = mc.mcSpindleGetCurrentRange(number mInst)
                  --What Pulley range is currently active 0-19
 Sec, rc                = mc.mcSpindleGetDecelTime(number mInst, number Range)
                  --Gets Decel time in sec, for pulley range 0-19
 dir, rc                = mc.mcSpindleGetDirection(number mInst)
                  --what direction is spindle turning, cw=1, ccw=-1
 
Ratio, rc             = mc.mcSpindleGetFeedbackRatio(number mInst, number Range)
                  --what is the gearing ratio as a percentage for that pulley range 0-19
 MaxRPM, rc             = mc.mcSpindleGetMaxRPM(number mInst, number Range)
                  --returns the MAX RPM for that pulley range 0-19
 MinRPM, rc             = mc.mcSpindleGetMinRPM(number mInst, number Range)
                  --returns the MIN RPM for that pulley range 0-19
 RPM, rc             = mc.mcSpindleGetMotorMaxRPM(number mInst)
                  --returns the max RPM for the spindle motor
 Ratio, rc             = mc.mcSpindleGetMotorRatio(number mInst, number Range)
                  --returns the gear/pulley ratio for that range 0-19 as a double
 mRPM, rc             = mc.mcSpindleGetMotorRPM(number mInst)
                  --What is the spindle motor’s current RPM
 percent, rc             = mc.mcSpindleGetOverride(number mInst)
                  --What is the current SSOVR percent
 bool Reversed, rc          = mc.mcSpindleGetReverse(number mInst, number Range)
                             --Is spindle motor rotation reversed for pulley range 0-19, 1 = yes, 0=no
 RPM, rc             = mc.mcSpindleGetSensorRPM(number mInst)
                  --gets what the sensor says the spindle is turning at the sensors location
 RPM, rc             = mc.mcSpindleGetTrueRPM(number mInst)
                  --Returns what the actual RPM is at the spindle nose

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 09, 2014, 08:01:59 AM
What did you want to do different in the "Dry Run" from the "Run From Here" feature that already exists?

You had made a Comment that the "Dry Run" was a Replacement for "Run from Here"

http://www.machsupport.com/forum/index.php/topic,28572.msg200712.html#msg200712
Dry Run is working well. It is the replacement for RunFromHere is you want more control.  Other wise you can use the one from the Actions drop down in the screen editor.

Now it looks like a Plugin would be functionally needed to do some of these features, guess as Scott I'm a little confused too. I can do all the same from my screen set but I'm still testing as to if "Dry Run" or Run from Here" knows what is currently active (spindle, coolant, current tool and the tool length set, other set outputs, Cutter comp, etc...) And not having that reference manual to refer too, we as end users are just kicking tires and playing pocket pool.  :)
Title: Re: Screen Set Ideas
Post by: poppabear on December 09, 2014, 08:41:17 AM
This reference manual, it was put up on the "Tool Box" a while back now.

http://www.machsupport.com/forum/index.php/topic,27141.0.html

As a side note there are mcLua calls to get/set coolant types, and get/set tool table data.... and many, many other calls...

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 09, 2014, 08:50:56 AM
I meant a user manual that referred to these two buttons features, not a programmers reference document.
Title: Re: Screen Set Ideas
Post by: poppabear on December 09, 2014, 09:09:23 AM
Craig, nice work on the button views!

Here is an older screen (link) that shows how to show multiple view screens,
i.e. 1, 2, 3 or 4 screen views, for those who want to learn ways to manipulate tool
path displays.

http://www.machsupport.com/forum/index.php/topic,27117.msg191267.html#msg191267

User's Manual: Oh, ok, it is my understanding that there is a vendor that is
making/building a User's Manual for M4, and it is rumored to be good work,
and should be out soon.  (as of last rumblings/rumors, on the Yahoo group).

Scott
Title: Re: Screen Set Ideas
Post by: MachMotion Development Team on December 09, 2014, 09:40:14 AM
I was trying to answer this question about doing a dry run and getting the real time status on spindle, coolant or read the tool that should be active on that line of code.

Obviously I know there are API calls for spindle and coolant control, but there is only one way to know if they should be on or off on a certain line of Gcode.  And the API to read the status is returned in a structure that only a plugin can read.

For clarification “Run From Here” is calling “Dry Run” and then pulling the positions from the interpreter to know where to move the axes to for that line of code. The user can jog or use the dialog to move into position.  The API to read the current state for the auxiliaries is more geared for a developer because it takes a lot of work to implement, and almost everyone will want to implement it a little differently.

Was playing around with the Dry run function and noticed that it does not start the spindle, coolant, or pick up the tool changes for my testing.  ???

The only way to get the spindle data is through a plugin. There isn't a scripting API for it.

Code: [Select]
mcCntlGcodeInterpGetData(MINSTANCE mInst, interperter_t *data);

struct Interperter_info {
double ModalGroups[MC_MAX_GROUPS];
double FeedRate;
double SpindleSpeed;
int SpindleDirection;
bool Mist;
bool Flood;
int ToolNumber;
int HeightRegister;
int DiaRegister;
};

typedef struct Interperter_info interperter_t;
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 09, 2014, 09:40:41 AM
Thanks Scott.

Though I dont understand with left and right, why id have to cock my head like a dog to see whats on the screen to compare it to whats on my machine (why isn't Z always vertical?) I'd like to have a front and back option too if possible.  ;)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 09, 2014, 09:44:47 AM
Thanks Andrew,

Can we assume that these checks/API functions will be added to Mach4 or is the a MachMotion feature exclusive?
Title: Re: Screen Set Ideas
Post by: MachMotion Development Team on December 09, 2014, 10:17:29 AM
This feature is open to anyone that wants to mess with it...  We did make our own Run From Here that is setup for our interface.

Thanks Andrew,

Can we assume that these checks/API functions will be added to Mach4 or is the a MachMotion feature exclusive?
Title: Re: Screen Set Ideas
Post by: poppabear on December 09, 2014, 10:51:24 PM
Ok, I did mess with it, and got it working from within a plugin.. (see screen shot),
but, it was a long slide for a short gain. In this case, I just wrote the values out
to the XML so I could prove it out.

But, Steve said, that would be to slow, so, it is better to write out to a register as another place to put data where it would be global in nature to get to it from your screen set, or Macro, or Wizard.. etc.

Steve also said, (as usual), there is an easier way.
you will need to look at the Mach4.api to get the defines for all the things you can get to.

the "mcLua" commands of:

local val = mcCntlGetValue(inst, COMMAND, PARAM) will get a TON of all kinds of stuff.
local xAxis = 0;
i.e.: local xPos = mcCntlGetValue(0, VAL_MACHINE_POS, xAxis);

and the
mcCntlGetPoundVar(inst, #VarValue) will get just about everything else.
i.e.: mcCntlGetPoundVar(inst, mc.CUR_TOOL_NUMBER) will get just about everything else.

so, all the various structures, can be gotten to via mcLua in a round about way.

Thanks Steve for the Heads Up!!

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 07:08:57 AM
Scott you make it sound like: After I use "Run form Here" or "Dry Run" then check some variables that Mach4 now knows all. I did some quick trials and I did not find that to work. Never knew the tool, coolant, cutter comp, or fixture offset status from the gcode file. I created some registers and watched, just filled them with the current states not what the gcode set.


Maybe I need a wxsleep() to let it "settle in" before checking status.
Title: Re: Screen Set Ideas
Post by: poppabear on December 10, 2014, 07:17:55 AM
Take a look at the api, you have a copy.
Steve was the one who was kind enough to show the alternate way.
He had also read these threads. Perhaps both He and I are
not understanding what you're wanting.

So to help avoid mis-understandings, can you post exactly what it is your trying to do,
(make work), and the way your wanting the data to show, under what conditions?

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 07:34:49 AM
In the button scripts, at the end of reading the gcode and it is stopped at the line number, I check the variables and it returns the same values as before the button was pressed. Like I mentioned, I might have to use a sleep before checking or it could be my plc script is conflicting with the gcode reading, as its looking at DRO's on the screen too.

Update:
Quote
could be my plc script is conflicting with the gcode reading, as its looking at DRO's on the screen too.
yep that looks like that was it
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 12:57:39 PM
It gets the tool and sets the g codes now, but im missing the spindle and coolant status

I wrote a function that gives me all the I/O not equal to zero and lets me know the number and name of the signal.

I can physically turn the outputs on and off with buttons or MDI commands but still missing the ability to do a (dry run / run from here ) and have it give me proper status.

I tried scotts MAD but that did not show signs of spindle and coolant change either.

Somewhere I'm missing something ???
Title: Re: Screen Set Ideas
Post by: poppabear on December 10, 2014, 02:11:45 PM
Quote
I tried scotts MAD but that did not show signs of spindle and coolant change either.

MAD only looks at the signals in Mach, if they are enabled, it only shows what "Mach4" knows about a signal.

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 02:13:50 PM
time for you to create a version upgrade.  ::)
Title: Re: Screen Set Ideas
Post by: poppabear on December 10, 2014, 02:17:03 PM
reading and writing to Mach4's sigs and user data areas is all it was designed to do.
It is just a testing utility.

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 05:09:19 PM
Turns out I made the mistake of thinking this was going to be similar to Mach3 and would know if the spindle and coolant needed to be turned on. And inform me to be ready!

Based on my conversations with Steve, I have it working fine. Just need to remember to go thru a procedure before cycle start is used.

1)  If the tool needs changing.  (That's up to me to do.)

2) position the axes. (that's in the dry run popup window, or use can use jogging)

3) turn on spindle/coolant/mist/air/all mcode outputs, if required. (that's up to me to do)

4) Press Cycle start. (and who else?)
Title: Re: Screen Set Ideas
Post by: poppabear on December 10, 2014, 05:18:01 PM
HAHAHAHA!! NICE!!!!

Luckly, "You" where there to do it!!!
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 06:37:21 PM
that's a good project for you Scott create a parser file that strips out the Mcodes to see what state they are in at the line selected for the dry run.
Title: Re: Screen Set Ideas
Post by: poppabear on December 10, 2014, 07:49:11 PM
Yea, kinda like:  "We have to pass this bill before we can find out what is in it...."

Scott
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 10, 2014, 08:31:26 PM
Looks like there not much choice, not a big issue with basic machines and small files, but as the files get bigger and the tasks get more complex you can bet that some mcodes are going to be forgotten to be set. One of the key reason you always program with a safe block and create a block of code to start from after a tool change. Rarely done and most post processors need to be setup to create them.

(and quit voting for those politicians that are too lazy to read) ;)
Title: Re: Screen Set Ideas
Post by: BR549 on December 12, 2014, 12:53:53 PM
HIYA MON , I am back from the islands MON.  ;D

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 20, 2014, 08:52:50 PM
Made a Wizard to display an internal and external Thread Chart.
Reads in a excel csv file and outputs it in a Lua grid. (1685 rows, 13 columns)

Think of all the charts we use that can now be formatted and displayed at a button press.

Took me a while to figure this one out.  :P

Title: Re: Screen Set Ideas
Post by: BR549 on December 20, 2014, 09:04:15 PM
I guess I cheated I just view a JPG copy of the Drill ,Tap, Charts  (;-)

Nice work though on the LUA grid/chart , I was looking at Importing the CAMs tool table into Mach4 .

Perhaps you could fix the Mach4 tool table (;-)

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 21, 2014, 05:17:08 AM
There's a "Tap Drill" Chart  ;)

Updated: Added a Drill Chart
Title: Re: Screen Set Ideas
Post by: machiner on December 21, 2014, 12:31:10 PM
A question about your posting of JPG'S. Would it not be proper to post the code for your 'input excel' wizard ? I read this forum to learn, not to be teased  and impressed by your fine work. . . and I would love to see how you did it that so I could shamelessly 'COPY' it. Are you planning to go commercial later ?  please don't be offended by this question, just trying to learn the 'ropes', I spend much time over in the Arduino world where code is always posted.

one of your 'followers' . . .
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 21, 2014, 07:45:55 PM
As I thank you for the kind words, Both Scott(PoppaBear) and I have provided countless examples and code snippits.
Where is the homework you have done using what you have learned?

The Thread heading states, this is for 'Screen Set Ideas' I am trying to motivate, inspire and share IDEAS.

Scott has filled the Toolbox with all kinds of his examples.
He is running a service/business to provide you what you desire

I'm just showing you the kind of things I want Mach4 to do for me.  ;D
That last project took me 20+ hours to figure out, but It took well more than a thousand hours to get to that point. This (Lua) is not an easy task to pick up. And I'm using probably less than 10% of Lua capabilities.

Don't give up.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 21, 2014, 08:15:14 PM
Added this message popup function at the start of calling the drill chart wizard.

Code: [Select]
function DisplayMessage()
 wx.wxMessageBox("Hole Dia. Tolerance \n\nStandard drilled hole tolerances for holes drilled with a drilling machine using suitable jigs & fixtures, the hole tolerances depends upon the diameter of the hole and increases as the hole diameter increases. \n\nThe following are standard tolerances for general machine work and apply in all cases except where greater or lesser accuracy is required by the design.\n\n .0135 THRU .125   +.004/ -.001 \n .1260 THRU .250   +.005/ -.001\n .2510 THRU .500   +.006/ -.001\n .5010 THRU .750   +.008/ -.001\n .7510 THRU 1.000  +.010/ -.001\n 1.001 THRU 2.000  +.012/ -.001\n", "Notice")
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 22, 2014, 09:42:10 AM
Taking the same concept a little further, you can use the grid tools to calculate the data in the cells

Here is a Surface Speed to RPM calculator
Changing either of the two input values and then by clicking on any other cell, outputs the results.
Quick, Dirty and Functional

Note: The csv file has to be accessible, as it is reading from that file on load.

Update: Formatting and highlighting cells is shown in the added image.
Here's a snippet that formats the code (in two separate functions)
But it shows how to get cell data, compute it, set the new values and then create the alignment, colors, and font sizing

Code: [Select]
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(0,2,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(1,2,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(0,0,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(1,0,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(3,0,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(4,0,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(6,0,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(6,1,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
        for i = 7, 17 do --Loop through the last 10 rows column 0
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(i,0,wx.wxALIGN_RIGHT,wx.wxALIGN_RIGHT)
            i=i+1
        end
            SS_g_SurfaceSpeedsGrid:SetCellBackgroundColour(0, 2, wx.wxColour(wx.wxGREEN))--This code changes the new cell to green
            SS_g_SurfaceSpeedsGrid:SetCellBackgroundColour(6, 0, wx.wxColour(wx.wxGREEN))--This code changes the new cell to green
            SS_g_SurfaceSpeedsGrid:SetCellBackgroundColour(6, 1, wx.wxColour(wx.wxGREEN))--This code changes the new cell to green

            local SFM=SS_g_SurfaceSpeedsGrid:GetCellValue(0, 2)
            local DIA=SS_g_SurfaceSpeedsGrid:GetCellValue(1, 2)
            local PI=3.141592654

            RPM = (SFM * 12)/(DIA * PI)
            SFM = (DIA * PI * RPM)/12
            RPM = string.format("%0.0f",tostring(RPM))
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(3,3,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellAlignment(4,3,wx.wxALIGN_CENTER, wx.wxALIGN_CENTER)
            SS_g_SurfaceSpeedsGrid:SetCellValue(3, 3, tostring(RPM))
            SS_g_SurfaceSpeedsGrid:SetCellValue(4, 3, tostring(SFM))
            SS_g_SurfaceSpeedsGrid:SetCellBackgroundColour(3, 3, wx.wxColour(230,230,230))--This code changes the new cell to gray
            SS_g_SurfaceSpeedsGrid:SetCellTextColour(3, 3, wx.wxColour(wx.wxRED))--This code changes the new cell to Red
            SS_g_SurfaceSpeedsGrid:SetCellFont(3, 3, wx.wxFont(14,0,0,0))--This code changes the font size
            SS_g_SurfaceSpeedsGrid:SetCellBackgroundColour(4, 3, wx.wxColour(wx.wxGREEN))--This code changes the new cell to green
Title: Re: Screen Set Ideas
Post by: dude1 on December 22, 2014, 02:14:22 PM
your going to end up with a do everything M4 how much more can you add. And as you said its a lot of hard work I still cant get what I am trying to do to work I know what's wrong just not how to fix it ill get next year some time.

anyway thanks for shearing 

you should see if you can program it to make your coffees at smoko
Title: Re: Screen Set Ideas
Post by: poppabear on December 22, 2014, 04:19:40 PM
Quote
As I thank you for the kind words, Both Scott(PoppaBear) and I have provided countless examples and code snippits.

Yeap...... In the Tool box, there is a "controls" example that shows you how to do/use Grids, and several other controls.
It should be a good start point, to give you a leg up on the learning curve.

Unfortunately, other than the wxLua examples on the internet, to include Lua examples and wxWidgets examples (websites),
the one most applicable is the wxLua examples site, the other address the two separate language sites.

Craig has dumped 1,000's of hours into his stuff/learning, myself also, I do wish there was an easier way.
But, at this time, you will have to dig into the screen designer, wxLua and experiment.
Like Craig, I do my own screen mods......... and more often than not,
you learn by blowing stuff up, and starting over....lots and lots of tears and cursing...  :)

On the wxLua site and others like: Code Guru etc., you can find all kinds of code examples on things.
Example, reading/writing, from/to CVS files and the like.....  There is a huge ugly learning curve on this stuff.......

I know Vendors like Mach Motion have dumped Massive Man hours into doing their screens and stuff also.
There are many Vendors and OEMs that are having to sink major man hour capital into this to be ready to run by release date.

I guess my point is, your going to have to dump your time to learn it, or pay money to someone else to get what you want.

There is a lot of frustration with this stuff there is NO doubt, but, I understand Craig's point. He puts this stuff out,
to peak your interest and get YOU to dig, and figure it out for yourself.

The common hope that Craig, Brett and Myself share is to get the users to start playing, learning and posting up their work.

Scott



Title: Re: Screen Set Ideas
Post by: dude1 on December 22, 2014, 05:27:17 PM
good words Its a steep learning curve.

to get simple thing like inputs outputs working just a simple on/off that's not to hard its all those other functions that get hard. the thing I am have trouble with is when you need to add something in other places to get something to work like in plc script and places like that.

cant weight for the manual to finely get done until then Ill keep banging my head against the wall.

 Craig, Brett and poppabear thanks for all that you have sheared so far its more than you needed to do but it helps to see what can be done
Title: Re: Screen Set Ideas
Post by: RICH on December 22, 2014, 06:52:11 PM
Hmm......

Personaly I am happy that Scott and Craig and a some others have expanded their expertise to add  and explore functionality to Mach 4 as it develops. Should be interesting to see how it all will be, in say, another year or so.

Wish I could help but programming is just not my thing.

Keep up the good work guy's I follow along  with interest.....

RICH
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 22, 2014, 10:24:47 PM
Thanks guys;

had an issue today with setting up Darwin, after chatting with Art, he made me aware of the baseline to setup the Slider Freq in Hz.

I needed to set my freq just above the minimum Hz computed value.

So guess what I made? , a wizard to help in the future.

But it comes down to a simple formula (Counts * Velocity)/60 for each motor.

Update: (velocity is in units/min and kernel is in ints/second, so 60 makes velocity in seconds.)

Then just need to set the slider above the Highest Hz computed for all the axis
I made this one to handle up to 7 motors.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 23, 2014, 09:28:14 AM
Merry Christmas for Darwin users.

I have posted a stripped down wizard to help your setups. (did not use a cvs file in this version)

Also was informed by Art that he will be including it in future Darwin Installs, (thanks Art)  ;D
That's my Christmas gift  8)

This goes in your Wizard folder and you just enter in the counts and velocities for all motor you setup.
Does not store anything just gives you some additional help and understanding of Darwin setups.

And a shout out to poppabear for turning me on to lua grids.

Update: wasn't festive enough, added some color  ::)
Thanks scott

Title: Re: Screen Set Ideas
Post by: poppabear on December 23, 2014, 09:59:23 AM
Thanks Craig!
Sweet work on the Darwin Set up!

Scott
Title: Re: Screen Set Ideas
Post by: dude1 on December 23, 2014, 01:12:32 PM
nice work
Title: Re: Screen Set Ideas
Post by: BR549 on December 24, 2014, 10:55:13 AM
Thanks Craig

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 24, 2014, 08:13:16 PM
Merry Christmas to ALL

Here is a RPM calculator wizard, like I had shown earlier (post #244)

Functional and they are also to show you how they are done.

Happy Holidays

Title: Re: Screen Set Ideas
Post by: dude1 on December 25, 2014, 04:12:01 AM
top man Ill put you down for a pay rise

and Merry Christmas to you
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 25, 2014, 02:38:51 PM
Here is an example of how to use a function with a nested loop to "get" the cells value, pass it with its cell location to a function that sets colors based on what it is.

Code: [Select]
-- this is found toward the beginning of the wizard file, as it has to have been recognized and read before it can be called
function setcolors(rating,r,c)
    if (rating == "R") then
        LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(35,170,35))--green
    elseif (rating == "N") then
        LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(240,240,100))--yellow
    elseif (rating == "E") then
        LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(240,0,0))--red
    elseif (rating == "G") then
        LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(240,240,100))--yellow
    elseif (rating == "F") then
        LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(35,170,35))--green
    elseif (rating == "P") then
        LumberChartGrid:SetCellBackgroundColour(r, c, wx.wxColour(100,230,230))--cyan
    elseif (rating == "Weak") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(100,230,230))
    elseif (rating == "Light") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(35,170,35))
    elseif (rating == "Medium") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(150,150,150))
    elseif (rating == "Soft") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(140,240,100))
    elseif (rating == "Strong") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(240,140,100))
    elseif (rating == "Hard") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(0,0,0))--black
    elseif (rating == "Heavy") then
        LumberChartGrid:SetCellTextColour(r, c, wx.wxColour(240,0,0))--red
    end
end

function getcolors()
    local rownum = 0
    local colnum = 0
    local rating = "Ya-Nvr-No"
    for rownum = 0, 20 do --Loop through 21 rows
        for colnum = 2, 16 do --Loop through 15 columns
            local rating = LumberChartGrid:GetCellValue(rownum, colnum)
            setcolors(rating,rownum,colnum) -- set the color
        end
    end
end

--and then this will call the feature so I can use it at load and during editing
getcolors()
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 26, 2014, 01:08:59 PM
There's another 20+ hours to figure out how to read each cell and then write to the csv file; and add framing features to the spreadsheet grid.
So now its sizable and I can add menu features.

NOTHING but a PITA  ;D
but it is possible

The trick to lua programming is using the debug features like break points (F9) and stepping (F11) and Start/Continue (F5) and saving the file before you run/test it, because it will crash and leave ya hard without a  :-*

I try to save it as a new revision level name and then run it. That way I can always go back to the one that worked.

POS... POS ... POS
 >:D

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 27, 2014, 07:15:01 AM
Now that I created this template, I can start creating all kinds of functional popup Charts.
All by reading a text file separated with commas.
Title: Re: Screen Set Ideas
Post by: TOTALLYRC on December 27, 2014, 09:08:00 AM
Looking good.

Mike
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 27, 2014, 11:32:06 AM
Thanks, I'm having fun.

Now the other thing you can do is embed images into a wizard and use them as a popup display for visual help. These can be captured right off the web or use photographs you have for setups, training or reminders. No reason you cant create a series of images to use with forward & reverse buttons.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 28, 2014, 06:12:55 PM
Learned a lesson today from Art, thought id pass it on to all you closet coders.  ::)

its called an Iterated function (where it calls itself, Also called a re-entrant function)

I tested it by writing a short series of functions that read and display the unsorted array (a list of numbers), Sorts it, repacks it and then redisplays it.

But the code is kind of a cool way to see how arrays, bubble sorts and functions work; run it or step thru it to learn.

put in the wizard folder.
Title: Re: Screen Set Ideas
Post by: BR549 on December 28, 2014, 09:38:56 PM
What did he say???

NOW IF you had showed us a new way to Gcode a program  or run a cool sub routine OR setup a VAR routine that would be cool (;-)

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 28, 2014, 09:53:06 PM
Those are the kind of things I get paid good money for ;)

I'm just trying to kick a few of you in the programming genes.

Showing you what can be done, when you spend less time whining  :P
Title: Re: Screen Set Ideas
Post by: dude1 on December 28, 2014, 10:11:33 PM
good work Ya-Nvr_No do what ever you wont it all help
Title: Re: Screen Set Ideas
Post by: BR549 on December 30, 2014, 12:58:19 AM
Craig you can US  kick in the genes or the jeans you CANNOT make a programmer out of everyone.   IF you could then LINUX CNC would have taken OVER the DIY CNC world MANY years ago. (;-) Might want to leran that lesson.

IF Mach4 does not come out as developed as a normal CNC system "should be" it will suffer the same fate as LinuxCNC has. Only a few will be able to Program it at the system level with LUA.

The MAJORITY of users are hobbiest not system level programmers. They are looking a for basically a TURN KEY system not somthing they HAVE to program with a high order language. Heck the learning curve is HIGH enough as it is WITHOUT having to learn a NEW language Just to be able to do what they want.

They need an ADVANCED Mach3 not another LinuxCNC.

Been there seen it all before, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 30, 2014, 02:37:33 AM
I could care less to convince you or anyone else to be programmers, I'm just showing what can be done, for the ones that want to learn some new abilities. Its obvious that Mach4 is not going to be for all or many. That is I suppose unless you buy into a turnkey system provider, like machmotion or wait for someone to develop a system your willing to pay more for. I'm too old to just be mean and ornery any longer, I left my stress with working with people that don't care or have no direction in life.

Again its obvious to me that Mach3 is not going to be upgraded or probably ever bugged fixed. As the powers to be seem to be looking more for industrial retro-fitters to step up to the plate and sell a system with support. Mach3 does most of what the hobbyist ever dreamed of and more, stick with that. I'm sure I will still use it for years too. That does not mean I am not going to learn new skills and do what I can with the limited skill set I have.

Far as LinuxCNC, most fight with using their home PC let alone make them figure out how to work in a whole new OS.

No idea why you feel you have to poo poo something and put it in my thread, If you want to bitch please find somewhere else to share it. :-X

I'm just having fun and learning something new. Hell I don't know, but looks to me Mach4 might go either way, but after 6 years of waiting, going back is not happening for ArtSoft. And knowing what it takes to create a user interface for it, you will be waiting along time before you find someone providing free screen sets. Hell, maybe Brian and his support team is writing you one now. Go beat him up Please.  ;)
Title: Re: Screen Set Ideas
Post by: dude1 on December 30, 2014, 02:51:17 AM
yes its hard to do if anyone did the time Craig put into learning lua you would be at the same place he is what he does does help so what if he does not wont to give over what he has learnt that up to him yes it`s our loss if he wont to realise a screen set down the line cool I would pay for it to.

also BR549 you have not given over what you have worked out to do I asked you all ready you did not reply.

I have stop playing with M4 when the manual comes out I will start again.

Linux CNC fell over because you almost need to be a programmer to use it I tried said f that when back to m3
Title: Re: Screen Set Ideas
Post by: BR549 on December 30, 2014, 09:01:30 PM
Daniel I started working with LUA long before M4 came about. Sheetcam uses Lua for post and plugins. I still cannot prgram in it. I can only manipulate some of it from time to time and make things work.

As with you I also gave up on Lua until a good manual happens along. EVEN with that the best I will be able to do is cut and paste some code segments and make something work IF there is enough to work with in the manual.  The manual along will probably not do much without some GOOD first hand examples of it working in Mach4.

As to something you asked me about I don't have a clue what that was. Please refresh my memory.

Craig you are not just sharing the things you learn  IF you were you would also be SHARING the code that makes it work THAT WAY someone else may learn from it. What you are doing is setting yourself up as the Mach4 Guru so you can $ell your Good$ to the genearal public as you KNOW they will never get it as most of us don't. (;-)  AND there is really nothing WRONG with that other than you keep shoving that in our faces and proclaiming us as lazy mouchers. AND that is ok too as what goes around will always come back around.

Daniel what you say about LinuxCNC is exactly true and M4 may share the same fate if it does not change as I hear the exact same verbage used HERE with M4 as I did with LinuxCNC. IF you want it, LEARN to program it yourself.

NOW do "I "have to depend on M4 ? M3 ?  Not in the least . I do like M3 as it is fun to play with and create things WITH. NOW do I profit from either one ?? NOT one thin penny have I made off either. COULD I ? OH YEA I could.   I dedicate most of my time helping others to  learn CNC and helping other make a living from it, free of charge.

So craig I will leave it with ya. Show them how good you are pal. Maybe it will help you make a living with it. OR not.

But that is just me your values may vary, (;-) TP

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 30, 2014, 10:06:11 PM
Here is a stripped down wizard that is simple...  ::) no shoving intended.
you just have to edit the variables in the script before you run it.
It spits out the data in the history box
No reason anyone cant use this as a template and create their own functional wizards, the data can then be copied and pasted in the gcode editor.
take it all in small doses and it starts to be easier to grasp.
All that fancy Lua code can be overwhelming when all you really need is the value of the calculation

I'd mentioned a couple of times in the past I have no interest selling my Sets. Thanks, but don't need to earn a living, done that.  ;D I get to play now, and do what I desire.

And I have provided loads of code.
It just takes a while to get your head wrapped around it.
Good luck and have fun  8)
Title: Re: Screen Set Ideas
Post by: dude1 on December 31, 2014, 12:11:34 AM
lua is not all that hard to do it just when you have to have bits in other places that makes it hard I have done a couple of codes they worked in the Editor but don't work in the screen because of the other bits need in other places.

most of what you will wont to be in screen sets will be there soon there is only 1 more thing I wont to add and that's a laser zero for x and y

there are other people working on screen sets that will be as good as what Craig is doing for his self
Title: Re: Screen Set Ideas
Post by: ger21 on December 31, 2014, 07:30:05 AM
Quote
there are other people working on screen sets that will be as good as what Craig is doing for his self

Where are these people? I read every post here and on the Yahoo Group, and if anyone is working on screensets, they're not talking about it.
Title: Re: Screen Set Ideas
Post by: RICH on December 31, 2014, 07:36:56 AM
Quote
most of what you will wont to be in screen sets will be there soon there


I hope to live long enough to see a functional finished Mach4 Lathe screen..........!  ;D  ::)

RICH
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 31, 2014, 09:16:00 AM
Where are these people? I read every post here and on the Yahoo Group, and if anyone is working on screensets, they're not talking about it.

What  ??? I've seen posts of Pattons and popparbears screen sets read about Freeman, Nick and others working with Lua and Screens  
They are all probably learning by doing and don't want the exposure. (starting to wonder why I do,  ;) ) Its going to be years to get where Mach4 is the "standard", if ever, all depends on the new breed of CNC users and/or savvy people that can take the ball and run. It's still in the early stages, everyone seems to expect something different. Give it some time, learn a little every time you play. Life is frustrating, but you don't give up and :'(

"There's no crying in CNC"   ::)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 01, 2015, 07:42:17 AM
Happy New Year

woke up early to create a search function for text in the current loaded gcode file, place it under a button as a script.
does check for upper or lower case Text, but not for missing or additional characters
So a m6 and m06 are unique but a M6 and m6 are not
shows the line number found and the line string value in the history box
I needed this for my run from here function.


Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 02, 2015, 07:01:34 AM
For all of us trying to learn Lua:
I came across a pretty good resource for some lua examples, some work right out of copy and pasting and some need some series work. But it gives you a new goto place to pick up some tid bits

http://www.wellho.net/mouth/1744_Lua-examples-Lua-Courses.html (http://www.wellho.net/mouth/1744_Lua-examples-Lua-Courses.html)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 03, 2015, 07:11:19 AM
Inspired by an xls file Hood posted on the tool he created to calculate Speeds and Feeds (Thank You  ;)), I went back and updated the RPM Wizard I'd posted earlier. Altering an existing Wizard is a good way to teach yourself Lua. Make sure you save any edited code as a new file before you attempt to run it.

As a side note: I found that once a wizard screen has been displayed you really cant use the Debug Step feature, not sure if its a bug or inherent to Lua. So while testing expect a lot of crashes and restarts.  :-[
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 09, 2015, 01:43:55 PM
Been wanting to do this for weeks, but just could not figure out how to format the text boxes, Finally figured it out, yep it's a PITA  :-X
the trick is you still have to create them, but you don't have to show them.

using "Al Lenz" excellent excel spreadsheet to help in stepper motor calculation. I made a Wizard that emulates its features.

this little adventure took another 20+ hours  >:D

The more I do this, the more I have greater admiration.  ;) Its a struggle.
Title: Re: Screen Set Ideas
Post by: RICH on January 10, 2015, 06:16:36 AM
Graig,
Good work on the stepper calc sheet.
Just a cloud above my head, but, would something similar be applicable for say the tool table shown?

RICH
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 10, 2015, 08:51:40 AM
Thanks, I'm still working on it, added an auto calc (ticktimer, doesn't need a calc button anylonger), more fields and colors for input fields.

As far as the tool table; No reason why not but, The issue for me is, I still have not found a way to control the width of an individual field. Seems like I can set them all but not just one. Not like what I am use to at all, in that being able to place an object the screen where I want. Seems like everything is formatted to a grid pattern with no option. Hell I'm just learning by trying things and spending a lot of time searching on the net for little tidbits to glean from. One of these days the lite bulb will go off and I will start to understand Lua.

But a screen like you show might be easier to do by creating a tab and control group in mach4 then use mach4 registers to read and write too the DRO's. Then you can format the screen just like you show (at least close) and the data can be stored/accessed from the machine.ini file.

One thing I am learning to like about wizards are they can be accessed with or without mach4 running so any screen set that you happen to be using has full use, or they can be standalone popup utilities. Have to admit Lua is easier and cheaper than using VS C++ and creating plugins. But like anything there are tradeoffs. Five years from now and a C++ SDK is available with documentation so I can understand how widgits are included. I'm sure you will see some additional plugins that will be just what we desire.

I am getting convinced that mach4 has possibilities, but damn that cloud is up there for me too.  ::)

Update: Figured I'd include the Wizard image here, thanks again
Title: Re: Screen Set Ideas
Post by: RICH on January 10, 2015, 05:32:59 PM
Quote
But a screen like you show might be easier to do by creating a tab and control group in mach4 then use mach4 registers to read and write too the DRO's.


True.

I already created the tab and control group almost a year ago in a Mach 4 lathe screen. And would do it again.
Now if I knew how to use the registers to read and write to the DRO's......it would have been done already.  ;)
The only register I know how to read is the one for the check book and seems like it always goes out and nothing is read back in! ;D

RICH
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 11, 2015, 08:37:27 AM
you create the registers in the plugins and then you can view the current status in the diagnostic register section

this is a function i wrote to get the data out of the ini file
but this give you an idea of how you need to read a dro value, and set the registers values
the trick is to use the "mcCntlSetLastError" as a debugging tool to view in the history box what is happening.
so this function would be called from the load script then i have another function to keep the registers current that runs in the plc script.

Or you can create a button and under the button call the SetPartCount() function to test.
you dont have to be this elaborate to start with but the you still need to go through the whole process for each DRO, button and register to beable to read, write and control them. Name your controls and be consistent "drovar3901" as in this example i know that its a dro and 3901 is a fanuc variable that is used for holding the part count.
Code: [Select]
function SetPartCount()
    local inst = mc.mcGetInstance();
    --("iRegs0/Parts");
    local partsCounter = mc.mcProfileGetInt(inst , 'drovar3901' , "3901", val);
    mc.mcCntlSetPoundVar(inst, 3901, partsCounter)

    --("iRegs0/Required");
    local partsRequired = mc.mcProfileGetInt(inst , 'drovar3902' , "3902", val);
    mc.mcCntlSetPoundVar(inst, 3902, partsRequired)

    scr.SetProperty('drovar3901', 'Value', tostring(partsCounter));
    scr.SetProperty('drovar3902', 'Value', tostring(partsRequired));

    local hReg = mc.mcRegGetHandle(inst, 'iRegs0/Parts');
    mc.mcRegSetValue(hReg, partsCounter);
    local hReg = mc.mcRegGetHandle(inst, 'iRegs0/Required');
    mc.mcRegSetValue(hReg, partsRequired);

    --mc.mcCntlSetLastError(inst, 'partsCounter  = ' .. tostring(partsCounter));
    --mc.mcCntlSetLastError(inst, 'partsRequired = ' .. tostring(partsRequired));
end

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 11, 2015, 08:38:52 AM
Then a couple of screen clips that show naming and the ability to reset of the part count register back to 0
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 11, 2015, 01:38:03 PM
Here is a quick grid style spreadsheet layout wizard I made this morning to help me in calculating sheave selection based on tooth & ratios desired.
Uses the timer to auto calc, but this also gives you a good template to play with and learn from.
Relatively small and hopefully all can use.  ;)

basically you change the values in green and it updates the results
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 13, 2015, 11:09:35 AM
This original spread sheet was written by Gerald Dorrington of Mechtronics back in 2008 (Thank You)  :)

No idea where or when I came across it, but here is an example of how to take information provided and help create a Lua wizard.
By using the calculations from the spread sheet, helps to develop the Lua calculations. Gives instant feed back and troubleshooting capabilities.

Here I am passing the axis number to a function to calculate the correct column. And all based off the example lua.mcs file I'd provided earlier. Just with more functionality. Its not hard, just tedious and a process of test, test, test.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 14, 2015, 09:55:50 AM
The finished wizard having both Imperial and Metric Capabilities.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 24, 2015, 10:27:16 AM
Came across a great resource to help in creating Lua forms, takes a while to grasp, but once you get the idea you start understanding its abilities.

http://sourceforge.net/projects/wxformbuilder/
Title: Re: Screen Set Ideas
Post by: BR549 on January 24, 2015, 07:02:48 PM
Does anyone know HOW to expand the WX dialog box to full screen size ? I ran into this with wizards as well. 

(;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 24, 2015, 08:51:02 PM
This worked for me, tell it where to start and how big

MyDialog = wx.wxDialog (wx.NULL, wx.wxID_ANY, "", wx.wxPoint( 0,0 ), wx.wxSize( 1366,768 ), wx.wxDEFAULT_DIALOG_STYLE )
   MyDialog:SetSizeHints( wx.wxDefaultSize, wx.wxDefaultSize )

MyDialog:Show()


Spend a few hours with formbuilder and you start seeing what is needed to create popups.

Title: Re: Screen Set Ideas
Post by: BR549 on January 24, 2015, 09:14:14 PM
OK That worked with a new dialogbox  BUT did NOT work using it with the TOOL TABLE example.

I am using it to LEARN more.  I can manipulate most of everthing there BUT I cannot size the BOX to size NOR Resize the FONT.

Thanks for the help, THIS is going to be VERY painfull and require Many cups of coffee.

(:-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 24, 2015, 10:09:29 PM
--set the font size
    UI.ToolTableDialog:SetFont(wx.wxFont(12,0,0,0)) --changes the font to 12
Title: Re: Screen Set Ideas
Post by: BR549 on January 24, 2015, 10:29:25 PM
OK I found what I did wrong I left in the defaultsize calls and there was a conflict.

Thanks Craig I owe you one, (;-) TP
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 24, 2015, 10:43:21 PM
I create a header block that has most of the variables, I can then change them all together without searching

local frameCaption = "Wire EDM Cutting Data Chart"
local framePosition = wx.wxPoint(0, 25)
local frameSize = wx.wxSize(1100, 520)
local frameMinSize = wx.wxSize(1190, 920)
local frameMaxSize = wx.wxSize(-1, 1200)

local frameAbout = "About Wire EDM Cutting Data Chart"
local frameQuit = "Quit the program"
local frameStay = "Stay on top toggle"
local frameSetStatusText = "Welcome to Wire EDM Cutting Data Chart Wizard."
local frameMessageBox = " Wire EDM Cutting Data Chart Wizard \n\n"..
                        wxlua.wxLUA_VERSION_STRING.." built with "..wx.wxVERSION_STRING.."\n\n"..
                        "Author: Ya-Nvr-No\nDate created: 12/26/2014\nDate modified: 01/18/2015\n\n"..
                        "Reads & Writes to an excel.csv file"

local CSVFilename = "C://Mach4Hobby//Wizards//CSV//wire_edm_cutting_data.csv"
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 12:18:37 AM
Well I thought I had it BUT it will only go to about 3/4 screen size and that is it. No matter what settings I try. So there is something else hanging it up and keeping it from expanding full size.

(;-) TP

Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 12:51:11 AM
OK I found the problem. FINALLY

YOU HAVE to include a MIN and a MAX size to the box. all I had was a MAX.


OK Now the next thing to try and do is to create a BUTTON to do an OPTIONAL sort of the tool table based on DIAMETER and have it Smallest to largest order.

(;-) TP

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on January 25, 2015, 06:23:43 AM
Based on that your working with the Industrial Version, looks like your committed to learn mach4 and Lua  :D

I'd posted a sorting routine I created, thou I think you will have to sort the whole tool table data, so your not just sorting one field but an associated multi fielded array. And also check for the field value above zero or all you data will be at the bottom of the table based on smallest to largest diameter.
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 01:06:55 PM
Committed like the pig for breakfast bacon. ;D

Yes I understand when I sort it sorts the whole table but based on the Diam Field and reading smallest to largest.

With a LARGE tooltable (100+) you have to be able to FIND what you need, not spend time searching for it.

Another question on BUTTONS. I can put then LEFT CENTER RIGHT but NOT all on the same line. Any ideas??

I'll look for your sort code. >:D

(;-) TP

Title: Re: Screen Set Ideas
Post by: poppabear on January 25, 2015, 02:51:56 PM
Put them in a button sizer
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 04:53:09 PM
HIYA Scott I did use a Button sizer for all three. BUT I cannot figure out to place them all on the same PLANE in the dialog box. I can do L,C,R but they end up on 3 different levels in the box.

Left
           Center  
                           RIght

Instead of

Left      Center     Right

(;-) TP
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 05:01:03 PM
Here is the example code I am working with.
Title: Re: Screen Set Ideas
Post by: poppabear on January 25, 2015, 05:27:27 PM
--assumes…. You have already made the three buttons below.
--Terry: Look in Mach4 Tool Box, at the “Controls Code” example for a working example.

buttonSizer = wx.wxBoxSizer(wx.wxHORIZONTAL);
buttonSizer:Add(MyLeftButton,       0, wx.wxALIGN_LEFT+wx.wxRIGHT,    10);
buttonSizer:Add(MyMiddleButton,    0, wx.wxALIGN_CENTER+wx.wxRIGHT,    40);
buttonSizer:Add(MyRightButton,    0, wx.wxALIGN_RIGHT+wx.wxLEFT,    40);

--Scott
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 05:57:06 PM
Scott what I see is two different methodologies of doing it. You showed using the BoxSizer and the example I am following (M4 Lua Examples) uses a different approach with wx.wxStdDialogButtonSizer(). I am working with a dialog BOX. Maybe the same useage ????  I do not know.

VERY confusing at this point (;-)TP
Title: Re: Screen Set Ideas
Post by: poppabear on January 25, 2015, 06:05:39 PM
Terry, in your code there are several errors (in the one you posted here at least).
uncomment the LAST line so wx can run.
your using the same resource number for all your buttons,
Your using the same varible name for all your buttons,
your re-doing the dialog button call three times and when using a
vertical box sizer that is what is giving you three different rows...

Scott
Title: Re: Screen Set Ideas
Post by: poppabear on January 25, 2015, 06:44:55 PM
Terry,

Here is your tool table, fixed (for the 3 bottom buttons aliened).
I made a few changes, so I could work with it on my screen you can fix them back.

NOTE: in the buttons all three use the "wx.wxID_OK", as a button resource, I left that unchanged,
since if you assign button resources, it breaks the standarddialogbutton call.........  must be a "thing"
with that call. This may cause you an issue when you go to hook up, your buttons to an Event....
also, I changed each button to its own variable name instead of walking over the same one each time.

Scott
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 09:21:08 PM
Thanks Scott, I was using the same button to get a feel for teh aligment process. I know how to set up the button from working with the wizards. The sizer setup is new to me thus the confusion here.

I must have loaded up the wrong file because it runs fine here. Just the buttons missaligned.

IF I can find enough examples of MACH4 stuff  to work from I will be fine for the future. IT was the same way with Mach3/CB. I learned from and used examples.

Thanks, (;-) TP
Title: Re: Screen Set Ideas
Post by: BR549 on January 25, 2015, 09:45:47 PM
Thnaks Scott, I see where I went wrong.

(;-) TP
Title: Re: Screen Set Ideas
Post by: BR549 on January 31, 2015, 03:30:51 PM
FOR SURE the WxFormBuilder is a MACH4erteer's best FRIEND,

(;-) TP

Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on February 04, 2015, 08:12:45 PM
with the newest version of mach4 (2209) scaling is now checked with a new command.
scale = mc.mcAxisGetScale(inst, axis)

I created a little test script to see.

You set an axis scale with a g51 and turn them off with a g50 (note: g50 reset all the axis scales to 1)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on February 09, 2015, 11:04:28 PM
Playing around with a sketch to gcode routine, the wider the line the deeper the depth of cut. Converts pixel locations to x and y values. Would be pretty good for Watcom tablets and tracing those bar napkins. Shows the location in the status bar and only writes to the file when left button is pressed.


Thanks, Did that  ;)
Title: Re: Screen Set Ideas
Post by: dude1 on February 09, 2015, 11:10:44 PM
I think you need to to change your handle to professor yanvrno
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on February 14, 2015, 11:19:15 AM
Adding more features and options, working on being able to import a Drawing file and then scribble around in it.
Setting the size of the working area then fit image to limits.
Not sure if I can set a home position, but think it might be possible to click on a spot and make it 0,0
I can click on a spot and get its location just haven't figured out how to shift the coordinates.
Good thing to work on while its snowing and blowing outside.
Title: Re: Screen Set Ideas
Post by: Brian Barker on June 09, 2015, 03:52:41 PM
Crayola Cam is what I am going to call that..

I was going to do this so my kids could make the machine cut :)
Title: Re: Screen Set Ideas
Post by: Pedio on June 16, 2015, 06:57:32 PM
This is a wierd request - Is it possible to make the screen behind the tool path transparent? I would like to put a camera window behind the tool path window so I can position my work piece where the tool path will be. I know this is probably a lot more complex than I think.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 09, 2015, 02:16:11 PM
Raining again here so had some time to catch up a little and added this to a screen set this morning, been busy building things this year so Lua is on hold for the most part.

noticed a cool tool by chris and a request he had, so threw this together along with a request for a goto location button someone wanted.
http://www.machsupport.com/forum/index.php/topic,30461.msg211520.html#msg211520

the goto button uses the position in the dro boxes, then next to the box's are buttons that are used from a reference home to a location you drove the axis too. (so yes the axis's have to be referenced/homed)

And then If you update the values in the dro boxes after the move with the know distance traveled, when you press the button they pop up the new corrected count value for that axis.

the last image is the test code I used to create the script under the buttons for the count calculations.

Easy peasy... Have fun  ;) I have more to build
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on July 10, 2015, 06:13:06 AM
I noticed that recently the API had changed again and screwed up my fixture offset routine.

Took me a while to figure out what changed and how to fix it

But this is the basic script in the PLC and just some basic screen additions, just takes time and not giving up.

Code: [Select]
local var4014 = mc.mcCntlGetPoundVar(inst, 4014);
fixtureNum = (var4014*10)

scr.SetProperty('droFixture', 'Value', tostring(fixtureNum));
if (fixtureNum > 6 and fixtureNum < 127) then
    scr.SetProperty('txtFixture', 'Label', 'G54.1 P' .. tostring(fixtureNum-6));
else
    scr.SetProperty('txtFixture', 'Label', 'G' .. tostring(fixtureNum+53));
end
Title: Re: Screen Set Ideas
Post by: Screwie Louie on July 10, 2015, 12:11:29 PM
I get it!  ;D

...the 'newCounts' formula...

thanx!

--josh
Title: Re: Screen Set Ideas
Post by: Screwie Louie on July 10, 2015, 12:34:19 PM
Two questions for anyone who may know the answer...

1) Motor Counts are set from Mach4 Config menu. Is their a recall and set axis motor counts function at the user programmable level?

    i.e., The function call mc.mcMotorGetInfoStruct & mc.mcMotorSetInfoStruct is unavailable to me. Are motor counts assigned to pound variables by chance?
           --Another example are the jog increments that are set in the Config Menu. Where does Mach4 store these values and how can we retrieve and reset those values at a user programmable level?)
           --I hope I explained this well enough for you to visualize what I am asking....

2) mc.mcScrewMapping     --Isn't this the formal axis calibration function for mach4?


--josh
Title: Re: Screen Set Ideas
Post by: poppabear on July 10, 2015, 02:53:54 PM
>>>
1) Motor Counts are set from Mach4 Config menu. Is their a recall and set axis motor counts function at the user programmable level?

    i.e., The function call mc.mcMotorGetInfoStruct & mc.mcMotorSetInfoStruct is unavailable to me. Are motor counts assigned to pound variables by chance?

>>>Not from mcLua, but they are accessible via a plugin, motor counts are not accessable by pound variables,
>>>at least that I am aware of as of latest version

           --Another example are the jog increments that are set in the Config Menu. Where does Mach4 store these values and how can we retrieve and reset those values at a user programmable level?)

>>>See the "Diagnostic Register", and you can read/write to those registers with register Get/Set calls

2) mc.mcScrewMapping     --Isn't this the formal axis calibration function for mach4?

>>>This if for compensating for screw pitch errors, at set increments along a screw in encoder counts.
>>>Note: there is not a mc.mcScrewMapping call in mcLua, but there are "Screw Mapping" lua functions, of various
>>>flavors and types.

Scott
Title: Re: Screen Set Ideas
Post by: Screwie Louie on July 10, 2015, 03:26:58 PM
Thanx Scott.

Could I read/write from/to the profile's Machine.ini file's sections - keys - values (i.e.,  [Motor0] CountsPerUnit = some value) as an alternate way using mc.Profile* to get/set values of an info struct?
I'm gonna spend a few and experiment a little....


Title: Re: Screen Set Ideas
Post by: poppabear on July 10, 2015, 03:38:06 PM
Yes, you could do that as a work around

Good, idea!

perhaps try:

local CountsPerUnit = 0;
CountsPerUnit, rc = mc.mcProfileGetDouble(inst,"Motor0", "CountsPerUnit", 2000.0);   
rc = mc.mcProfileWriteDouble(inst,"Motor0", "CountsPerUnit", 2000.0);--12700.0

Scott
Title: Re: Screen Set Ideas
Post by: Screwie Louie on July 11, 2015, 01:23:09 PM
Can we program and create our own user definable sections - keys - values in the machine.ini file? ...or are we only limited to what is given?

no fair saying "a plugin can"  ;)

Can we just open the *.ini file in a text editor and create our own then reference them in scripts in so far as we are just building our own information structures where values can be saved and recalled....

See, this is my problem...I get excited, want to experiment, go down a rabbit hole but still need to do the original project...this is how schedule slips happen, lol!
Title: Re: Screen Set Ideas
Post by: poppabear on July 11, 2015, 05:31:34 PM
yes
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 21, 2015, 11:20:41 PM
Showing that merging screens are possible.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on August 23, 2015, 10:40:48 AM
Showing multiple stay on top wizards, all seeming to work well with the merging screen set data.

And a Lot of merging of code "screen load" and "PLC" scripts.  8)
Title: Re: Screen Set Ideas
Post by: DazTheGas on August 23, 2015, 11:44:55 AM
Showing multiple stay on top wizards

Nice..
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 16, 2015, 09:36:54 PM
wrote a little test script for under a button that aligns the master slave association.

homing X finds the switches and resets the counts to zero as usual.

then hit the button to auto remap the slave axis, set the counts off (3000 in this example) , it then moves to zero on that axis then sets them back to correct master slave relationships. Happens fast and automatically. Just have to know how many counts they are out.

was not possible till Steve added the API control to set home with a mc.mcMotorSetHomePos call.

Thanks Steve.



Title: Re: Screen Set Ideas
Post by: DazTheGas on September 17, 2015, 10:11:57 AM
Quote
was not possible till Steve added the API control to set home with a mc.mcMotorSetHomePos call.

Yeah thanks Steve, been busting my head with mc.mcAxisSetMachinePos(inst,0,0.0) but mc.mcMotorSetHomePos(inst,0,0) sorted it.

DazTheGas
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 28, 2015, 12:27:40 PM
Came across an Easter Egg today

Ctrl-Alt-Shift and then click the middle mouse button, and up pops this.
Title: Re: Screen Set Ideas
Post by: DazTheGas on September 28, 2015, 12:48:40 PM
I just want to know what possessed you in the first place to click Ctrl-Alt-Shift and click the middle mouse button ;-)

DazTheGAs
Title: Re: Screen Set Ideas
Post by: KingKerf on September 29, 2015, 04:15:15 PM
The wxWidget screen will come up with just CTRL+ALT+ middle mouse click.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on September 30, 2015, 09:11:37 AM
I just want to know what possessed you in the first place to click Ctrl-Alt-Shift and click the middle mouse button ;-)

I have been working with Art on a new program "LaserGear / Augmented Machine Controller" in development and it uses that key combination to stop processes that are in a running loop. So it was just a odd thing to try on my part and it popped up. Good to see we can drop the Shift. Never fully tested just was a fluke find. This new program of Art's is really cool. Great way to create a front end screen to control I/O boards and a lot more.
Title: Re: Screen Set Ideas
Post by: machiner on December 14, 2015, 07:56:43 AM
just noticed a 'text box' icon in the edit tools icon bar.  can't get it to work yet, can't find docs for it.
any information about it. ?  (build 2803)

Thanks
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 14, 2015, 08:51:34 AM
Seemed to work for me.  ???
Title: Re: Screen Set Ideas
Post by: machiner on December 14, 2015, 09:35:13 AM
first of all thanks for your reply

yes, i got that far. . . but i can't figure out how  to read and write to it

for instance this code >  '  local  xx = txt(1)  '  results in error message   > [string "C:\Users\VINCEN~1\AppData\Local\Temp\le3D02.m..."]:1: attempt to call global 'txt' (a nil value)

while ' scr.SetProperty(txt(1),'Label','*********') '  results in  [string "C:\Users\VINCEN~1\AppData\Local\Temp\le8DC1.m..."]:2: attempt to call global 'txt' (a nil value)

did you get yours to work ?
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 14, 2015, 11:17:05 AM
the only thing i see that can be done, is reading a register. (so not sure what id use a text box for other than reading and I assume writing to a register, sorry)

And not sure why i can not re-position the whole group of items in the screen set, they got moved down on the last save, testing this text box out.
(warning always make sure you scroll to the top of the screen before saving a screen set)

now i can not find where the position controls are for the whole group.  ???
Title: Re: Screen Set Ideas
Post by: DazTheGas on December 14, 2015, 11:29:15 AM
open your screen set in winrar or equiv and edit the screen.xml

Find "<Property name="Name">MainTabs</Property>"

And edit below it

Daz
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 14, 2015, 12:40:55 PM
LOL, that's one step backwards to me! used to be able to do it from the screen edit page.

I fought that issue before when i was playing with creating screens. And created a function that made sure that the groups were in location in the load script. Maybe its just that new mach4 screen set as I just used it as a test for the text box for machiner.
Left the warning for others to beware and enlightened.

Not sure why they dropped that edit position feature or at least made it default 0,0 position for the whole page group, I just assumed i'd never have to edit the xml file any longer now that they have copy, paste, export, import & insert abilities.

I have not edited a screen in months so it was kind of a ______ experience.


Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on December 15, 2015, 11:18:16 AM
found where to set position  :P

its under ManTabs, forgot I guess, like i said its been months.  ;D
  :-X

machiner: the only thing that can be read and controlled is what is in the list on the left. here is where I am reading the register.
but from your original question, you made it sound like the button did not work. (it does, just pretty much limited at this time)
could be pretty cool tool with some additional options.
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 19, 2018, 04:20:33 PM
WOW almost three years since i messed with this.

Was called out of retirement to help program a new machine, fanuc controls for a family of 46 parts
was asked to do a parametric program using Macro B
turned out to be a sweet series of several nested subroutines
all dimensions were put in a look up subroutine and passed to a calculation subroutine to compute start and stop locations.
based on the tool diameter entered in its own variable, so change tool diameter all positions are recalculated.

Including conveyor load/unload from both direction a part flip over, top and side drilling, probing of the parts and of the fixture change details for the many combinations of raw material

Thought id test out Mach4 abilities and help me with some of the while loops and subroutines that needed to be developed.

Which in the end all led me to a new macro variable screen tab set.

It was one tedious process of creating an organized well structured page.
started with the screen editor then organized and ordered the objects in an XML editor
then on to a text editor to replace values to align all the rows and columns, heights and widths of each
then copy and paste the master to create all the variable names and addresses making each group
and edit each variable name for that group tab set (something like 402 for each tab)
I estimate well over 35hours of ass time after I managed without it during the project, so next time i'm all set.

all during the two recent hurricanes, what a sight to witness and see what they leave behind.

and a little routine to clear macro variables
Code: [Select]
(CLEAR AND SET VARIABLES TO NIL)
#1=2
WHILE[#1 LE 999]DO1
#[#1]=#0
#1=#1+1
END1
#1=#0(RESET COUNTER BACK TO NIL)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 21, 2018, 09:18:39 PM
Added the ability to set field colors based on values
I added in the load script
vtimer=0
used to only update colors every 30 PLC loops


Code: [Select]
function GetPoundDroVariables()
    local inst = mc.mcGetInstance();
for i = 0, 999 do
local val = scr.GetProperty('drovar'..tostring(i),'Value','Value',0);
scr.SetProperty('drovar'..tostring(i), 'Fg Color', 'Black');
if val == '' then
val = tonumber(0)
else  
val = tonumber(val)
if val > 0 then
scr.SetProperty('drovar'..tostring(i), 'Fg Color', 'Blue');
elseif val < 0 and val > -99999 then
scr.SetProperty('drovar'..tostring(i), 'Fg Color', 'Red');
end
end
end
end

vtimer = vtimer + 1;
if vtimer == 30 then
vtimer = 0
GetPoundDroVariables();
end
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 26, 2018, 08:39:30 PM
Thought id show how you can pass hParam values to the tool table in mill mode, got the idea from Tuttles lathe project code he created passing values to his tool table.

First thing all macros need to be saved in .mcs extension not .lua
the ZeroBrane defaults to a .lua extension and that bit me.
as I found out they never get compiled in the mcLua.mcc file (why... good question it says lua, right in the name)  ::)

I attached the sample code so all can learn and play with.
no way is it clean & refined but gives you an idea how its done and how you can test in the ZeroBrane's debug mode

thanks SMurph making my life even more ...  :-*

and yes there are other ways to update the table (G10), this was just a challenge I wanted to learn from.
the default tool is the current tool but you can use and pass a t# to write data to different tools
could be made into a looping routine that cleans out all the data in the table.
its all about whats being passed and how it is used in the function.
Title: Re: Screen Set Ideas
Post by: smurph on October 28, 2018, 04:03:40 PM
Joyous?  I made you life more joyous, right?  :)
Title: Re: Screen Set Ideas
Post by: Tweakie.CNC on October 29, 2018, 03:16:43 AM
 :)
Title: Re: Screen Set Ideas
Post by: Ya-Nvr-No on October 29, 2018, 09:25:32 AM
 ::)  Funny guys,  ;D you know I love pushing  8)

showing how you can add to that same function, a start and stop tool cleanout routine using an "a# and b# value"
the loop uses "i" to select the current tool that needs cleaned out from a to b

Code: [Select]
local bVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_B)
local bFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_B)
--mc.mcCntlSetLastError(inst, 'bVal handle == ' .. tostring(bVal));
--mc.mcCntlSetLastError(inst, 'bFlag handle == ' .. tostring(bFlag));

if((aFlag == 1)and(bFlag == 1)) then
for i = aVal, bVal do
rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_POCKET,i,0)
        rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_HEIGHT,i,0)
rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_HEIGHT_W,i,0)
        rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_DIA,i,0)
        rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_DIA_W,i,0)
rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_X,i,0)
rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_X_W,i,0)
rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_Y,i,0)
rc=mc.mcToolSetData(inst,mc.MTOOL_MILL_Y_W,i,0)
        rc=mc.mcToolSetDesc(inst,i,tostring(""))
end
end