When you connect to the device, there may already be a time reference set for the device. Check if the time is already referenced (e.g. because your PC crashed during the event) before changing the time reference. Do this by sending the EPOCHREFGET command to the system.
Ask the USB Timing Box for stored value pair
← EPOCHREFGET\n → EPOCHREFGET;00\n → 00000000;00000000\n // ref_computer_time;ref_time_stamp → \n
Store the result for later use with your application.
If values are not set yet, set time reference to current time.
← EPOCHREFSET;4a3caa45\n
⇅ toggle DTR line
→ EPOCHREFSET;00\n
→ 4a3caa45;0151bcf5\n // ref_computer_time;ref_time_stamp
→ \n
Store the result for later use with your application.