Example Code

Print VI causing Front Panel to freeze and different LabVIEW Threads

Code and Documents

Attachment

Functional Description

The purpose of this VI is to show that even while the Print.Panel To Printer VI is executing, other loops are not stopped. They may be delayed, but execution does occur. Using the Print.Panel To Printer will cause the User Interface thread to hang causing the user to think that the VI has stopped executing tasks in the background, but that is not the case.

To show that other loops continue their execution while the front panel has frozen during the printing process the millisecond timer value is recorded and the number of loop iterations is calculated of the non printing loop.

See the VI documentation and the notes in the block diagram for more information.

Caveats and Additional Notes
See KnowledgeBase DIRECT-3S8R8M: How Many Threads Does LabVIEW Allocate? for more information

Front Panel:
thread test fp.jpg

Block Diagram:
thread test bd.jpg

Joshua B.
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors