Hello Guest it is April 19, 2024, 03:59:50 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - jm1937

Pages: 1
1
Mach4 General Discussion / Using modules from Mcodes
« on: June 03, 2020, 02:38:47 PM »
I know this question has been asked & answered, and I've found those forums posts already -- please read without dismissing, there's a nuance here.

I have a module I've written which connects to a serial device (a small pump).  I wrote button for my screen set to use the module to communicate with the pump, and it works well.  For simplicity, I put the "connect" function of my module in the screen load script.

I also want to be able to turn the pump on & off in m-code macros during movement operations, using the "load_modules.mcs" script which is floating around this forum.  However, when I run the Mcode, the serial port is unavailable -- it's already open in a *separate* lua instance from the screen buttons!  I removed the "connect" function from my screen load script and made a connect/disconnect button on my screen, but the operator will need to remember to disconnect from the pump before running any Gcode w/ macros.

How can I have the Mcode macros and my screen "share" an instance of a module? I can't find any documentation related to passing objets back and forth to macros outside of registers.



How can I make the screen and my macros

2
Mach4 General Discussion / Using the Serial plugin from a macro
« on: April 01, 2019, 02:49:56 PM »
Hello all-
I have what you might consider to be a mist/flood attachment i'd like come on with M3 and turn off with M5 (on top of the spindle on/off relay).  It takes serial commands for on/off with additional parameters (like flow rate, for instance) over a traditional COM port. I've tested it and it works well through CoolTerm, but I'd like to write a macro that M3 and M5 turns it on/off.  I loaded the COM parameters in to the Serial plugin that ships with Mach4, but I'm wondering how to call it from a Macro using Lua.  Do I need to import luars232 or is it callable via an mc() function available from the serial plugin?
I'm using Mach4+ESS on windows 10, with a 3-axis router table.

Pages: 1