From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multithreading

Hi,

 

How to use multithreading in LabVIEW?

 

Is the attached diagram works in multithread?! what's lack? because when I tested it, it works sequentially

0 Kudos
Message 1 of 7
(2,830 Views)

Sadok wrote:

Is the attached diagram works in multithread?! what's lack? because when I tested it, it works sequentially


Remove all the while loops and sequence structure. It will work as you expected.

Message Edited by Mathan on 05-12-2009 06:22 AM
0 Kudos
Message 2 of 7
(2,824 Views)
In the begining I did like you ve said but it worked sequentially! not really in prallel?? how to do please! especially that functions that want to execute in parallel  takes a time and cantain loops and sequences..
0 Kudos
Message 3 of 7
(2,812 Views)
For the subVI, go to File -> VI Properties -> Execution and check Reentrant execution.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 7
(2,806 Views)

Perhaps your DAQ device does not accept parallel access.  If your loops were doing things which did not require shared access to a resource outside the CPU, they would probably mutlithread.

 

Lynn 

Message 5 of 7
(2,780 Views)
Oh that's a good observation by Lynn. Before you check the re-entrant option, be sure to ensure that all shared resources are protected (possibly by using sempahores).
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 6 of 7
(2,775 Views)

Rather than letting each loop at the port seperately like you have done.

 

 

 

I would sugget you look at my Action Engine Nugget where I used the challenge of writting to a DIO port from multiple threads as illustrated here.

 

 

 

By use the AE approach the semaphore "comes along for the ride".

 

Have fun!

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 7
(2,750 Views)