Hello Guest it is October 20, 2019, 08:25:06 AM

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.

Messages - smurph

Mach4 General Discussion / Re: LOVING the PMC!! Thanks Steve!!!
« on: June 09, 2017, 12:36:00 PM »

I need an example.  Because what I just tested works.  Can you post the PMC file? 



EtherCat can be done with the Galil.  Their 5000 series controllers are basically 4000 series controllers with EtherCat.  Also, there are several EtherCat controller companies that are working on Mach 4 plugins.  The Galil can go right now, but others are coming. 

BTW, Mach 4 was demonstrated running a Galil EtherCat controller running Yaskawa drives and motors at IMTS 2014.  :)


Mach4 General Discussion / Re: Module Works Simulator
« on: June 01, 2017, 01:28:45 PM »
No HiCON files. 

Two separate licenses. 

Mach4 General Discussion / Re: Module Works Simulator
« on: June 01, 2017, 01:57:08 AM »
Mach personnel didn't write the plugin.  ModuleWorks did.  All we can do is load it up and test it.  Just like you.  And it works fine for me, so I don't know what the problem is.  :(


Mach4 General Discussion / Re: mcRegGetValue returns unexpected value
« on: June 01, 2017, 01:46:18 AM »

LUA is not multi-threaded as there is nothing protecting the global data tables.  So each instance runs in its' own space (with its' own global data and message loop, etc...).  Each LUA panel has one instance of LUA associated with it.  You can share code between the instances by requiring a module.  But the global data of one instance cannot be accesses from one instance to the next, etc...  So storing the address of a module table variable from one instance in a register and trying to use it in another instance will lead to "bad news".  The only really safe way to share data across LUA instances is with the Mach registers (because these registers are thread safe and mutexed).

In Mach, these are the LUA instances:
1. One instance for the GUI (runs the screen scripts)
2. One instance for the mcLua macro script plugin. (runs M codes)
3. One instance for the PMC (runs the ladder code)
4. And one instance per LUA panel in the GUI.

All of these instances have access to the MachAPI functions.
Only the GUI has access to the ScreenAPI functions. 


Mach4 General Discussion / Re: Module Works Simulator
« on: May 31, 2017, 06:52:15 PM »
Plugins don't have to be at the same build level.  All of the Mach supplied plugins (in the installer) are the same level because they get built at the same time as the Core and GUI.  So a plugin from a different developer can be different.  Some developers may choose to put the Mach build level at which they compiled against (looks to be what ModuleWorks has done).  Unless the Mach API changes, there isn't a need to make a new plugin build other than fixing things or adding functionality.   


Mach4 General Discussion / Re: Mach4 needs reset all the time
« on: May 31, 2017, 05:02:16 PM »
What you are describing is all motion controller/plugin related.  Probing works fine if the motion controller supports it.  The requiring reset all of the time indicates to me that the motion plugin is not correctly telling Mach when it has performed all of the requested movements.  If you open up the Mach log, you will probably see something like "waiting on motor stop report".  Also, this may happen if you have enabled an axis in Mach but not in the motion plugin, etc..  In this case, Mach will be waiting on a stop report for a motor that the motion plugin is not controlling. 


I would first start using the return code on the API functions to discover if there is an error or not.

local h0, rc = mc.mcRegGetHandle()
if (rc ~= mc.MERROR_NOERROR) then
    --- There is an error condition.


Mach4 General Discussion / Re: How to Emulate a Momentary switch?
« on: May 24, 2017, 03:08:24 AM »
One shot latch in the PMC.  The PMC is the Programmable Machine Controller.  It implements ladder logic. 

Mach4 General Discussion / Re: Mach 4 Bug showing in M6 Script
« on: May 07, 2017, 05:05:19 PM »
The difference is for machines that can pre-stage tools.  

"T on M6 line is next tool":

T1 (Tool changer stages T1)
M6 T2 (Load T1 into the spindle and stage T2)
M6 T5 (Load T1 into the spindle and stage T5)

"T on M6 line is tool to use":



M6 T1