Information required regarding "Run Once" mode of LabVIEW?

Viewed 258

I am trying to create a simple project in LabVIEW, where I am trying to blink an LED using a slide switch

But after when I connect both slide switch and LED on back end (block diagram) and try to run my VI, I am unable to see output result when I press the "run once" button

But when I press "run continuously" button, I can easily see result changing

I have attached a snapshot and I have highlighted both run modes

I want to know, approximately how much time occurs for run once mode? I guess that time will be very small, because of which we cannot see change in output with normal human eye capability

enter image description here

2 Answers

Without any kind of control, the program will be executed as fast as your computer possibly can, so typically in the order of milliseconds.

Bonus content: As @kosist suggests, if you want your program to run continuously, you should pure your code in a while loop, and then it will be executed continuously even if you just press Run once. Note that this is the correct approach to run a program. Here a video by NI that explains how to use while loops.

Don't forget to add a timer to the loop, or else Labview will execute it as fast as it can, consuming a lot of your CPU.

If you want to know the elapsed time for execution time, maybe you can try the below method to test:

enter image description here

And you can get the elapsed time for "run once mode".

The execution speed still depends on the CPU running clock.

I test on my computer, the results are different every time. (Around the 80 us ~ 140 us for this case.)

Related