Hello Guest it is April 26, 2024, 05:43:41 PM

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 - Bodini

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »
21
Mach4 Toolbox / Re: IsStill example (M4 version of IsMoving)
« on: June 06, 2014, 10:20:59 PM »
Build 1817: Use IsStill with caution.  It worked OK in the above script, but beyond that it is causing all sorts of problems.

22
Mach4 General Discussion / Re: What version of Lua is Mach 4 using?
« on: June 06, 2014, 04:06:26 PM »
Thanks.  Yes I see now.  I forgot things like that are built in (now i recall seeing things like that in other programs).

F5 + step through it:
Code: [Select]
print( _VERSION )

23
Mach4 General Discussion / What version of Lua is Mach 4 using?
« on: June 06, 2014, 01:41:33 PM »
Updating to a new version of Lua was mentioned with build 1817.  What version is it?  I expected to see 5.X in the about box but it says wxLua 2.8.12.3.  I don't know what makes one different from the other (don't care either, it will go over my head).  All I want to know is which reference manual/examples I should be looking at.

Thanks.

-Nick

24
Mach4 Toolbox / Re: IsStill example (M4 version of IsMoving)
« on: June 05, 2014, 01:08:53 PM »
here is what gets me..

mc.mcCntlIsStill(inst)==1, if the axis IS STILL, (i.e. not moving), it should give you a 1, if it IS Moving, it should return a 0.....

seams to me it should ask the question "Are you still?"  1 = yes, 0 = no..

just my own quirks I guess..
Scott

I thought the same thing as you when I tried the script the first time.  But it didn't work, so I flipped 0 for 1 and it did work.  I imagine that the programmers may have something else in mind but that wouldn't be the first time I couldn't follow the logic.  Oh well, once it worked I just accepted it and thats that. ;-)



BTW:   YOU have FAR, FAR, FAR to much time on your hands for Mach4 Ascii art!!!!  hehehhee

Scott

I like to give that illusion on the interwebz.  ;D

Code: [Select]
  ____            _   _   
 / ___|  ___ ___ | |_| |_
 \___ \ / __/ _ \| __| __|
  ___) | (_| (_) | |_| |_
 |____/ \___\___/ \__|\__|
                   


ascii art generator --> http://patorjk.com/software/taag/

-Nick

25
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: June 05, 2014, 09:36:17 AM »
Changing LUA versions is not something we will do once we release.  We just made a push to get to the latest code base for everything we use so that we don't feel the need to do it at a later date after release.  In the future, a normal user should never see this.
Great!  As long as you know about the problem and plan on doing something about it, then case closed. Thx for the reply.

26
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: June 05, 2014, 12:03:29 AM »
It is because some mcc file is still in there somewhere when it tried to roll all of them up into the one big mcLua.mcc file.  Incompatible mcc files prevent this from happening. 

The rule of thumb is if there is no mcLua.mcc file, then there is an error in at least one script or the mcc files are incompatible.  Those are the only two instances we have found that prevent the mcLua.mcc file from being built.   

Be sure that if your scripts reference any scripts external to the profile (like in Mach4/Modules dir), that those scripts also have their mcc files deleted.  You may have to compile external scripts in the mcLuaEditor as the auto compile will not work for scrips outside of the macros dir.

Steve

Hi Steve,

Reading what you wrote there and kind of understanding some of it I did exactly this and nothing more...

Uninstalled Mach4 1817, deleted folder.
Reinstalled M4 1817.
Started M4. No error.  looked in the macros folder and I see m3, m6 and m6end: mcs and mcc files.
Loaded arctest and ran it.
Closed gcode. Closed M4.
Reopen M4.  The error shows on load up.
Close M4.
Delete the m3, m6, m6end mcc files.
Open M4.  M3,m6, m6end mcc files are created.  mclua.mcc is created.  This error comes up: 
23:55:25: Failed to open 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m3.mcc' for reading (error 0: the operation completed successfully.)
23:55:25: Failed to retrieve file times for 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m3.mcc' (error 0: the operation completed successfully.)
Ok that error box.  Then this error comes up:
23:55:25: Failed to open 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m6.mcc' for reading (error 2: the system cannot find the file specified.)
23:55:25: Failed to retrieve file times for 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m6.mcc' (error 2: the system cannot find the file specified.)
23:55:25: Failed to open 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m6end.mcc' for reading (error 2: the system cannot find the file specified.)
23:55:25: Failed to retrieve file times for 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m6end.mcc' (error 2: the system cannot find the file specified.)
23:55:25: File 'C:\Mach4Hobby\Profiles\Mach4Mill\Macros\mcLua.mcc' couldn't be removed (error 2: the system cannot find the file specified.)
Close M4.
Reopen M4.  No errors.

I'd bet none of that is a surprise to you but it sure is a lot of hoops to jump through for your average user. ;-)

-Nick


27
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: June 04, 2014, 08:25:12 PM »
 Once you press Start Cycle, they will build and the mcLua.mcc will be created.

Hi Steve,

I dunno... mcLua.mcc is not being created here.  Start Mach4, load roadrunner, press cycle start, let it run, stop it...  Still no mcLua.mcc in C:\Mach4Hobby\Profiles\Mach4Mill\Macros folder.  Close Mach, restart it... the error persists.

-Nick

28
Mach4 Toolbox / IsStill example (M4 version of IsMoving)
« on: June 04, 2014, 08:16:31 PM »
Or: "How to pause your script while an axis is moving."

Hey! It works in build 1817!

Code: [Select]
--[[--------------------------------------------------------------------------------------------------------
||_/\\\\____________/\\\\_____/\\\\\\\\\___________/\\\\\\\\\__/\\\________/\\\____________/\\\____________
||_\/\\\\\\________/\\\\\\___/\\\\\\\\\\\\\______/\\\////////__\/\\\_______\/\\\__________/\\\\\____________
||__\/\\\//\\\____/\\\//\\\__/\\\/////////\\\___/\\\/___________\/\\\_______\/\\\________/\\\/\\\___________
||___\/\\\\///\\\/\\\/_\/\\\_\/\\\_______\/\\\__/\\\_____________\/\\\\\\\\\\\\\\\______/\\\/\/\\\__________
||____\/\\\__\///\\\/___\/\\\_\/\\\\\\\\\\\\\\\_\/\\\_____________\/\\\/////////\\\____/\\\/__\/\\\_________
||_____\/\\\____\///_____\/\\\_\/\\\/////////\\\_\//\\\____________\/\\\_______\/\\\__/\\\\\\\\\\\\\\\\_____
||______\/\\\_____________\/\\\_\/\\\_______\/\\\__\///\\\__________\/\\\_______\/\\\_\///////////\\\//_____
||_______\/\\\_____________\/\\\_\/\\\_______\/\\\____\////\\\\\\\\\_\/\\\_______\/\\\___________\/\\\______
||________\///______________\///__\///________\///________\/////////__\///________\///____________\///______
||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
||                               
||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
||   
||  By            ::: NJL Bodini
||                               
||  Mach 4 Build  ::: 1817
||                                 
||  Date          ::: 06 04 2014
||                                                         
||  Script Desc   ::: Pause script execution while an axis is in motion (m4 version of IsMoving )
||                                                                     
||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]]

inst = mc.mcGetInstance()
mc.mcCntlGcodeExecute(inst, "g91 g1 x1") --execute gcode
while (mc.mcCntlIsStill(inst)==1) do  --loops through this while an axis is moving
    mc.mcCntlSetLastError(inst, "axis in motion") --do this while axis is moving
end  --ends the loop
mc.mcCntlSetLastError(inst, "axis is stopped")  --continues here after axis is done moving
mc.mcCntlGcodeExecute(inst, "g90") --execute gcode


29
Mach4 General Discussion / Error on startup build 1817
« on: June 04, 2014, 07:45:08 PM »
Just installed 1817, uninstalled 17XX first (even deleted the folder that the uninstall did not delete).

I am getting an error on start up: "File 'C:\[OEM PATH HERE]\macros\mcLua.mcc' couldn't be removed (error 0: the operation completed successfully.)"

I dont see mcLua.mcc in the macros folder. Sounds like thats what the error is about.  Known problem or did I do something? ???

addendum:  now i am getting this error too if i edit a script and then run it in the editor.  the editor crashes too.

addendum 2: now i see that it gets this error if i do not save the script before i run it in the editor.

30
Mach4 General Discussion / Re: Read write to a DRO ??
« on: May 31, 2014, 12:11:38 AM »
OOps, I'm late to the party but here you go.

Gets var, Sets dro

Code: [Select]
inst = mc.mcGetInstance()
local SNv = mc.mcCntlGetPoundVar(inst,590) --gets #var
scr.SetProperty('udro18', 'Value', tostring(SNv)) --sets dro

Gets dro, Sets Var

Code: [Select]
local droval = scr.GetProperty('udro18', 'Value') --gets dro
mc.mcCntlSetPoundVar(inst, 590, tonumber(droval)) --set #var

Note how you switch a string to a number (tonumber) and reverse(tostring).

  Also, any time you want to see what type something is in lua (http://lua-users.org/wiki/LuaTypesTutorial), try:
Code: [Select]
print(type(YOUR_VARIABLE)  --inserting the variable you want to know about
Hit F5 and then F11 to step through it, and watch the console at the bottom of Lua.


Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »