Hi Johan,
the difference of your 2 examples is the time when the data gets written to file.
Alt1 is writing after the measurement has finished, alt2 when the measurement is running. Depending on measurement time alt2 should be more safe (no big memory blocks aka arrays, nearly no data lost in case LabView breaks up).
But I would make the error in/out of the loops as shift registers! This way you have a chance to handle error conditions properly.
Best regards,
GerdW

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