LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview crash with delay

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. 

LilySamchuk_0-1694772371780.png

 

0 Kudos
Message 1 of 11
(1,190 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(1,172 Views)

How to create a loop to iterate to 3600 s ? Thank you 

0 Kudos
Message 3 of 11
(1,145 Views)

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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 11
(1,120 Views)

IMG_0919.png

I’m not sure  how to connect for loop with my original code . Thank you

0 Kudos
Message 5 of 11
(1,104 Views)

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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 11
(1,083 Views)

LilySamchuk_0-1695045898443.png

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

 

0 Kudos
Message 7 of 11
(1,035 Views)

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?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 11
(1,024 Views)

There is no error code - the program just freezes 

0 Kudos
Message 9 of 11
(1,018 Views)

Settings for what ? Thank you 

0 Kudos
Message 10 of 11
(1,006 Views)