The countor of turned detailed
I need to make detail counter. How to create u32 pin I know, but what to oass the value to hal pin?
Can I wait for the START button or I need to watch M30 or M1** command?
How is it released in other programs?
Please Log in or Create an account to join the conversation.
Are you trying to create a counter for total parts manufactured?
You could do that with a HAL function that looks at the transition from run to stop, which would work for any G-code without modification, but will count aborted parts too.
You could use an M1nn command at the end of the program to only count completed parts, but that requires modifying every part program.
Which works better for you?
Please Log in or Create an account to join the conversation.
Yes, manufactured parts. To avoid broken parts better to use M1** comand befor the M30.Sorry, but I don't understand your question.
Are you trying to create a counter for total parts manufactured?
You could do that with a HAL function that looks at the transition from run to stop, which would work for any G-code without modification, but will count aborted parts too.
You could use an M1nn command at the end of the program to only count completed parts, but that requires modifying every part program.
Which works better for you?
Please Log in or Create an account to join the conversation.
www.linuxcnc.org/docview/devel/html/man/man9/time.9.html
git.linuxcnc.org/gitweb?p=emc2.git;a=blo...6f57a;hb=v2.5_branch
John
Please Log in or Create an account to join the conversation.
You need a pyvcp panel. ( www.linuxcnc.org/docview/html/hal_pyvcp.html ) Just create a file with a .xml extension containing this
<s32>
<halpin>count<.halpin>
</s32>
And set that as your pyvcp panel in the INI file.
Then create a file called M123 (capital M, no file extension) and put the following in it.
#!/bin/bash
COUNT=$(halcmd getp pyvcp.count)
let "COUNT += 1"
halcmd setp pyvcp.count $COUNT
exit 0
Then, any time you call M123 in your G-code the number will increase by one.
it would be easy to make it count down, and not difficult to make it count down from the value in another pyvcp number box
Please Log in or Create an account to join the conversation.
i get can't find module 'time' .
sorry i read your other link John.
will be waiting for 2.5
andy, how to reset your counter to zero?
Please Log in or Create an account to join the conversation.
but will it cause trouble somewhere else later ?
and don't understand how it knows to reset the COUNT
without any connection to M123. not any i see.
M124
#!/bin/bash
RESET=$(halcmd getp pyvcp.reset)
let "RESET = 0"
halcmd setp pyvcp.count $RESET
exit 0
Please Log in or Create an account to join the conversation.
Cool
#!/bin/bash
RESET=$(halcmd getp pyvcp.reset)
let "RESET = 0"
halcmd setp pyvcp.count $RESET
exit 0
Please Log in or Create an account to join the conversation.
is this possible without rebuilding the world ?
to msg the total of m123
g17 g20 g40 g49 g54 g80 g90 g94
m123 (start counter)
run program .....
each depth m123
(msg, total of m123 = ??)
m124 (reset counter)
m2
if nothing else i can reset at start of file i guess
Please Log in or Create an account to join the conversation.
well, i made another file to reset it. it works,
...
M124
#!/bin/bash
RESET=$(halcmd getp pyvcp.reset)
let "RESET = 0"
halcmd setp pyvcp.count $RESET
exit 0
That doesn't make any sense at all....
First you read a value from a (probably non-existent) pin called pyvp.reset. and store it in RESET
Then you throw away that value and set RESET to 0
Then you set the counter to the value of RESET.
Much simple would be:
M124
#!/bin/bash
halcmd setp pyvcp.count 0
exit 0
Please Log in or Create an account to join the conversation.