Hello Guest it is May 11, 2021, 12:20:28 AM

Show Posts

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

Messages - TonyMemphis

Pages: 1 2 »
Mach4 General Discussion / Default Jog Speed/Rate Value?
« on: September 17, 2020, 04:31:54 PM »
I'm using the Avid CNC setup on one of their Standard machines. 

I'd like to have the Jog rate set at around 35 or so as my default.  I have been searching all around trying to find how that is set.  I saw on the screen close script, there is a save to the Machine.ini file. But for some reason, that doesn't always save the current setting.  I manually changed the value in the ini file and that works, but if I change the rate on the screen, then close, it doesn't get saved.  Any ideas?  Thanks!


Mach4 General Discussion / Re: Cycle Time Display
« on: May 19, 2020, 10:10:39 PM »
Thanks.  My script looks the same.  On my system, when the Gcode is finished, it is rewound and the cycle time is changed to 00:00:00.0.

 I played around with it today.  What I ended up doing is a little crude, but it is working.  In the PLC script, I check to see if the MachEnable variable has changed value.  I added a text box called TonyTime.  If the MachEnable is 1 and the value of the CycleTime label is NOT 00.:00:00.0, then I set the  Label of TonyTime to the same as the CycleTime Label value (I use a variable).  I then added a button that resets TonyTime to 00...   Seems to work. 

I looked at my Gcode files.  I use Vcarve Pro, btw.  There is an M30 at the end which I think does the End and rewind? 

Sorry, I don't have the code on this PC.  Its on the laptop in the shop.   


Mach4 General Discussion / Cycle Time Display
« on: May 18, 2020, 11:29:56 PM »
I'm using the Avid set...  There is a text box that displays the cycle time.  I managed to find the function in the PLC script that sets the value there if the machEnabled variable is 1.  My issue is that I want to see the cycle time when after the G code is complete, but the value is set to zero before I can see it.  The script only changes the value is the machine is enabled.  I can't figure out how the value gets changed back to zero?  The text box has an event set "On Update Script," but I'm not sure what that means and I can't find it mentioned anywhere. 

If I can figure this out, I may have a text box display the last cycle time and a double click event to clear it to zero or something like that. 

I wish there was some better documentation of this stuff.  I have searched and looked at the help file before I bothered asking.  I appreciate the help.

Any ideas? 


Mach4 General Discussion / Thanks again....
« on: February 17, 2020, 10:51:18 PM »
Thanks for the link to your Signals tutorial Craig.  Appreciate the link and the effort.  And thanks for the info on "Enable with machine" swifty.  I have all my scripts running now.  Oh what a feeling!

I found myself repeating code, so I'm now reading up on functions.


Mach4 General Discussion / This seems to work...
« on: February 13, 2020, 02:35:54 PM »
Looks like when the machine coords signal is changed, the toggle button and dro's are toggled as well.  So I think this will do what I want.  It seems to work.  How exciting!

Code: [Select]
--attempt to check state of machine coords and change to machine coords if they are not
--already 1=true = machine  0 = false = work

local inst = mc.mcGetInstance()
local hsig = mc.mcSignalGetHandle(inst, mc.OSIG_MACHINE_CORD)
local sig = mc.mcSignalGetState(hsig)

if (sig == 0) then

Mach4 General Discussion / Toggle Machine Coordinates from a script
« on: February 13, 2020, 01:06:10 PM »
Sorry to keep asking...the lack of documentation makes this stuff pretty frustrating.  I really appreciate your help!  Thank you!

So, I've been doing a lot of digging, but not found a solution.  I want to make sure I am in in Machine Coordinates modes and that the DRO's display machine coords before I start a procedure.  I can check the state using OSIG_MACHINE_CORD and that works.  But how to toggle the,m if they are on Work Coordinates?  Back to my VB days, I thought I'd just click the button but I read that is not a good method and I couldn't get it to work. 

In my playing, I found that the Machine Coordinates On action doesn't work?  Off works and Toggle works, but On doesn't.  Wasn't sure how to do that from the script anyway. 

Any ideas?  Do I need to change the signal?  Will that toggle the screen DRO's and button?  I haven't tried that sort of thing yet.


Mach4 General Discussion / This works
« on: February 12, 2020, 05:38:42 PM »
I cut and pasted an example from the Mach4 Scripting manual (for spindle) and it worked fine.  So, I changed the signal name and it works just fine.  Maybe my variable names were not good?

Anyway, thanks again. 

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

local hsig = mc.mcSignalGetHandle(inst, mc.OSIG_MACHINE_ENABLED)
local Mstate = mc.mcSignalGetState(hsig)

local msg = "Machine state = "..Mstate

Ahh..I just noticed that in the crash version, I used this  mc.mcSignalGetState(inst,variable) and in the version that works, I just used the handle variable. 

Mach4 General Discussion / Crash!
« on: February 12, 2020, 04:51:44 PM »
Well, I tried to just get the state and it runs in the debugger ok, but when I save it and go back to Mach and try the button, it crashes MAch4.  The button is on a panel if that makes any difference?

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

local mHandle = mc.mcSignalGetHandle(inst,mc.OSIG_MACHINE_ENABLED)
local mState = mc.mcSignalGetState(inst,mHandle)

msg = "Current machine state is "..mState

Mach4 General Discussion / Thank you!
« on: February 12, 2020, 12:41:34 PM »
That gives me plenty to chew on.  I'll head out to the shop this afternoon and play/learn a little.  I really appreciate the help.  At some point I'll get comfortable enough with this stuff to so the few things I want and just make stuff! 

I'm trying to go a little deeper and add more safety/error capture/etc. to this stuff.  In most of the VB and other stuff I have done, the consequences are a nuisance.  With this, bad things can happen!  I used to work at a aftermarket automotive camshaft company.  We made cam lobe grinding masters on a mill with a rotary table.  My co-hort ran the mill right through the table!  We learned that the machine does what you tell it and tried very hard to get there - regardless of what is in the way.

Thanks again,


Mach4 General Discussion / Re: How to determine enabled/disabled state?
« on: February 11, 2020, 11:55:21 PM »
Well, I've been reading a lot (my eyes are going crossed and my head hurts).  I see where I can use the scr calls to get/set button properties.  That might be helpful if/when I can figure it out.  And then I see there is a signal  mc.OSIG_MACHINE_ENABLED that might be what  I am after, but I am still trying to figure out just how to read the state of that signal.

Going to bed now.....

Pages: 1 2 »