Hello;
I'm attaching a VI which performs that task.
This VI performs a hardware counting.
You will need to set up the trigger levels to be 0.8V and 2.8V. The VI will count in between both edges.
To execute that VI you will need a DAQ board with Analog Hardware Triggering capabilities.
Hope this helps.
Filipe