What's new
What's new

Counter reset with Clock

Heiro

Plastic
Joined
Jan 1, 2020
Hi I am not sure if this the correct place to post this.
I am looking for a function on Fanuc that would allow me to reset a counter based on Fanuc internal clock time. For example every determine hour say 7 o'clock or 8 o'clock there would be a pulse generated to reset a counter install.

I hope I got to explain myself and someone could help me.
 
Are you using the internal parts counter now or did you write a parts count Macro? If you're using a Macro then there should be a way to tie it in to the internal clock. Maybe Bill will chime in on that one.
 
You didn't mention which Fanuc controller you were using, but on our 18i-TB, our 21i-M and our two Oi machines the system clock can be read by reading system variable #3001. #3001 holds the number of milliseconds since power on.

I run a parts per hour counter by reading #3001/1000 at the end of every cycle to get the number of seconds. It looks something like this:

#123=#3001/1000

If #123 is greater than 3600 (3600 seconds, or one hour) I store the number of parts that hour, reset the clock and start the next hour.

I hope this is what you're looking for.
 
Sorry for the lack of information. Well it is for a Powermate D, and the idea is to reset an external counter and sound a buzzer. I was thinking about doing it in ladder but your idea is very good. Thank you aj.
 
Sorry for the lack of information. Well it is for a Powermate D, and the idea is to reset an external counter and sound a buzzer. I was thinking about doing it in ladder but your idea is very good. Thank you aj.

Hello Heiro,
You can read the current time directly (hours/minutes/seconds) with System Variable #3012. It converts hours/minutes/seconds to an apparent decimal number. For example, 8:00pm would be 200000. Accordingly, you could do some thing like the following at Start, or End of the program.

IF[#3012 LT 200000]GOTO10 (If before 8:00pm)
--------------
--------------
Code to Reset and communicate with External Device to Sound Buzzer
--------------
--------------
N10
--------------
--------------
Code to Execute if before 8:00pm
--------------
--------------


BPRNT,or DPRNT could be used to communicate via RS232, with an External Device to sound a buzzer.

Regards,

Bill
 
Hello Heiro,
You can read the current time directly (hours/minutes/seconds) with System Variable #3012. It converts hours/minutes/seconds to an apparent decimal number. For example, 8:00pm would be 200000. Accordingly, you could do some thing like the following at Start, or End of the program.

IF[#3012 LT 200000]GOTO10 (If before 8:00pm)
--------------
--------------
Code to Reset and communicate with External Device to Sound Buzzer
--------------
--------------
N10
--------------
--------------
Code to Execute if before 8:00pm
--------------
--------------


BPRNT,or DPRNT could be used to communicate via RS232, with an External Device to sound a buzzer.

Regards,

Bill


As I figured, The resident PM Macro master has the answer.......
 
Hello, I am back with same question but i need to this on PMC. How can I achieve this? I tried using Sub Command 51 which is "Windr" but when I want to sent the function code "151" It gives me a "invalid input" error. How can I fix this o want can I do to rest a counter in the PMC with a certain time?
 








 
Back
Top