Author Topic: Mcodes ??  (Read 7691 times)

0 Members and 1 Guest are viewing this topic.

Offline mc

  • Active Member
  • Posts: 381
    • View Profile
Re: Mcodes ??
« Reply #30 on: December 02, 2014, 01:23:11 PM »
Do any of you know if there is a way to disable the formatting on a post?

Use code brackets-
Code: [Select]
rc = mc.mcCntlGetLocalVar(inst, hVars, ParameterNumberArray[i])

that's [ code ] & [ /code ] without the spaces

Offline poppabear

  • Global Moderator
  • *
  • Posts: 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mcodes ??
« Reply #31 on: December 02, 2014, 02:30:21 PM »
Thanks for the heads up "mc"
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline Ya-Nvr-No

  • Active Member
  • Posts: 971
    • View Profile
    • Ya-Nvr-No
Re: Mcodes ??
« Reply #32 on: December 02, 2014, 02:43:32 PM »
That the reason I always use the code feature, and its viewably compact / and easy to copy.

was unaware of the code character stripping of just pasting code, my lesson for the day
« Last Edit: December 02, 2014, 02:45:04 PM by Ya-Nvr-No »

Offline mc

  • Active Member
  • Posts: 381
    • View Profile
Re: Mcodes ??
« Reply #33 on: December 02, 2014, 03:40:05 PM »
was unaware of the code character stripping of just pasting code, my lesson for the day
Anything out with code brackets in a post, will go through the standard forum parser, and be parsed accordingly, which is why the [ i ] get changed to mean italic.
The other major benefit, is the code brackets should cause a fixed width font to be used(typically courier or similar), so the code layout/indentation appears better.

Offline Ya-Nvr-No

  • Active Member
  • Posts: 971
    • View Profile
    • Ya-Nvr-No
Re: Mcodes ??
« Reply #34 on: December 02, 2014, 03:47:48 PM »
Duh... that makes sense, thanks  8) second lesson for the day  ;)

Offline BR549

  • Mach4 Alpha
  • Posts: 6,855
    • View Profile
Re: Mcodes ??
« Reply #35 on: December 02, 2014, 11:20:11 PM »
OK NOW I got it. Here is a Mcode with Param actually doing something. I can see where this will be VERY handy to use instead of using the G65 which is a licensed function not available to the average Joe (;-)

(;-) TP

---------------------------------------------------
--Brought to you by the: "Grey Headed ChipSlinger"!!
----------------------------------------------------
function M900(hVars)
   
   local Va
   local Vb
   local Vc
   
   local inst = mc.mcGetInstance() -- Get the current instance 
   
   mc.mcCntlSetLastError(inst, "Test Mcode Parameter");
 
          Va = mc.mcCntlGetLocalVar(inst, hVars, mc.VAR_A)
         
          Vb = mc.mcCntlGetLocalVar(inst, hVars, mc.VAR_B)
         
          Vc = mc.mcCntlGetLocalVar(inst, hVars, mc.VAR_C)
       
      mc.mcCntlGcodeExecute(inst, "G0 X"..Va);     
    mc.mcCntlSetLastError(inst, "Test Mcode Complete"); 
         
   end

if (mc.mcInEditor() == 1) then
    M900(0)
end