Hello Guest it is March 28, 2024, 09:40:29 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 - Cbyrdtopper

391
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 18, 2018, 03:01:31 PM »
No, it is not a bug.  That is how Artsoft set it up in the default system.
I always add stuff to the Reset Button.
I actually add a Reset Function to the Screen Load script called "Reset()"  I have a physical button on a control panel that I use as a Reset Button; then I put everything in this function that I want to happen when I hit the Reset Button.  
Things like Turning off the Coolant, Mist, Stacklights, Etc...
But you can just add some script to the Reset Button.
To turn off the coolant use this script (Check the syntax and the mc call, I'm out of Mach4 right now, but I think this is right.)

local Coolant = mc.mcSignalGetHandle (inst, mc.OSIG_COOLANT)
mc.mcSignalSetState (Coolant, 0)

392
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 14, 2018, 04:45:05 PM »
Awesome! Glad you got it working!
=)

393
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 14, 2018, 11:01:27 AM »
Hmm..
Try and take the code out of the PLC Script to see if you are still getting the error. 
I moved my code to the top of the PLC script to be sure it was still working; it is.


394
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 12, 2018, 01:36:50 PM »
That's the exact code I've got in my PLC script and it is working fine.
Did you put it at the end to make sure it isn't inside another bit of code?

395
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 12, 2018, 11:18:26 AM »
Sorry for the delay in response.
Make sure you put custom code towards the end of the PLC script.
That way you don't put it inside another section of code.
Also be sure that the comments have the "--" in front of them.  That makes it a comment in LUA.

I forgot you want this to sound during your tool change. 
You can still put this in your PLC Script.  But now, you will need to get the handle of the Tool Change Output.
When the Tool Change Output is active, play the sound.
I will see if I can get this to work on my computer in the sim and post my findings.

396
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 09, 2018, 02:46:32 PM »
RT,
So... snd:Play()   plays the sound.   
Does it play the file once and stop?

397
Mach4 General Discussion / Re: Add or edit Mach4 Lathe screen
« on: November 09, 2018, 10:34:25 AM »
You can have your Rapid Rate Override set to 25% in the PLC script on start up.
Put this code in the PLC Script from the screen editor.


--Featured added 11-9-18
--Set RRO to 25% on start up
if testcount == 1 then
    mc.mcCntlSetRRO(inst, 25)
end


As far as playing a tone off the computer through speakers, I'm not sure, someone else would need to help you with that.

But, I have Stack Lights that have buzzers integrated in them on our machines here at the shop, you can use the "Tool Change" output in the mach configuration and map it to a relay that runs a buzzer or beeper.  You can get simple buzzers on ebay or places like Automationdirect.com. 

398
Mach4 General Discussion / Re: Spindle speed buttons
« on: November 08, 2018, 05:29:39 PM »
Whatever spindle speed you command in G Code will be the RPM at 100% Spindle Override.
So when you post your G Code, just be sure that RPM is set to 12,000. 
Will that always be what you want your Spindle RPM to be set at?

399
Mach4 General Discussion / Re: Spindle speed buttons
« on: November 08, 2018, 04:28:30 PM »
Vivek,
You can use the following code inside your buttons.
In your G Code, have a commanded Spindle RPM of 12,000.

mc.mcSpindleSetOverride(inst, 0.500)  -- This is for speed or 6000
mc.mcSpindleSetOverride(inst, 0.667)  -- This is for speed of 8000
mc.mcSpindleSetOverride(inst, 0.833)  -- This is for speed of 10000
mc.mcSpindleSetOverride(inst, 1.000)  -- This is for speed of 12000
mc.mcSpindleSetOverride(inst, 1.167)  -- This is for speed of 14000
mc.mcSpindleSetOverride(inst, 1.333)  -- This is for speed of 16000
mc.mcSpindleSetOverride(inst, 1.500)  -- This is for speed of 18000

400
Mach4 General Discussion / Re: Spindle speed buttons
« on: November 08, 2018, 04:14:31 PM »
Vivek,
Okay.  You can only go to 150 percent. That being said, If you make 12,000 RPM is at 100% then 50% is 6,000 RPM and 150% IS 18,000 RPM. 
Would that work? 
That would allow you to add buttons to reach your min and your max RPM.
If that works I can help you get the buttons to work correctly.