I checked the manual and the CP2E does have High Speed Counters
https://assets.omron.eu/downloads/manual/en/v5/w614_cp2e_software_users_manual_en.pdf
Section 10 covers Interrupts, section 11 cover High Speed Counters
There is a tutorial on setting up a High Speed Counter:
https://www.youtube.com/watch?v=jWGlXCa7DLs
I haven't used the CP2E or CX Programmer so I can only speak in general terms. A High Speed Counter (HSC) works outside of the normal program loop, so it can count inputs a lot more quickly than a normal counter, it is designed for use with Encoders. Once the HSC reaches a Set Point it calls an Interrupt. An Interrupt is exactly how it sounds, it interrupts the normal program loop, runs some software and then returns control to the main loop. I don't know if the CP2E allows you to alter the HSC target value whilst the program is running. But for a Siemens PLC I would set up a HSC, it would reach its Set Point, Interrupt the main program loop and pass control to an Interrupt sub routine. In the Interrupt routine I would tell the camera to operate, calculate the new Set Point for the HSC, transfer the new Set Point and Reset the Current Value. Then return control to the main loop.
Using a software system you will always be limited by the speed of your main program loop. At a camera trigger value you would store the current value, add the number of counts for the next triggering point which would give you the next target value. Yes it can be a problem if you go beyond the counters maximum value, but in a real world situation it isn't usually too much of an issue. If you use an unsigned 32 bit Integer value it has a maximum value of 2,147,483,647. If your process triggered with a 100 count every second that would still be 357,913 minutes before you hit maximum, or 248 hours, or 10 days. So you just need to make sure that you reset the system before that happens, often a factory gets powered down at the weekends, which would solve it for you, otherwise you just need to catch it a trigger point.
You don't have to use the Z input to reset the counter, you can reset the counter at your trigger point through software. I would use the Z input with another interrupt so that you can check that the counter is counting correctly.
The Z channel doesn't have to be used to Zero a count:
https://www.usdigital.com/news/post...MIwI3gjtiC7wIVkt_tCh3xsQeFEAAYASAAEgLdyvD_BwE