LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Threading in Labview (not teststand)

I have heard that it is possible to write a Labview application using more than one execution thread, but I don't understand what the help files are saying.

Do I have to have a HyperThreading CPU to do this?

This was easy in CVI.

Can more than one thread make changes to the front panel controls or even display it's own panel?

Maybe someone has some pointers or simple examples of how to create a second thread.

(Please - no TestStand examples. Just 100% Labview)
0 Kudos
Message 1 of 2
(2,750 Views)

You don't need hyperthreading. Parallelism is built into LV in several levels. First of all, you can simply have parallel code by having 2 pieces of unconnected code which will run "in parallel" (the scheduler will make sure they both get executed).

You can assign priorities and threads to VIs by going to File>>VI Properties>>Execution, but there is usually no need to deal with this because is LV will be fast enough without this (plus, you have to know what you're doing).

Like I said earlier, if you just want different pieces of code to execute in parallel, just make sure they are not connected. You can open as many VIs as you like like this and let them execute in parallel. You can have seperate loops updating controls on the same front panel. Basically, whatever you like. It's really very simple. If you want an example, simply create 2 while loops which do something, and you can see they do it the same time.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
Message 2 of 2
(2,742 Views)