Hello Guest it is May 15, 2024, 04:07:32 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ya-Nvr-No

111
Mach4 General Discussion / Re: Screen Set Ideas
« 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

112
Mach4 General Discussion / Re: Screen Set Ideas
« 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

113
Mach4 General Discussion / Re: Screen Set Ideas
« 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


114
Cant say it was a simple implementation,  ;) as it took a couple of days of debugging to get it to work perfect. real dance with the c code threads. The more I learn about programming the better I get at achieving my needs.

Hopefully when I start creating my dream projects, I will provide some videos that show more. But the real show to me is what's inside. I've been a tool maker for over 45 years, learning to control those tools is what drives and impresses me now days.  ;D Because when it comes down to it, we just want to get the job done.

115
Other than what I posted on the dynomotion site I have kept it pretty :-X But its damn functional for what my plans are for it. I love the kanalog board that goes with the kflop, true servo motor control. Nice to be able to control both positioning and low to full speed with either a positional movement "G0 C45" or a mcode "m4 S900" and then also do the same with a mill spindle head "G0 B180" or "m104 S3000" and use both spindles at the same time in any combination. m102 turns off the mill spindle or m5 turns both off And being servo its fast. Also the spindle override slider works to control them independent. Then as soon as the spindle stops the axis DRO is updated, the C program source code computes and updates to the correct 0-360 degree. Also on a m30 I have it spindle orient so the chuck key slot is up and accessible. Also as a plan is using it as a tool and cutter grinder to resharpen end mills. Just takes a lot of time to get it all to come together. I was out writing macros today to do spiral machining.

Servo tuning with the Dynomotion system gives me some rigid spindle holding capabilities.

On a side note, two of my routers have the provision for a dumore tool post grinder mount that I use to resharpen my lawn mower blades. Its all automatic and although it takes most of a work day for a 6 blades, they never need to be checked for balance.  ;) Ya-Nvr-No what I,m doing from day today. So I always design and build for fit, function and adaptability. I write alot of parametric macros, easy for me to follow and they are tight & short. Gets the job done well and again, adaptable.

116
Mach4 General Discussion / Re: Screen Set Ideas
« 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

117
Using 4 tools I ran my first full program to complete a 1/4-28 bolt with a 1/2" hex including part off. So its coming along nicely.

You think Lua is tough, working with Dynomotions C programs makes it all worth while. Whole different world working with source code and controlling machines. Then again Macro A and FapLadder was a PITA to learn too.  8)

118
Mach4 General Discussion / Re: Screen Set Ideas
« 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.

119
Thanks Dan for letting me try your code out, not sure id ever use it but Ya-Nvr-No

Had to make some changes as it did not work the same for me as you.
It did not want to rotate the spindle fully till I added some multipliers and loop indexers
but I did get it to work, cool code thou confusing to follow.

Here's a real short clip of it running. (slow) ;)

http://youtu.be/kA1u10cX2SM

Update: Think I figured a use for this, I need to create a hex in some large screws. Think I will try to adapt it to do ID hex profiling, If I can get it close to size I can then Grind a hex in a old carbide end mill and then use it as a sizing broach.  8)

120
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: January 06, 2015, 08:38:22 AM »
I can confirm, that it works ... at least in my Lua scripted Wizard:
found on page 3 message #27

As I learn more about Lua coding, I like to go back every so often and reread old threads to see what others know and share.

Did not follow just what was going on here at the time, as it did not seem to make sense how to get his code to work or just what he was trying to show. now with time and more understanding I did get this to work. Had to add the call to main() and mainframe:Show(true)
But when you close the popup window it places the text in the windows clipboard. So if you use paste too, in a text editor you will see the message.

Thanks Paul --these are the guys that are in the background doing things the rest of us struggle with.  ;)

Code: [Select]
function onCloseEventOccurred(event)
--exit frame, if it exists
if mainframe then
mainframe:Destroy()
mainframe = nil
end

local clipBoard = wx.wxClipboard.Get()
if clipBoard and clipBoard:Open() then
clipBoard:SetData(wx.wxTextDataObject('hello world\nI was copied to the clip board\n'))
clipBoard:Flush()
clipBoard:Close()
end
end

function main()
mainframe = wx.wxFrame(wx.NULL, -- no parent
wx.wxID_ANY, -- whatever for wxWindow ID
"Example",-- frame caption
wx.wxDefaultPosition,-- place the frame in default position
wx.wxSize(400, 200),  -- Window popup screen size
wx.wxDEFAULT_FRAME_STYLE) -- use default frame styles
mainframe:Connect(wx.wxEVT_CLOSE_WINDOW,onCloseEventOccurred)
end

main() -- you have to call the function
mainframe:Show(true) -- then you have to show it

You would paste this in the mcLuaEditor save it to your wizard folder run it and then when you close it your message is available.