Hello Guest it is April 19, 2024, 09:17: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.


Messages - smurph

451
Mach4 General Discussion / Re: Mill Profile Initialisation String
« on: July 09, 2019, 12:19:16 AM »
G54 is simply the default user coordinate system.  It really isn't in any init string.  It is modal group #14.  But it has to default to SOMETHING, so G54 it is.  All modal groups have a default value.  If you want to change it, put something else from that modal group in the init strings in the control configuration dialog (G55, G54.1, etc...). 

Steve

452
https://www.machsupport.com/ftp/Mach4/Plugins/Galil/mcGalil.zip

That is a newer plugin.  Just unzip the contents into the plugins directory. 

Steve

453
If it doesn't compile the mcs files, then there is a syntax error in one of them.  You will have to open each one individually and try to compile them (with mcLuaEditor, not ZeroBrane) to see which one is giving the error. 

Steve

454
The Mach 4 plugin REQUIRES that the Galil GDK be installed (to get the GCAPS service) on 64 bit machines.  This is most likely why the plugin doesn't discover the Galil.  You will have to remove all Galil config entries in the profile's Machine.ini, make sure that the GCAPS service is installed and running, and then try to configure the Galil plugin again. 

However, only 41x3 and 40x0 controllers are officially supported with the Mach 4 Plugin.  None of us have any of the older controllers to fully test it out.  So your mileage may vary.  And we really don't have any plans to try and support them.  They may work, but they might not.  :( 

m4plugw is what we call a plugin package.  It is basically a zip file.  You can rename it to .zip and open it up.  Or you can use it to install the plugin from the plugins tab in the control config dialog.  Similarly, if you change the name of a .zip file to m4plugw.  Vice verse.   

Steve

455
If you want to use common code that can be called from multiple "places" (the GUI or from the M codes), then you need to investigate the use of modules.  LUA modules are analogous to C/C++ DLLs. 

If you are wanting to call a function in one M code script from another M code script, if the function is global, than you can just call it.  Because all of those functions get rolled up into one LUA chunk (mcLua.mcc).  What some people do is create a special file in the macros directory.  Call it anything but make sure it has an extension of .mcs.  For example, MyGlobalFuncs.mcs.  Then you can write functions in that file and it will be included in the mcLua.mcc chunk and all of the functions in that file will be callable from any M code script. 

Steve

456
Poll the state of the control using mcCntlGetState(). 

Start the first file running.  Poll for the state to change from idle to running (wait on the file to start).  Once it is started, poll for the state to change from running to idle. 

Steve

457
There is digitizing.  You can generate a point cloud with G31 in combination with some API functions.

Using the probe data file routines.
number rc = mc.mcCntlProbeFileOpen(number inst, string filename, string format)
The format argument is a printf style format with expanding macros for the axis values. AXIS_X, AXIS_Y, AXIS_Z, AXIS_A, AXIS_B, AXIS_C. It is used in the following manner:

rc = mc.mcCntlProbeFileOpen(inst, "myProbeFile.csv", "%.4AXIS_X, %.4AXIS_Y, %.4AXIS_Z")
This will produce a probe file in CSV format like so:

1.0000, 2.0000, -1.4356
1.0100, 2.0000, -1.4343
1.0200, 2.0000, -1.4324
...

A format of "X%.4AXIS_X, Y%.4AXIS_Y, Z%.4AXIS_Z" would yield:

X1.0000, Y2.0000, Z-1.4356
X1.0100, Y2.0000, Z-1.4343
X1.0200, Y2.0000, Z-1.4324
...

A format of "X%.4AXIS_X\tY%.4AXIS_Y\tZ%.4AXIS_Z" would yield a tab delimited file:

X1.0000 Y2.0000 Z-1.4356
X1.0100 Y2.0000 Z-1.4343
X1.0200 Y2.0000 Z-1.4324
...

To close the probe data file, use:
number rc  = mc.mcCntlProbeFileClose(number inst)

Steve

458
Mach4 General Discussion / Re: mcGetInstance in API from c#
« on: June 14, 2019, 12:34:38 PM »
There is no mcGetInstance() in the C API.  That is a LUA only function call so that there is a way to know what instance of Mach called the embedded script.  With C/C++, C#, and VB, you (the programmer) must specify the instance with which to operate.  Mach Hobby only has one instance; instance zero.  So...  in your case, use 0 for the instance. 

Steve

459

1  .i have many M function that i build and inside each there many function ,in each Mcode
     always i put one on headr====>>"local inst = mc.mcGetInstance()",and no need any more
     but this last version its not work ,i must put this statement on each function

You should ALWAYS get the instance in every function.  That was the design.  If it worked for you before, it was by accident. 

2.  i know that mach take all m function in 1 file ,but i never had problem when i had 2 function with  same name
     on 2 different M function,last version its not work ,if same name function not work ,need make each function other
     name

In LUA, the last function with the same name wins.  Always.  Now, this version uses LUA 5.3 where the old version you were running may have used LUA 5.2 and that MAY change the order in which functions are loaded. 

It is a programming error to use multiple functions with the same name.  :(


460
You can also export the plasma configuration tab and import it into your screen set.  Right click on the tab element in the screen tree and click export.  :)

Steve