CS-Lab Support Forum for CNC Community
Help to run this brand-new forum and stay with us.
Ask your questions, we are here to help!
simCNC tool lifetime
Quote from Dobbelju on 30 June 2023, 18:09Thanks for the explanation! Very interesting and powerful function.
I have allready tested some stuff regarding tool life time with machine params. Works good so far. I will work on that and make it more handy on the weekend. Will post the results then.
I also tried now to embed the pyAction function with a timer. Seems also to work so far. Are there known limitations? (more pyaction timers can lag for example?)
Thanks for the explanation! Very interesting and powerful function.
I have allready tested some stuff regarding tool life time with machine params. Works good so far. I will work on that and make it more handy on the weekend. Will post the results then.
I also tried now to embed the pyAction function with a timer. Seems also to work so far. Are there known limitations? (more pyaction timers can lag for example?)
Quote from Dobbelju on 2 July 2023, 12:36Hello!
I have done some testing with the machine parameters. This works in general good so far.
My attempt is to use the pyAction with an timer every 60 seconds to count down one minute as soon the spindle is activated.
Also the message and action can be done as soon one tool reaches 0 minutes.
Work in progress to do the fine tuning.
1.
So the toollifetimer pyAction runs as soon the machine is turned on. So the 60 seconds are counting down from this event.
I would like to integrate in my M3 macro a command to enable this pyAction and in my M5 macro to stop the pyAction.
Is there a command for macros to enable and disable an specific pyAction?
2.
To set the value for the machine param (i.e. param 100 for tool nr 1) i have made an small gui. It can set the param 100 to 44 for example. The progressbar is also set to a maximum of 44 by gui editor. I wanted to change the progress bar max value with my self made gui. I cant change the "maximum" value in the progress bar by macro with this command:
gui.ProgressBar_1.setMaximum(44)
is there something missing or maybe not possible?
Kind regards
Dobbelju
Hello!
I have done some testing with the machine parameters. This works in general good so far.
My attempt is to use the pyAction with an timer every 60 seconds to count down one minute as soon the spindle is activated.
Also the message and action can be done as soon one tool reaches 0 minutes.
Work in progress to do the fine tuning.
1.
So the toollifetimer pyAction runs as soon the machine is turned on. So the 60 seconds are counting down from this event.
I would like to integrate in my M3 macro a command to enable this pyAction and in my M5 macro to stop the pyAction.
Is there a command for macros to enable and disable an specific pyAction?
2.
To set the value for the machine param (i.e. param 100 for tool nr 1) i have made an small gui. It can set the param 100 to 44 for example. The progressbar is also set to a maximum of 44 by gui editor. I wanted to change the progress bar max value with my self made gui. I cant change the "maximum" value in the progress bar by macro with this command:
gui.ProgressBar_1.setMaximum(44)
is there something missing or maybe not possible?
Kind regards
Dobbelju
Uploaded files:
Quote from andre on 2 July 2023, 18:56Quote from Dobbelju on 2 July 2023, 12:361.
So the toollifetimer pyAction runs as soon the machine is turned on. So the 60 seconds are counting down from this event.
I would like to integrate in my M3 macro a command to enable this pyAction and in my M5 macro to stop the pyAction.
Is there a command for macros to enable and disable an specific pyAction?
Not that I know at least... But you could check in your toolLifeTimer macro if the spindle is currently running or not. The action itself can just continue to loop.
if d.getSpindleState() == SpindleState.CW_ON or d.getSpindleState() == SpindleState.CCW_ON:
# start timer
else:
# end timer
Quote from Dobbelju on 2 July 2023, 12:361.
So the toollifetimer pyAction runs as soon the machine is turned on. So the 60 seconds are counting down from this event.
I would like to integrate in my M3 macro a command to enable this pyAction and in my M5 macro to stop the pyAction.
Is there a command for macros to enable and disable an specific pyAction?
Not that I know at least... But you could check in your toolLifeTimer macro if the spindle is currently running or not. The action itself can just continue to loop.
if d.getSpindleState() == SpindleState.CW_ON or d.getSpindleState() == SpindleState.CCW_ON:
# start timer
else:
# end timer
Quote from andre on 2 July 2023, 19:08Quote from Dobbelju on 2 July 2023, 12:36
2.
To set the value for the machine param (i.e. param 100 for tool nr 1) i have made an small gui. It can set the param 100 to 44 for example. The progressbar is also set to a maximum of 44 by gui editor. I wanted to change the progress bar max value with my self made gui. I cant change the "maximum" value in the progress bar by macro with this command:
gui.ProgressBar_1.setMaximum(44)
is there something missing or maybe not possible?
Qt has this attribute, but it does not theme to get exposed by simCNC.
How about using a relative value as input and just calculate a percentage of current time over the maximum life time? This way your progress bar maximum will stay at 100.
thisVal = d.getMachineParameter(100) / gui.input_t1_lifespan.value * 100
gui.ProgressBar_2.setValue(thisVal)i.e. at 150 minutes life span and a current run time of 45 minutes you'd get 28,125. No need to round the number, as the progress bar accepts float values.
Cheers,
André
Quote from Dobbelju on 2 July 2023, 12:36
2.
To set the value for the machine param (i.e. param 100 for tool nr 1) i have made an small gui. It can set the param 100 to 44 for example. The progressbar is also set to a maximum of 44 by gui editor. I wanted to change the progress bar max value with my self made gui. I cant change the "maximum" value in the progress bar by macro with this command:
gui.ProgressBar_1.setMaximum(44)
is there something missing or maybe not possible?
Qt has this attribute, but it does not theme to get exposed by simCNC.
How about using a relative value as input and just calculate a percentage of current time over the maximum life time? This way your progress bar maximum will stay at 100.
thisVal = d.getMachineParameter(100) / gui.input_t1_lifespan.value * 100
gui.ProgressBar_2.setValue(thisVal)
i.e. at 150 minutes life span and a current run time of 45 minutes you'd get 28,125. No need to round the number, as the progress bar accepts float values.
Cheers,
André
Quote from CS-Lab Support on 3 July 2023, 12:13The good news is that soon you can use the "Analog IO indicator" as a horizontal or vertical bar.
Regards,
Wojtek
The good news is that soon you can use the "Analog IO indicator" as a horizontal or vertical bar.
Regards,
Wojtek
Quote from Dobbelju on 4 July 2023, 18:07Quote from andre on 2 July 2023, 19:08Qt has this attribute, but it does not theme to get exposed by simCNC.
How about using a relative value as input and just calculate a percentage of current time over the maximum life time? This way your progress bar maximum will stay at 100.
thisVal = d.getMachineParameter(100) / gui.input_t1_lifespan.value * 100
gui.ProgressBar_2.setValue(thisVal)i.e. at 150 minutes life span and a current run time of 45 minutes you'd get 28,125. No need to round the number, as the progress bar accepts float values.
Cheers,
AndréHello, sadly i coudn`t get it to work with this calculation. I assume the problem is on my side and i can´t figure out how to exactly implement this in my screen 😀 .
Could you be so kind and maybe explain a litte bit more?
Quote from andre on 2 July 2023, 19:08Qt has this attribute, but it does not theme to get exposed by simCNC.
How about using a relative value as input and just calculate a percentage of current time over the maximum life time? This way your progress bar maximum will stay at 100.
thisVal = d.getMachineParameter(100) / gui.input_t1_lifespan.value * 100
gui.ProgressBar_2.setValue(thisVal)i.e. at 150 minutes life span and a current run time of 45 minutes you'd get 28,125. No need to round the number, as the progress bar accepts float values.
Cheers,
André
Hello, sadly i coudn`t get it to work with this calculation. I assume the problem is on my side and i can´t figure out how to exactly implement this in my screen 😀 .
Could you be so kind and maybe explain a litte bit more?
Quote from Dobbelju on 4 July 2023, 18:13I have finished most of the project.
As shown in the pictures this is the general build for it.
Every 60seconds the pyAction counts down the actual used tool lifetime for a minute when the spindle is turned on.
Works fine for all positions. When the time has reached 0:0 then the status gets red and can execute whatever is needed - in my case before the next tool change a prompt will be shown that the tool needs to be checked/replaced before continuing is possible.
Also the time is set by an own dialog for each tool number.
Thanks for the assistance!
When someone wants to try this function, i can provide the code.
I have finished most of the project.
As shown in the pictures this is the general build for it.
Every 60seconds the pyAction counts down the actual used tool lifetime for a minute when the spindle is turned on.
Works fine for all positions. When the time has reached 0:0 then the status gets red and can execute whatever is needed - in my case before the next tool change a prompt will be shown that the tool needs to be checked/replaced before continuing is possible.
Also the time is set by an own dialog for each tool number.
Thanks for the assistance!
When someone wants to try this function, i can provide the code.
Uploaded files:Quote from CS-Lab Support on 5 July 2023, 11:13Very good job.
Very good job.