I'm not familiar with Yaskawa(although I just bought a new one, so i will be soon), and i'm not sure if this is the easiest way, but you should just be able to wire an output to the PLC and trigger the output in your program every time said thing happens. if you are just counting by 1, pulse the output and have the PLC do all the math. This is how i would do it, not sure if that is the best way or not.
Since your maximum value is well within the range of a Byte variable I'd use it. It makes your life very easy. You could use the INC (increment instruction) B-whatever address. To send it to the plc you could use the DOUT or the PULSE instruction.
DOUT OG#( x ) B000
PULSE OG#( x ) B000 T=1.00
The x in the OG#( ) is whatever group you want to use that is on your network between the robot controller and plc.