Hello Guest it is April 19, 2024, 02:28:09 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 - DazTheGas

191
Mach4 General Discussion / Re: Integers defined
« on: June 06, 2017, 05:48:42 PM »
Take a look in the Screen Load Script at the function ButtonJogModeToggle()  ;-)

DazTheGas

192
Mach4 General Discussion / Re: Integers defined
« on: June 06, 2017, 05:33:53 PM »
A lot of the examples within the API docs are C++ however where you see something like X_AXIS you can put an mc. infront IE mc.X_AXIS and this will give you the correct result.

MC_JOG_TYPE_INC = mc.MC_JOG_TYPE_INC
MC_JOG_TYPE_VEL = mc.MC_JOG_TYPE_VEL

DazTheGas

193
Mach4 General Discussion / Re: Module Works Simulator
« on: June 02, 2017, 11:10:58 AM »
I`m using win7 pro and all is working fine :-)

DazTheGas

194
Mach4 General Discussion / Re: replacement for mcLuaPanelParent ?
« on: June 02, 2017, 07:58:16 AM »
Why not post a script that dont work ;-)

DazTheGas

195
Mach4 General Discussion / Re: replacement for mcLuaPanelParent ?
« on: June 02, 2017, 02:58:20 AM »
Mach4 Gui is created using C++. mcLuaPanelParent gets the Parent Handle of the Lua Panel enableing better control of its styles etc, this cannot exist in editor mode as it gets created on exiting the editor or starting mach4. There are many ways to debug such panels like using the same princible of macros.

if (mc.mcInEditor() == 1) then
   Panel = create a dummy window/panel for debug
else
   Panel = mcLuaPanelParent
end
Rest of code........

Another thing to note is Lua Panels do not get refreshed when quiting the editor so as a quick work around you can exit the editor then from the view menu reload you screenset.
Before I created my current screen I used the lua panels for everything buttons/dro`s etc and found there was so much more you could achieve than using the conventional buttons/dro`s

DazTheGas

196
Mach4 Toolbox / Re: A new Tool Table for Mach4
« on: June 02, 2017, 02:30:54 AM »
Unfortunately this no longer works, since creating this 2 years ago many things have changed with mach4 including the tooltable so some of the profile variables that it requires are no longer there.

DazTheGas

197
Mach4 General Discussion / Re: understanding Jog and signals?
« on: May 29, 2017, 09:45:07 AM »
Quote
I hope you don't get angry about my mistakes.

Never, we all started somewhere and will always be learning no matter how long we`ve been doing it  ;)

DazTheGas

198
Mach4 General Discussion / Re: understanding Jog and signals?
« on: May 29, 2017, 08:38:13 AM »
I really must advise that you read the MachApi found in the docs directory, there is a full section with explaination of all commands for jogging. The command you are looking for is mc.mcJogSetRate(number mInst, number axisId, number percent) this will control the jogging speed.#

DazTheGas

199
Mach4 General Discussion / Re: index homing mach 4
« on: May 29, 2017, 02:56:51 AM »
The steps for signals are

1. Get the handle for the signal (this is basically a computer generated number at runtime)
2. Set the state of that handle

so to set your signal above should be

Code: [Select]
local out2 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT2)  -- OUTPUT FOR MULTIPLEXER
local out3 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT3)  -- OUTPUT FOR MULTIPLEXER
mc.mcSignalSetState(out2,0)--output off
mc.mcSignalSetState(out3,0)--output off

DazTheGas

200
Mach4 General Discussion / Re: lua panel and modules
« on: May 28, 2017, 04:05:09 PM »
A Lua Panel runs in a private context, it has no access to what has been declared in other scripts within mach4 like the screen load script etc, if you have all your stuff in a module then you need to use the 'require' function within the lua panel.

Heres a very old exampe of the beginning of a lua panel in one of my previous screensets

Code: [Select]
local inst = mc.mcGetInstance()
local profile = mc.mcProfileGetName(inst)
local path = mc.mcCntlGetMachDir(inst)
package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;"
package.loaded.MasterFunc = nil
mf = require "MasterFunc"



mf.CreatePanel(mcLuaPanelParent)



DazTheGas