Hello Guest it is March 28, 2024, 09:53:09 AM

Author Topic: Screen Lood Script  (Read 602 times)

0 Members and 1 Guest are viewing this topic.

Screen Lood Script
« on: August 28, 2021, 08:18:11 PM »
Hello everyone,
I wanted to set the value of 3 axes to 0, so I put the following script in Screen Lood Script.
I want to operate with a switch.
However, as shown in the picture, an error was displayed.
Can anyone please tell me the solution? Please.

Script:Zero All

[mc.ISIG_INPUT7] = function (state)       --Zero All
   InputZeroAll()
   end,
------------------------------------------------------------------------------------
--Zero All
---------------------------------------------------------------
function InputZeroAll() --This will do Zero All button push
   ZeroAll()
   local rc = mc.mcAxisSetPos(inst, mc.X_AXIS,0.0);
    rc = mc.mcAxisSetPos(inst, mc.Y_AXIS,0.0);
    rc = mc.mcAxisSetPos(inst, mc.Z_AXIS,0.0);
   mc.mcCntlSetLastError(inst, "Input Zero All")
end
« Last Edit: August 28, 2021, 08:23:37 PM by Toshio.K »
Re: Screen Lood Script
« Reply #1 on: August 28, 2021, 08:40:40 PM »
supplement
Is the cause of the error interfering with the Zell All button I made on Mach4? ??
Can anyone please tell me the solution? Please.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Screen Lood Script
« Reply #2 on: August 29, 2021, 04:36:46 PM »
It is saying that there is no function definition for ZeroAll().  It is the first line in your InputZeroAll() function where you attempt to call the ZeroAll() function.  But it doesn't exist and the LUA interpreter is telling you so.

The solution most likely is to take that line out, as the rest of the InputZeroAll() function looks like it will do what you want.

Steve
Re: Screen Lood Script
« Reply #3 on: August 29, 2021, 05:53:19 PM »
Nice to meet you.
After asking this question, I found out after trial and error.
I understand C language a little, so I don't understand Mach4 script.
But thank you for your advice.
Thank you.