Hi nhan,
in your RT VI you already count pulses and you already measure the time of the pulses.
You only need to port that part into the FPGA VI!
When you don't understand your own code you really should start doing some basic programming courses before taking the free online LabVIEW courses…
Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019