Hello Guest it is March 29, 2024, 02:53:51 AM

Author Topic: Can you use Inputs with Macro B Programming.  (Read 6217 times)

0 Members and 1 Guest are viewing this topic.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Can you use Inputs with Macro B Programming.
« Reply #10 on: November 20, 2017, 06:55:03 PM »
That looks like it might just do the trick.  :)

Ok, I read your dad's post.

When a script is run from a screen control or G code via mcGcodeExecute/Wait(), it will lock the GUI for the duration of the script.  Why?  Because the button click event is the action that causes the script to run.  And it needs to complete.  The application event loop only processes one event at a time.  Screen updates are also events. 

Say you are the application event loop and I am the user of the machine control.  I'm not telling you to do anything at the moment, so you are spending your time running around the screen and updating DROs and such.  But all of a sudden, I press a button that basically says "Cbyrdtopper, go do this script task".  So you go running off to do the script.  So who is updating the DROs now?  Nobody. 

So what mechanism(s) can we use to make this better? 

1) Use the PLC script.  Most buttons scripts should be short and sweet without loops or calls to code that has loops in it.  If a long running task is needed it is better to just set a variable to initiate the action in the button script.  Then a state machine (that watches that variable) can be implemented to process the task in the PLC script. 

2) Hand the action off to the interpreter.  An example of this is the MDI.  You type some G code in and hit cycle start.  The cycle start button just starts the interpreter and comes back immediately.  So the GUI is functional and screen updates happen.  But the state of the machine has changed from idle to MDIrunning.  So you can now wait on the state to transistion back to idle.  The other use of the interpreter is to let it do the complete action (via Macro B), as you are discovering. 

Otherwise, you will need to get into advance LUA programming and use coroutines.  That isn't a road that is easily traveled.  :(



Re: Can you use Inputs with Macro B Programming.
« Reply #11 on: November 20, 2017, 08:16:33 PM »
Hi,
fascinating thread....smurph, you certainly know how to engage ones grey matter!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Can you use Inputs with Macro B Programming.
« Reply #12 on: November 20, 2017, 09:02:59 PM »
That is a great explanation.   It makes a lot of sense.   
I was playing with the DRO Variables and was able to get the GCode variables to work with them.   So that was exciting.   I'm going to play around more in the morning with this and do some more research on the loops.   
Chad Byrd
Re: Can you use Inputs with Macro B Programming.
« Reply #13 on: November 21, 2017, 01:36:20 AM »
Hi smurph,
I've been reading up on Macro B and now start to understand how it can be used.

It is included in Industrial. Is there any particular reason or rationale that prevents it being implemented in Hobby?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Can you use Inputs with Macro B Programming.
« Reply #14 on: November 21, 2017, 01:46:43 AM »
Well...  It is something that is more for industrial types of environments.  And it wasn't in Mach3.  So they sales dept. decided it was to be an industrial feature.  I'm not sure if it can be "added on" with another license or not.  I'll check. 

Steve
Re: Can you use Inputs with Macro B Programming.
« Reply #15 on: November 21, 2017, 02:05:05 AM »
Hi smurph,
my head spins with the features of Hobby let alone the added power of Macro B. I was wondering whether Macro B required some fundemental
ability that is in Industrial but not Hobby?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Can you use Inputs with Macro B Programming.
« Reply #16 on: November 21, 2017, 10:52:09 AM »
So, I'm going to start testing this Macro B Programming.  I need to purchase an industrial license.  However, I don't really like the layout of the Industrial Screen.  Can I use the Hobby Screens on the industrial version?
Chad Byrd
Re: Can you use Inputs with Macro B Programming.
« Reply #17 on: November 21, 2017, 10:58:09 AM »
Let me know if you figure this out. I got the industrial and i felt the same way.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Can you use Inputs with Macro B Programming.
« Reply #18 on: November 21, 2017, 11:24:38 AM »
Yes, you can use a Hobby screen set with an Industrial license.  Just not the other way around. 

Steve
Re: Can you use Inputs with Macro B Programming.
« Reply #19 on: November 21, 2017, 11:53:51 AM »
Note: If you do use a Hobby screen set with an Industrial license, you
may need to be sure that the Use Advanced GUI Controls option is turned
off  on the General tab under Config > Mach dialog. Having advanced GUI
controls enabled can cause colors to display in a strange fashion when
running a Hobby install with an Industrial license, and may do the same
when running a Hobby screen with and Industrial install.

Steve Stallings
www.PMDX.com