Hello Guest it is March 29, 2024, 07:35:43 AM

Author Topic: How to show the value of a variable in the ZeroBrane Editor?  (Read 2784 times)

0 Members and 1 Guest are viewing this topic.

'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline jevs

*
  •  315 315
    • View Profile
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #11 on: August 04, 2019, 05:09:08 PM »
Great! I will watch those now before moving forward. Thanks.

However, I think I kinda have the hang of it now. It has been working for me. Part of my problem is just not knowing how to format the code correctly from the miserable API help. It has the info you need, just not the exact syntax to know how to use it. I am sure this is clear to people that already know...but tough for a new person that is not a programmer.
My code was hanging the debugger as part of my problem, It could not compile...now I just comment out anything new when it does not work to see if that is what is doing it...

I am just stuck on how to use the code information I can find in the API help now...flooding the board with questions, but I am not sure how else to get through this. No way I am going to be as far as I had hoped after working on this for a weeks worth of free time, even giving up on sleeping :(

It is getting there though....thanks for the help.

I am surprised there is hardly any scripts to be found on the internet being shared. I am yet to find a single M6 script for an ATC.....this would help a lot. I am just trying to make it up from scratch.
« Last Edit: August 04, 2019, 05:11:17 PM by jevs »

Offline jevs

*
  •  315 315
    • View Profile
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #12 on: August 04, 2019, 05:37:20 PM »
Based on that second video, should I be putting this at the beginning of everything I work on?

Code: [Select]
if mc.mcInEditor() == 1 then
   dofile("ScreenScript.lua")
end
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #13 on: August 04, 2019, 05:37:45 PM »
Hi,

Quote
It has the info you need, just not the exact syntax to know how to use it. I am sure this is clear to people that already know...but tough for a new person that is not a programmer.

Tough luck.....this has afflicted all of us, I was not a Lua programmer when I started either.....and by most measures still not!
Mach4, with its modular structure and Lua scripting language offers a great deal more flexibilty and performance over Mach3 but
it comes at a cost, namely learning curve.

Second issue that you are observing is that the documentation of Mach4 often lags its current state. NFS is a very small company that does not
have the resources to employ a document writer and consequently the documentation has fallen behind. Before you jump up and down just,
weigh the fact that NFS is still releasing new functionality, including script based THC, mcSurface Wizard, Zero Brane editor and mcTouch Off wizard
in the last 12 months alone, verses up-to-date documentation......NFS doesn't have the resources to do both WITHOUT charging a lot more for its
software or some sort of annual subscription.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #14 on: August 04, 2019, 05:39:50 PM »
Quote
I am yet to find a single M6 script for an ATC

The whole idea of the m6 video a while back was to try and explain how you go about setting up your "Own" custom m6 step by step, and nearly everyone has a different way of how they want it to work.

A nice way of seeing your values is to open the watch window from the view menu, right click on the variable you want to watch and add it to watch expression, this will save you having to hover over the script.

DazTheGas
New For 2022 - Instagram: dazthegas

Offline jevs

*
  •  315 315
    • View Profile
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #15 on: August 04, 2019, 05:46:47 PM »
Hi,

Quote
It has the info you need, just not the exact syntax to know how to use it. I am sure this is clear to people that already know...but tough for a new person that is not a programmer.

Tough luck.....this has afflicted all of us, I was not a Lua programmer when I started either.....and by most measures still not!
Mach4, with its modular structure and Lua scripting language offers a great deal more flexibilty and performance over Mach3 but
it comes at a cost, namely learning curve.

Second issue that you are observing is that the documentation of Mach4 often lags its current state. NFS is a very small company that does not
have the resources to employ a document writer and consequently the documentation has fallen behind. Before you jump up and down just,
weigh the fact that NFS is still releasing new functionality, including script based THC, mcSurface Wizard, Zero Brane editor and mcTouch Off wizard
in the last 12 months alone, verses up-to-date documentation......NFS doesn't have the resources to do both WITHOUT charging a lot more for its
software or some sort of annual subscription.

Craig

They will get my $200 when it works.....so, I guess they will be waiting awhile.....
Like many others I am sure... I am not a programmer and you have to be a programmer to make it work.
I would be willing to bet there are many other people that are not as persistent or computer literate as myself that just walk away, which is ashame.
I would certainly be further along if I could get one line of code to just work without spending hours on how to make it work.
My VB script to do what I am trying to do now seem so much easier.
I am determined to get this done though, so expect a lot more dumb questions to come :) 
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #16 on: August 04, 2019, 05:48:17 PM »
Hi,

Quote
Based on that second video, should I be putting this at the beginning of everything I work on?

That depends on the macro or code that you are working on.

For instance if you have a macro running in the debugger, that macro alone is the 'Lua Chunk', other Lua code in other
scripts or macros are unavailble to it. Thus if you call say mcState, a global variable, in your macro the your debug session will
fail because the debugger is running your macro alone as its entire Lua chunk.

If you require the wider context of the entire Lua chunk then yes you are correct to use the dofile() command.
Be aware now that when you single step through the code you will now have to single step through the wider code
chunk, thousands of lines.

For this reason you may well need to define certain variables or functions within your macro just for debug purposes
so you don't have to debug the entire Lua chunk.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline jevs

*
  •  315 315
    • View Profile
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #17 on: August 04, 2019, 05:50:27 PM »
Quote
I am yet to find a single M6 script for an ATC

The whole idea of the m6 video a while back was to try and explain how you go about setting up your "Own" custom m6 step by step, and nearly everyone has a different way of how they want it to work.

A nice way of seeing your values is to open the watch window from the view menu, right click on the variable you want to watch and add it to watch expression, this will save you having to hover over the script.

DazTheGas
I have been watching your videos and those are much appreciated! However I am stuck on a couple things right now. I cannot even make the spindle motor stop. I think I know which code to use, just not how to type it in so it works. I need it to stop the spindle if it is running (which I hope includes the decel time), then start making moves.
I have learned a lot this weekend for sure, but I am nowhere close to getting this done....
I did learn more from that first video too. Docking the watch and stack up top there seems handy.
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #18 on: August 04, 2019, 05:53:19 PM »
Hi,

Quote
Like many others I am sure... I am not a programmer and you have to be a programmer to make it work.

Remember I cautioned you that learning Mach/Lua was quite a challenge and that there are procedures that do not require much,
if any, Lua coding and that I commended them to you to save the grief you are now experiencing.

Quote
They will get my $200 when it works.....so, I guess they will be waiting awhile.....

It works....whether you believe it or not.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline jevs

*
  •  315 315
    • View Profile
Re: How to show the value of a variable in the ZeroBrane Editor?
« Reply #19 on: August 04, 2019, 06:01:15 PM »
"Remember I cautioned you that learning Mach/Lua was quite a challenge and that there are procedures that do not require much,
if any, Lua coding and that I commended them to you to save the grief you are now experiencing."

I am confused. How do I make my tool changer work without using Lua coding?
I don't think I really need to keep getting the warnings. Really, just the answers to questions is what eases the pain most and makes it move faster. I think the secret of it being a pain in the behind is out of the bag LOL. I have accepted that and just doing what has to be done now...

I do believe Mach4 will work. I have it mostly working. I am down to to a few tasks. I just need the tool change to work and then get the pokeys55 replaced with the 57e and setup.....then I should be done other than tweaking as needed when I start using it to make parts.

I will have to figure out probing and auto tool height setting also, but I never had that stuff installed to try with Mach3 either.