Hi Troy,
I'm not sure why that would be. Were they working before the change?
Can you provide all the details so we can try to duplicate. Your Screen Script? How M3,M4,M5 are configured? Any Spindle Programs?
Hi Troy,
I'm not sure why that would be. Were they working before the change?
Can you provide all the details so we can try to duplicate. Your Screen Script? How M3,M4,M5 are configured? Any Spindle Programs?
TK
http://dynomotion.com
Hi Tom,
Just checked with a INIT program before i added pots and the physical Spindle buttons do not work when a Gcode is running or in FeedHold, but when Gcode is not running the physical buttons work fine.Again, the keyboard hotkey buttons for spindle F9,F10,F11 do work when Gcode is running. So problem was before adding pots. Attached is my 3 screens and my c programs for M3,M4,M5 and the rigid tapping c code.
Testing Gcode is simple....
G20
M3S500
G01 X-.5 F10.
G01Z-10.F10
G01Z0F10
G01X0.
M30
Let me know if there is something else you might need that i did not include.
Thanks,
Troy
Hi Troy,
I guess kmotioncnc is not allowing the M codes to be sent while a job is running. Instead of your init file sending an M code after pushing physical buttons, consider copying the M3/4/5 code directly into the init file. Should work that way.
Glad you got the pots working the way you want. Isnt it awesome how we can get just about anything to work exactly how we want with just a few lines of code?
Mark
Hi Troy,
Mark is correct. For safety reasons KMotionCNC rejects requests of MCodes or User Buttons while a Job is running. Maybe we should have an option to override this. Copying the code that eventually needs to execute should work and actually be faster and more reliable as it wouldn't depend on the PC. Shame to have duplicated code though. You could put the functions in an include file.
We are working on new Screen Script functionality that might also solve this. Where Screen Script can push a screen button or a keyboard button. Also the ability for KFLOP to command KMotionCNC to execute Screen Script (without pushing a User Button to do so).
TK
http://dynomotion.com
Hi Mark,Tom
Iam always amazed at what is being done with C code. Wish i could comprehend it more tho.
Will see if iam successful at adding button code to INIT and will let you know.Hi Troy,
Mark is correct. For safety reasons KMotionCNC rejects requests of MCodes or User Buttons while a Job is running. Maybe we should have an option to override this. Copying the code that eventually needs to execute should work and actually be faster and more reliable as it wouldn't depend on the PC. Shame to have duplicated code though. You could put the functions in an include file.
We are working on new Screen Script functionality that might also solve this. Where Screen Script can push a screen button or a keyboard button. Also the ability for KFLOP to command KMotionCNC to execute Screen Script (without pushing a User Button to do so).
Thanks again guys,
Troy
Tried adding code but main INIT does run past the point where i added code and when i run main INIT code, spindle trys to start and then turns off. If i let machine set for a minute or so, spindle will try to start again! So needless to say i reverted back to an older program. What would be safer and more reliable, having spindle buttons connected to Konnect board like i have them or using the keyboard hotkeys? As the hotkeys seem to work no matter what.
Thanks,
Troy
I would think you can still get it working reliably with external buttons, probably just some little bug somewhere in the code. Should be able to fix it. But honestly I find the hotkeys to work fine. Thats all im using. I had a start/stop button first but decided not to use them for some reason. At least doing it with the hot keys your code is only in one place, so if you make changes you dont have to remember to do it twice. And it will probably be easier to use delays for the spindle to ramp up this way too. Delays in the forever loop would obviously be a bad idea. I just mounted a keyboard directly to my controller and put some labels on the buttons for the spindle. See attached pic. Works fine for me.
Mark
Hi Troy,
You might have placed the code in the wrong place. Post the code and we can check it.
TK
http://dynomotion.com
Thats similar to what i have now on my mill.Except its not nicely layed out as yours. I plan to make a control panel for it after this lathe project is done. Using what i have learned from lathe buttons setup.
Hi Tom,
Atttached is INIT c code. The Spindle CW and CCW also has the pop up reminder asking if 3 phase converter is on.
Troy
Hi Troy,
You forgot to put in curly brackets.
When you have a conditional statement like:
if (result == 1)
That means either the following single statement will only be executed when the condition is true, or the following block of code marked with curly brackets will only be executed when the condition is true.
When you have:
Only the A will be skipped if the condition is not true. B and C will always be executed regardless. Which is the problem you are seeing.Code:if (result == 1) A; B; C;
If that is actually what you want you should indent the code to show only A is impacted by the if statement this like:
But if you want to skip a bunch of instructions when the condition isn't true put them in curly brackets like this and indent the instructions to show they are all in the same block like this:Code:if (result == 1) A; B; C;
Think of the curly brackets like shorthand for Begin and End statements.Code:if (result == 1) { A; B; C; }
Note that indenting the instructions properly doesn't change how it will execute but just makes it easier to read and see problems.
Let me know if this makes sense. If not we can correct it for you.
TK
http://dynomotion.com
Hi Tom,
I think i made some progress with the curly brackets The main INIT program appears to be running completely now and not stopping at the section that handles the Spindle buttons. But now i have a new issue. When i turn on spindle with my physical buttons the spindle starts and then about 1 second later it shuts off. This happens in both directions. Attached is updated INIT program.
Thanks,
Troy
Hi Troy,
Looks like your making progress but still may have some issues with curly brackets. You have an If statement to check for spindle start button, and inside of that you have an if/else statement to check if phase converter is on. And I think its being read as, if button is pushed start spindle, else stop spindle. So any time button is not pushed the spindle will be told to stop. Its much easier to see whats going on if you indent the code something like this screenshot, see how it looks to be turning off spindle any time button is not pushed?
Troy, see if this works. Im not 100% sure if its right or not. It is a little confusing with a few things going on there. Good luck with it.
Mark
Hi Troy,
I think Mark is correct and fixed the CW button but the problem was with the CCW. Attached I tried to correct both. And formatted the entire file to make it more readable.
TK
http://dynomotion.com
Hi Troy,
This is a new feature that we will be releasing soon which may help with coding
https://youtu.be/CsIijoLMq8U
TK
http://dynomotion.com
Code works moocho better now Thanks guys.
Also checked out video earlier today, looks good and simple for me. Glad I could be a sort of test subject
Will be waiting for the test release version.
Thanks again,
Troy