Hello Guest it is October 21, 2020, 03:31:05 PM

Author Topic: how to use macros with Pokeys 57E  (Read 2210 times)

0 Members and 1 Guest are viewing this topic.

how to use macros with Pokeys 57E
« on: May 18, 2016, 05:51:59 AM »
Hi All

I am in the process of converting my Emcoturn lathe to Mach3 and I am incorporating a Pokeys (Ethernet version)

to help with the control panel.

The lathe has 8 stations and I have modified my tool change macro so that when I enter T101 ...to....T808 into

the MDI line it works fine . However it is very cumbersome and slow with a lot of typing involved. (well, it feels like it at the time !!)

I have spare buttons on my control panel and would like link one button to each tool change position.

(ie button 1 pressed runs macro with line    Code (" T101 ")   etc etc

I did link up one button to run a macro to index the turret one position for each press of the button

(which works well but is very slow in operation as it fully locks the tool home each time)

using SetTriggerMacro in association with OEM code 301

but that " appears " to only allow control of one macro. I want 8 one for each button.

I used to have the Pokeys 56 Usb version a few years ago  and I have it in the back of my mind that

I was able to directly link every button straight away to a macro.

I suspect I am missing something very obvious and everyone is laughing at my stupidity but I just

can't for the life of me see what to do.

Can anyone out there help and put me out of my misery

cheers George
Re: how to use macros with Pokeys 57E
« Reply #1 on: May 20, 2016, 04:21:45 PM »
Hi All

I think I've cracked it (well it seems to be working so far)

I tried and better tried to get mach to read pokeys pins directly but gave up in end

So if anyone else is interested this is a workaround.

1) In the General config page on the initialization string I added M1201

This initializes a watchdog macro  just waiting for the trigger OEM command 301

2) Created Macro M1201 (only two lines)

SetTriggerMacro(1221)    : When 301 is recieved Macro 1221 is actuated
SetMacroZero(4)             : This zeros the dro

3) Went into Pokeys configuration page and mapped the 8 buttons I wanted to

use via IO column to Input OEM Trig#1.......to Input OEM Trig  #8   (in order)

4) went to system Hotkeys setup   External Buttons OEM codes

and set Trigger#1.. to.. Trigger#8  ALL   to 301

this means that all the buttons would would call macro M1221 if pressed

5) Created Macro M1221

If IsActive(29) Then        : 29 is the signal number of Trigger#1 (    See Mach3 wiki vb constants and signals)
    Code("T101")            :  Write to toolchange command to MDI
End If
.                                  : same format for all tool with signal numbers 29.to..36
If IsActive(36) Then
End If

As I have said It seems to be working so far.

If anyone can see any improvements or a less winded approach

it would be great to hear from them as I am still new to this game.

cheers George

ps I already had a macro using OEM 301 that indexed one tool per button press

but had to wipe that as far as I can see it will only work for one macro. (I think)
Re: how to use macros with Pokeys 57E
« Reply #2 on: May 21, 2016, 05:23:35 AM »
Thinking about this a little it could very easily be adapted so up to 15

buttons could be indirectly mapped to macros ie 15 Trigger signals 29-43

If IsActive(29) Then
   Code("M***1")        :ie call the macro of your choice   
End If
If IsActive(43) Then

not tried it yet but can't see why it wouldn't work if rest works.

Hope this may be of some use to someone

Cheers George