09-15-2023 05:04 AM
Hello. I have a LabVIEW code that crashes if I insert delay5 of 1 h. I need to make measurements every hour. If there is a small delay the program works fine. If there is 1 h delay, the program freezes and I have to restart everything. There is no error indication or anything. I am attaching the picture , I don't have a VI right now and I know that you cant debug a pic, but if you have any suggestions how to debug it, I will very grateful. Delay ( is the only thing that I change in the code.
09-15-2023 05:43 AM
Hi Lily,
@LilySamchuk wrote:
but if you have any suggestions how to debug it, I will very grateful.
Delay ( is the only thing that I change in the code.
On your image: Too many ExpressVIs, too many local variables, a lot of RubeGoldbergs…
Suggestions:
Having a single function set to wait for 3600s is a PITA in terms of UX. Instead there should be a small loop set to iterate upto 3600 times with 1s delay inside and an additional stop button to break the loop.
And there should be a state machine instead of a long sequence of steps…
09-15-2023 06:36 AM
How to create a loop to iterate to 3600 s ? Thank you
09-15-2023 07:16 AM
Yes, a Wait will 'freeze' the program until it's done. A 1h wait is silly. What you'll do is a 100ms wait in a loop and check when 1h have passed.
09-15-2023 08:11 AM
I’m not sure how to connect for loop with my original code . Thank you
09-15-2023 09:41 AM
Just wire connect the error wire to the loop, then r-click the connection and change to Shift register and wire through.
The comparison is redundant, you have already limited it to 3600 loops.
09-18-2023 09:04 AM
I replaced my long delay with the loop, you can see on the picture. After 2 measurements are take, on the third one it crashes - the file is created with no data and I can not even stop the program, I have to restart everything. The same problem as I had with delay of 1 h. So the loop didn't help
09-18-2023 09:40 AM
You should have a stop button connected to the for loop termination.
The issue probably have nothing to do with the wait, or rather not directly. You instrument probably gets a full buffer (due to the wait) and overflows. Check your settings so you set it to finite samples and such. What's the error code out?
09-18-2023 10:16 AM
There is no error code - the program just freezes
09-18-2023 12:56 PM
Settings for what ? Thank you