Hello Guest it is April 18, 2024, 09:44:10 AM

Author Topic: How to use USB camera with Mach4  (Read 3578 times)

0 Members and 1 Guest are viewing this topic.

Re: How to use USB camera with Mach4
« Reply #10 on: October 07, 2021, 12:03:43 AM »
local inst = mc.mcGetInstance ()

YShift = 10
mc.mcCntlSetPoundVar(inst,mc.SV_HEAD_SHIFT_Y,YShift)

I put a colon, but I get an error.

Offline thosj

*
  •  532 532
    • View Profile
Re: How to use USB camera with Mach4
« Reply #11 on: October 07, 2021, 08:15:41 AM »
Line 239 is likely in the COMPLIED Lua script that Mach 4 compiles from all your Lua parts on run.

And, in this line of code:

mc.mcCntlGcodeExecute (inst, "G91 G0 Z0.0 \ n G0 Y1.7 \ n G0 X7 2.0")

What is \n G0 X7 2.0? Is it supposed to be something like Y2.0?

Just poking around!!!

Tom

--
Tom

Online Bill_O

*
  •  563 563
    • View Profile
Re: How to use USB camera with Mach4
« Reply #12 on: October 07, 2021, 10:33:29 AM »
Delete the button and see if you get the same error.
Re: How to use USB camera with Mach4
« Reply #13 on: October 08, 2021, 01:39:51 AM »
I can't move the camera after removing the button.

Online Bill_O

*
  •  563 563
    • View Profile
Re: How to use USB camera with Mach4
« Reply #14 on: October 08, 2021, 07:16:21 AM »
Really?
You take out the button that moves things and it doesnt work any more?

Look, you have an error in the code.
Take out the button and see if the error goes away.
Then we can work on getting the button back in correctly.
Re: How to use USB camera with Mach4
« Reply #15 on: October 08, 2021, 08:45:52 AM »
> Take out the button and see if the error goes away.
Please tell me how to do it.

Online Bill_O

*
  •  563 563
    • View Profile
Re: How to use USB camera with Mach4
« Reply #16 on: October 08, 2021, 10:29:42 AM »
Who put it in?
Who it putting in the code?

If you are doing it this might help some.
Use the one from 6_22_2020 part way down.
https://www.machsupport.com/forum/index.php?topic=43260.msg279695#msg279695
Re: How to use USB camera with Mach4
« Reply #17 on: October 08, 2021, 09:59:52 PM »
Hello,
Thank you for the useful information.

Now,
About this problem solving method
As a method, should I use the example in the space between ************ below?

****************
• Macros can use a name instead of a number. Name ()
Example: toolheightset ()

• Here is the format of a macro.
     function m # ()
      your code
  end
  if (mc.mcInEditor () == 1) then
m # ()
end
  The last 3 lines let you run or step through the macro while in the editor.
*******************

Online Bill_O

*
  •  563 563
    • View Profile
Re: How to use USB camera with Mach4
« Reply #18 on: October 13, 2021, 10:26:22 AM »
This is the only part that is the code.

  function m # ()
      your code
  end
  if (mc.mcInEditor () == 1) then
       m # ()
  end
Re: How to use USB camera with Mach4
« Reply #19 on: October 14, 2021, 12:50:16 AM »
Please tell me the meaning of "mcInEditor".