Author Topic: Add or edit Mach4 Lathe screen  (Read 662 times)

0 Members and 1 Guest are viewing this topic.

Offline daniba73

  • Active Member
  • Posts: 105
    • View Profile
Re: Add or edit Mach4 Lathe screen
« Reply #10 on: November 14, 2018, 03:52:44 PM »
YESSSS !! It works!!
I inserted script in the wrong page !!
now it's in the right place, it's all OK!
the translator helps a lot, but there is always a bit of difficulty in understanding well.
Thank you so much!!

Offline Cbyrdtopper

  • Active Member
  • Posts: 615
    • View Profile
    • Byrd Tool Corp.
Re: Add or edit Mach4 Lathe screen
« Reply #11 on: November 14, 2018, 04:45:05 PM »
Awesome! Glad you got it working!
=)
Chad Byrd

Offline daniba73

  • Active Member
  • Posts: 105
    • View Profile
Re: Add or edit Mach4 Lathe screen
« Reply #12 on: November 18, 2018, 03:52:19 AM »
I noticed that the M8 function is deactivated only with M9 or the corresponding screen button.
Both the RESET and ENAMLE buttons do not affect the status.
Is it normal or BUG of Mach4?
Is it possible to assign an external button?

Offline Cbyrdtopper

  • Active Member
  • Posts: 615
    • View Profile
    • Byrd Tool Corp.
Re: Add or edit Mach4 Lathe screen
« Reply #13 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)
« Last Edit: November 18, 2018, 03:03:33 PM by Cbyrdtopper »
Chad Byrd

Offline daniba73

  • Active Member
  • Posts: 105
    • View Profile
Re: Add or edit Mach4 Lathe screen
« Reply #14 on: November 19, 2018, 09:24:05 AM »
Hi,
Where should I enter this string?
also I would like to add to the RESET button stop coolant, how do you do it?
Mach4 is too complex to configure for many people.

Offline Cbyrdtopper

  • Active Member
  • Posts: 615
    • View Profile
    • Byrd Tool Corp.
Re: Add or edit Mach4 Lathe screen
« Reply #15 on: November 19, 2018, 09:43:57 AM »
You will put it inside the Reset Button.
Same as you enter in the PLC or Screen Load, it is in the second tab in the feature box.
There will be some script already in the button, just add this at the bottom of it.

Mach4, like anything new, requires patience and time to get an understanding of it.
I had no idea how to do anything in Mach4 when it first came out; I took time to learn it and understand what things did and how it all worked, there are still things I don't know how to do, but I will learn them.
Chad Byrd

Offline daniba73

  • Active Member
  • Posts: 105
    • View Profile
Re: Add or edit Mach4 Lathe screen
« Reply #16 on: November 19, 2018, 10:11:34 AM »
surely I'm wrong ... I have a series of errors.

Offline Cbyrdtopper

  • Active Member
  • Posts: 615
    • View Profile
    • Byrd Tool Corp.
Re: Add or edit Mach4 Lathe screen
« Reply #17 on: November 19, 2018, 11:09:26 AM »
What are your errors?
Chad Byrd

Offline daniba73

  • Active Member
  • Posts: 105
    • View Profile
Re: Add or edit Mach4 Lathe screen
« Reply #18 on: November 19, 2018, 11:27:16 AM »
I do not understand where you enter your string.


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


in the RESET functions what should I write?
I attach image

Offline Cbyrdtopper

  • Active Member
  • Posts: 615
    • View Profile
    • Byrd Tool Corp.
Re: Add or edit Mach4 Lathe screen
« Reply #19 on: November 19, 2018, 12:01:41 PM »
I had the Output handle wrong in the code I gave you.  I didn't think it was right, like I mentioned, needed to check that the signal call was all correct.
Put this code below the Set Last Error.

--Turn coolant off on Reset
local Coolant = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON)
mc.mcSignalSetState(Coolant, 0)
Chad Byrd