Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Julie on April 07, 2017, 08:44:01 AM

Title: Lua script command
Post by: Julie on April 07, 2017, 08:44:01 AM
Hello,

I'm converting VB script to LUA script.

<VB script>
Call SetOEMDro(802, ZeroOffsetZ)

How can I change that by Lua script command?

Title: Re: Lua script command
Post by: Julie on April 10, 2017, 01:27:28 AM
I solved it. :)
Title: Re: Lua script command
Post by: Cbyrdtopper on April 10, 2017, 01:53:48 PM
Hyojung,
You should put your solution on this thread so others can see what works.
Title: Re: Lua script command
Post by: gorf23 on April 10, 2017, 02:47:23 PM
If you want to call a global function that has been put into the screen load script, is there a special way to call it from a script

I put a WriteRegister function in the load screen script  but if I try to call it from a button script I always get the error
attempt to call global 'WriteRegister' (a nil value)...

Is there a special way to call functions that are in the screen load script or do I need to add it somewhere else also
it will run fine if I have the function in the button script and run debug...

Thanks
Title: Re: Lua script command
Post by: Julie on April 19, 2017, 07:37:07 AM
Cbyrdtopper, sorry.
I changed it as shown below.

mc.mcAxisSetPos(inst, 2, ZeroOffsetZ)

But I thought I solved it, but I do not know if it is correct.