LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Data out of running SubVI

Hi Waldemar,

I just wondered about what this section of your VI does. I would assume that the true case is always the chosen case, just because of LabVIEW dataflow.And why do you add 1000?

Andreas
0 Kudos
Message 11 of 12
(675 Views)
Hi Andreas,

this case is to get the number of loops through the while loop in one second.
The upper shift register holds the tick count when the next second ends. The lower shift register holds the iteration count at the start of the current second.
The tick count function outside the loop will give e. g. 12000. The tick count function inside the loop will give 12000 too. Then it will go through the TRUE case. In the case the time will be calculated to 13000 and this value will go to the shift register. In the next iteration the tick count will give 12001 (on a slow machine) and then it will go to the FALSE case and the value in the shift register will be preserved. At the time the tick count will reach 13000 it will
go to the TRUE case again. From the lower shift register the the number of loops whithin one second is calulated.
The tick count function gives back the time in milliseconds so I added 1000 to go through the TRUE case once each second.
Since these VIs weren't build to go as example to the public they have two major misbehaviours. First is incorrect initalization of the tick count shift register. It will go immediatly through the TRUE case and gives therefore a meaningless value. Second is that you can stop one VI with the stop button but the other VI must be aborted.

If you tried to find out how this VI works and you have use execution highlighting you will always go through the TRUE case because it would take more then one second to go through the loop. If you would use a probe on the wire before the case selector you will mostly see FALSE with a flickering TRUE once each second. Depending on your system it could be that you never see TRUE so you can think it will always go thro
ugh the FALSE case. This is one of the tricky debuging problems where you need conditional breakpionts.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 12 of 12
(435 Views)