Hello Guest it is March 28, 2024, 08:20:51 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 - Ya-Nvr-No

71
Mach4 General Discussion / Re: Mach4 Variable Counter
« on: October 25, 2015, 08:22:02 AM »
yep you can do that, I just showed you how I have one of my screens set up like.

72
Mach4 General Discussion / Re: Mach4 Variable Counter
« on: October 24, 2015, 10:15:48 AM »
#500=1
should be set to 0
as your first line in the sub increments it

but also forgot to add this image to show, it increments and displays

Note: Did find if I tried single stepping though the code mach4 crashed,  ??? always something

73
Mach4 General Discussion / Re: Mach4 Variable Counter
« on: October 24, 2015, 09:56:17 AM »
your mixing mach3 code with mach4 code for one thing
cool now your doing the counting in the gcode and is fine but you dont need the m code now you can use the plc script to update the DRO

but to set a screen =scr control you have to use the mach4 command
practice and read, read, read everything, there is so much to learn and explore.

this is closer to what you need.
scr.SetProperty(dro1501, 'Value', tostring(counter));

did the history box update with the correct value?

Note: Surprised no one noticed/commented that the pound variable "500" is not an ireg variable   :-X (Kind of my way to test observers)  :o


74
Mach4 General Discussion / Re: Mach4 Variable Counter
« on: October 22, 2015, 11:33:34 AM »
it's an M code, in this case I called it m60
you can try Mymacros.msc but i doubt that mach4 will let you use that in your gcode program, but Ya-Nvr-No

75
Mach4 General Discussion / Re: Mach4 Variable Counter
« on: October 22, 2015, 09:25:47 AM »
in the "profile's" Macro Folder and also, mach4 has to be restarted to let it compile the group of mcs scripts into a common compiled script of all the files in that folder.

76
Mach4 General Discussion / Re: Mach4 Variable Counter
« on: October 21, 2015, 10:09:47 PM »
how about creating an ireg variable (like 500) then write the new increment to it using a mcode, same as you would a parts counter routine.

Code: [Select]
function m60()
local inst = mc.mcGetInstance()
local counter = mc.mcCntlGetPoundVar(inst, 500);
counter = counter +1;
mc.mcCntlSetLastError(inst, 'Counter # ' .. tostring(counter));
mc.mcCntlSetPoundVar(inst, 500, counter); --saves it to the ireg variable
end

if (mc.mcInEditor() == 1) then
    m60()
end

77
Mach4 General Discussion / Re: Lua While Loops
« on: October 21, 2015, 10:20:41 AM »
Yep, cause there all just numbers in the computer.

But it will make it easier to know what the variables represent, when the scripts start getting longer.

78
Mach4 General Discussion / Re: Lua While Loops
« on: October 21, 2015, 09:57:58 AM »
mc.mcSignalGetHandlem not sure why the "m" on the end and you used it twice

forgot to set up your inst
you don't need to keep declaring a variable

but here is another way that might work that follows your basic logic.

79
Mach4 General Discussion / Re: Screen Set Ideas
« on: September 30, 2015, 09:11:37 AM »
I just want to know what possessed you in the first place to click Ctrl-Alt-Shift and click the middle mouse button ;-)

I have been working with Art on a new program "LaserGear / Augmented Machine Controller" in development and it uses that key combination to stop processes that are in a running loop. So it was just a odd thing to try on my part and it popped up. Good to see we can drop the Shift. Never fully tested just was a fluke find. This new program of Art's is really cool. Great way to create a front end screen to control I/O boards and a lot more.

80
Mach4 General Discussion / Re: Screen Set Ideas
« on: September 28, 2015, 12:27:40 PM »
Came across an Easter Egg today

Ctrl-Alt-Shift and then click the middle mouse button, and up pops this.