LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multithreading

Highlighted

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
(1,265 Views)
Highlighted

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
(1,259 Views)
Highlighted
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
(1,247 Views)
Highlighted
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
(1,241 Views)
Highlighted

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
(1,215 Views)
Highlighted
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
(1,210 Views)
Highlighted

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
(1,185 Views)