Control emitter with external Siemens PLC / Number of parts

Hello together

Is there a way to give the emitter exactly the number of parts it should output?

I have a Siemens S7 1215C and a HMI and want to control the FactoryIO via it. The color selection already works. The number of parts are counted by a CounterUp how many times the emitter is set to 1.
Actual state: always one part less than specified.

Thanks for your help and inputs.

For me the easier solution is to use retroreflective sensor, if you set max time and min time to 1 you should be able to count one part before next is emited and stop the enable (emit) signal.

Agree with bartosz.kuras00. Have a look at Scene 4 - Queue of items (Counters).