Hello Guest it is March 28, 2024, 08:38:39 AM

Author Topic: PoKeys 57E buttons, MACH4  (Read 4956 times)

0 Members and 1 Guest are viewing this topic.

Offline thosj

*
  •  532 532
    • View Profile
PoKeys 57E buttons, MACH4
« on: March 08, 2017, 06:20:48 AM »
I have a new PoKeys 57E. I need to get 5 buttons working before I can move on with my Mach4 learning experience. Well, actually 5 buttons and two analog pots. I downloaded the script for FRO on a pot with inputs 41/47 on the PoKeys, but out of the box it doesn't work. Someone on the Mach 4 thread is helping me there, so maybe.....

So I need 5 buttons to do:

Cycle Start
Cycle Start
Feed Hold
Coolant on/off (M8/M9)
Mist on/off (M7/M9)

I can't find anything in the documentation for a simple button in Mach4. I guess they think I just know how to do that. I find examples for all the complicated stuff, matrix keyboards, lcd's, but nothing for a simple button and how to make it work in Mach4.

Can anyone help me or point me? I need to get these 5 buttons and two pots working before I can confidently keep my painful transition to Mach 4 going.

Thanks, Tom
--
Tom

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PoKeys 57E buttons, MACH4
« Reply #1 on: May 19, 2017, 01:16:10 AM »
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope

Offline CRS

*
  •  61 61
    • View Profile
Re: PoKeys 57E buttons, MACH4
« Reply #2 on: May 19, 2017, 08:02:07 PM »
Hi Tom, I have the Pokeys 57E as well.  Actually maybe we have spoken on previous threads, can't remember, it's been a while since I was head down with my conversion.

Anyway, that same link that NeoTO suggested got me most of the way there a few months ago, so if it solves your question, then all good.

If not let me know as I have the basic things like Cycle Start, Reset, and Feed Hold working very well.  Lua still leaves me totally bewildered, there doesn't seem to be any easy way to learn it for raw beginners with no background in programming.  And from my searching there isn’t really any good intuitive help out there. Lots of online tutes, but they mostly change from 1st gear staight into 5th.  What happened to all those other gears?! Most the guys that helped me along the way seem to have some degree of a programming background.

Craig.

Offline thosj

*
  •  532 532
    • View Profile
Re: PoKeys 57E buttons, MACH4
« Reply #3 on: May 20, 2017, 07:33:00 PM »
Hi Craig, I believe we have conversed before!!

I have Cycle Start, Feed Hold, and Stop working. I can't figure out Coolant on/off or Mist on/off. I want one press of the (momentary) button to turn M8, Coolant ON, and the next press of the button to be M9, Coolant OFF. Same for M7/M9, another button. All I can figure out is read the state of a switch, but I want momentary switches, one press, ON, one press, OFF. I have this working in Mach3, which I've resorted to again because I don't have the time to invest in the summer to trying to get Mach4 working even rudimentarily!!

If you or anyone can tell me how to get a momentary switch to toggle coolant or mist on and off, I'd love it.

I did use the signal mapping tutorial and the built in to Mach4 help files to get what I have working, but I can't find any kind of coolant TOGGLE, just a way to sense a switch, if it's on, coolant ON, if it's OFF, coolant off, but no toggle to use a momentary switch. I don't want to move to on/off switches or I have to re-figure out Mach3 for THAT and I don't have the time or talent to do it this time of year. Too busy riding my bike, doing yard work, enjoying summer. Maybe next winter I'll fiddle with Mach4 again. It moves the 4 axes fine, but soon as you want to customize anything, it gets too hard.

Also not sure why this sat here from March 8 to May 19 for a reply, but it doesn't matter!! I'm sort of short on Mach4, it's always "You're stupid, we're making it simple and you can't figure it out."

Tom
--
Tom

Offline CRS

*
  •  61 61
    • View Profile
Re: PoKeys 57E buttons, MACH4
« Reply #4 on: May 21, 2017, 03:06:38 AM »
Good Evening Tom,

Looking at the time on your post, if it came straight through, you are about 9 hours east of me. I'm in Melbourne, Australia, where are you?

Interesting about the toggle/momentary thing.  I have my small Hercus mill with an ANCA control that I am slowly converting to Mach4 as well as kind of helping a good friend convert his old Bridgeport with a Bandit control to Mach4.  He was fortunate enough to get a retired friend of his to step in and take over all the electrics, freeing me to go on with life, but every now and then Mike, the chap helping my friend, phones to see if I can help with the software and Lua side of things.  Kind of the blind leading the blind.  AND, one of the latest hurdles, is how to get the spindle toggle button on the screen to emulate a real momentary switch.  Not exactly the same as your issue, but similar.

The Bridgeport has a system of latching relays to simply turn the spindle on, off and reverse.  The speed is set using the pulleys.  So when issuing an M3 or M4 from G code or the Mach screen, he has it all working, but of course it’s a constant ON condition either CW or CCW.  So if you push the momentary OFF button on the machine it certainly cuts the latch circuit and stops the machine, but as soon as you take your finger off the stop button the circuit re-latches and the spindle restarts because Mach still has it powered on.

Just as a side, we are both using the ESS with a CNCRoom MB2 beak out board. And I also have the Pokeys 57E for more IO and the analog inputs.

My friend wants to keep the machine switches the way they are.  So yes, how to get a momentary/toggle signal.  I asked this of Rob Gaudette through the Mach support page way back in January.  I think I was asking for the purposes of having external jog buttons.  My question wasn’t actually on the response email, so I can’t remember.  It wasn’t long after that I had to pull the pin and get into house renovations, so I never actually did anything with it YET!  I will post his email to me and the two files he sent.  It still doesn’t make sense to me, but if I just follow what he says to do, maybe the penny will drop.

And yes, your last though about how it feels with learning Lua and Mach4 is correct.  However there have been some really helpful guys come to my aid, but I still struggle to understand when they explain.

Below is the email from Rob.

Regards,

Craig.

Craig,

I have attached an emulated toggle button in a screen for your configuration purposes. I know you will be using a physical toggle, but this will be how you could set this up. Look at the button in screen edit. I have it triggered and mapped to output #3. So when you are ready you would wire up your switch to an output, then take a look at the attached code example, I know it is written for inputs, but you can change these. You will have the code in the in the screen load script, and when the output is active, then you will run the ButtonJogModeToggle() function

Offline thosj

*
  •  532 532
    • View Profile
Re: PoKeys 57E buttons, MACH4
« Reply #5 on: May 21, 2017, 09:01:19 AM »
Craig, I wasn't referring to your post I was referring to NeoTO's post, March 8 for my OP, May 19 for his reply!! NeoTo is a Pokeys person. But, like I said, no big deal.

I am in Wisconsin, USA!!

I don't see any files attached to your post, not sure if you forgot them or they don't show for me, or what.

Like I said, my issue isn't with mapping the signal in Mach4, it's figuring out what internal command TOGGLES the coolant/mist.

Thanks
Tom
--
Tom

Offline CRS

*
  •  61 61
    • View Profile
Re: PoKeys 57E buttons, MACH4
« Reply #6 on: May 21, 2017, 03:53:01 PM »
Hi Tom, yes I noticed that your original post was back in March after I sent you my first post.  I had only looked at NeoTO's date.  So all good.

We were in the US for a holiday last year in June-July.  Never made it to Wisconsin.  Just the normal tourist things like Disney land, Grand Canyon, Hoover Dam etc..

I have tried several times to get these files uploaded, but something freaks out, tells me there is already a file of that name.  I will rename them with .txt extensions and try that.  So you just change them back to Signal Library.mcs and wx4_Button_Hack.set.
Maybe you can get some use with them.  Have a great week Tom.

Regards,

Craig