parts counter

More
10 Feb 2011 05:14 #7101 by M4MazakUser
parts counter was created by M4MazakUser
any ideas on a pin i can link to to make a parts counter?
i cant find any linked to "m02"

Please Log in or Create an account to join the conversation.

More
10 Feb 2011 08:23 #7106 by andypugh
Replied by andypugh on topic Re:parts counter
I can think of a number of ways to do it using a snippet of G-code in the files, I assume this isn't an option?

Can you use the halui.program.is-running pin? linuxcnc.org/docs/html/gui_halui.html#r1_2_15

Please Log in or Create an account to join the conversation.

More
10 Feb 2011 22:28 - 10 Feb 2011 22:38 #7117 by M4MazakUser
Replied by M4MazakUser on topic Re:parts counter
i really wanted it to work so as i could get a signal on every " / O100 ENDREPEAT " line, then the program would simply stop at a specific count. ( i already have "net outa_bar <= halui.program.block-delete.on" hooked up to stop pgm when the barfeeder is out) it would be nice to be able to preset an amount of parts when i load up a 5.5mtr length of bar! anyway, i geuss i can use a m1xx code, just was looking to make it invisible to the programmer thats all.

is the repeat number available anywhere?
Last edit: 10 Feb 2011 22:38 by M4MazakUser.

Please Log in or Create an account to join the conversation.

More
10 Feb 2011 22:47 #7119 by M4MazakUser
Replied by M4MazakUser on topic Re:parts counter
i also tried using "net line_number => motion.program-line", but it is erratic and jumps to "0" while changing tools. it also is wrong, as i would have to compare it to line 10, or wherever the repeat starts from.

Please Log in or Create an account to join the conversation.

More
10 Feb 2011 23:29 #7122 by BigJohnT
Replied by BigJohnT on topic Re:parts counter
You could set up a pyvcp preset counter and stop the program with halui after the specified number of parts have been reached perhaps using a M1xx to increment a part counter and do the compare to the preset counter.

John

Please Log in or Create an account to join the conversation.

More
11 Feb 2011 08:04 #7133 by andypugh
Replied by andypugh on topic Re:parts counter
M4MazakUser wrote:

is the repeat number available anywhere?


I am fairly sure that it isn't. I suspect that EMC2 itself has no idea how many times it has been round the loop.

I wonder if a better idea would be a switch on the barfeeder hooked into a G-code digital input?

O100 DO
<stuff>
O100 WHILE [Barfeeder not empty]

Please Log in or Create an account to join the conversation.

More
13 Feb 2011 23:09 - 14 Feb 2011 01:33 #7175 by M4MazakUser
Replied by M4MazakUser on topic Re:parts counter
Ok, im currently trying to get an M1xx code working. you see, i normally load 4.5metre bars into the machine and run off as many parts as needed, i have the "out of bar" switch connected up to
net outa_bar <= halui.program.block-delete.on
and
/ O100 ENDREPEAT
makes it stop in such a situation.
But !
i want to be able to set a value while the program is running, not have to rely on the
/ O100 REPEAT [12]
value, giving me the ability to have a visible display on how many parts to go, and even possibly work out how long.

p.s. having a lot of trouble trying to make an m1xx code work, it was much easier when they are hooked up to "actual" pins.
Last edit: 14 Feb 2011 01:33 by M4MazakUser.

Please Log in or Create an account to join the conversation.

More
14 Feb 2011 08:01 #7178 by andypugh
Replied by andypugh on topic Re:parts counter
Would it help to use a DO / WHILE loop and an actual counting variable? You would need to link the variable to an analogue output and write to it each time round the loop if you wanted to display it in a PyVCP panel.

Perhaps we need to decide what you want to happen, then figure out how to make it happen? Currently I think that process is being reversed.

Please Log in or Create an account to join the conversation.

More
14 Feb 2011 15:04 - 14 Feb 2011 15:06 #7182 by BigJohnT
Replied by BigJohnT on topic Re:parts counter
Could you create a small parts counter component with the needed pins and toggle one pin for each loop somehow to count the parts? I'm not at a computer with EMC so I can't test this idea. Just thinking out loud...

What troubles are you having with M1xx?

Examples here:
www.linuxcnc.org/docview/html/gcode_main.html#sec:M100-to-M199:

John
Last edit: 14 Feb 2011 15:06 by BigJohnT.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum