Hello Guest it is April 25, 2024, 03:14:55 PM

Author Topic: IO Mapping looks off by one ?  (Read 3317 times)

0 Members and 1 Guest are viewing this topic.

IO Mapping looks off by one ?
« on: November 23, 2010, 05:45:35 PM »
OK, getting started on the User Interface for BP421 Project.  So I thought I would start with something simple like a couple of buttons.  Just simple Digital Inputs.

I had a button connected to Pin 1 on the PoKeys Hardware and configured as Digital Input.  The diagnostic screen shows pin moving but it is not reflected on the Mach Diagnostic Screen.  

So, I them moved the button to Pin 2 of the PoKeys Hardware, the diagnostic screen shows pin2 as functional (just like with pin 1) but the Mach diagnostic screen is off by one!

Just thought I would ask before I waste more time...

Any Ideas?
JH

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: IO Mapping looks off by one ?
« Reply #1 on: November 24, 2010, 11:37:23 AM »
in your plugin config, put your IO led start range at 2001, NOT 2000....... (see readme file in installer zip).
fun times
Re: IO Mapping looks off by one ?
« Reply #2 on: November 24, 2010, 01:28:13 PM »
Thanks !   That was it, I now have 2 buttons working and the MPG !

Next Question: How do I link an external PoKeys button to Macro Code to Run?  I know how to add buttons onto the Mach3 Screen and link these to macros (ie M1000.m1s, M1001.m1s .... )  So, what is the trick to make one of these new external buttons run some Macro Code?

If I need a brain to do this, do you have a small sample brain that I can use to make this link between PoKeys External Buttons (ULED 2000, ULED 2001) and Macro Code (M1000.m1s, M1001.m1s)

Thanks,
JH

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: IO Mapping looks off by one ?
« Reply #3 on: November 24, 2010, 08:04:56 PM »
for trigger macro from brains (note limit of only ONE macro)

Set Trigger Macro using “Push User Button” in Brians:

First, you dont put the code in a button, you put it in a macro file. For
example file: m600.m1s
SetMessage( "This is a macro call..")

Then , you have to set that macro to be the default macro call with a call to
SetTriggerMacro( 600 ) at some point in the program, an init string could do
that if the SetTriggerMacro call were in another macro file that is called on
startup.  Then the brain will execute m600 whenever that brain termination code is
called.

For MORE than one macro triggered from external buttons..... you have three options:

1). put VB in your Macro pump to watch the leds, and then run the macros, (remember you will need interlocks in the macro pump
so you dont get multiple triggers due to the scan time. (look for the blurb I did for Interlocks in the VB section).

2). Buy a copy of Mach MAD (shameless plug for my plug, only 10 bucks!!  "What a Bargin......." hehehee. at any rate you can trigger upto FIFTEEN
user macros, you just choose what ULED triggers it, and put the macro number that it controls, (interlock code is already taken care of in the plugin).

3). Write your own plugin to do it.

of the 3: Macropump is obviously the cheapest solution, all it cost you is your time........

scott
fun times
Re: IO Mapping looks off by one ?
« Reply #4 on: November 24, 2010, 08:21:23 PM »
Thanks Brother !   Happy Turkey Day Too.....

Macro Pump with Interlocks.... I love macros :)

JH