Hello Guest it is April 19, 2024, 05:53:09 AM

Author Topic: PoIL and Mach4 plugin  (Read 3997 times)

0 Members and 1 Guest are viewing this topic.

PoIL and Mach4 plugin
« on: September 10, 2016, 02:43:02 PM »
Is it possible to program the pokeys 56e with poblocks and use the mach4 plugin at the same time?

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PoIL and Mach4 plugin
« Reply #1 on: September 11, 2016, 04:50:30 AM »
Yes, it is. The only limitation is that PoBlocks application and Mach4 can't run at the same time since only one application on the PC can access the device at a time.

Develop the project in PoBlocks, the disconnect the app from PoKeys device before starting Mach4.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PoIL and Mach4 plugin
« Reply #2 on: September 11, 2016, 10:01:40 AM »
Thanks for the answer.  What I am trying to do is add a beeper to my key presses in mach4.  I have it working in poblocks with a pwm output, but not sure how to do it with mach active.

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PoIL and Mach4 plugin
« Reply #3 on: September 11, 2016, 10:55:56 AM »
This should be simple - use Digital input block (don't forget to uncheck 'Initialize function' property) for each key pin, wire it to Rising edge block (under trigger/timing blocks), wire all outputs of those to OR gates (set the Inputs property to maximum value of 4 to reduce the number of these gates needed), then the single output signal to a Pulse timer, that activates the PWM output :)
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PoIL and Mach4 plugin
« Reply #4 on: September 11, 2016, 11:01:37 AM »
That's what I did in poblocks.  Problem is I want it to work while running mach4.  Is there a way to view the code that makes this happen to help me integrate it into the mach plc lua code?

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PoIL and Mach4 plugin
« Reply #5 on: September 11, 2016, 11:37:09 AM »
You can use the shared slot communication support - this way you can communicate between Mach4 and PoBlocks project. In Mach4, enable shared slot support in the plugin settings and in PoBlocks use either the dedicated shared data blocks or share the port of an existing one. In LUA, registers can be accessed as 'PoIL shared #num'.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PoIL and Mach4 plugin
« Reply #6 on: September 13, 2016, 08:21:38 PM »
I made that way too complicated in my head.  Just select the input pins for shared slot communication in PoBlocks and it works like magic!  Biggest issue I learned was you can't invert a pin in PoBlocks if it isn't inverted in Mach.