05-03-2013 02:49 AM
Hello,
I have a conflict about the parallel loop designs and data pass between two while loops.
I have developed a DAQ system software. Two while loop executes in my program.One of them is a detailed user interface which produces a channel list to scan by DAQ system. Channel list will be available when user press a button is called load channel list. This button is placed in a event structure. Another one is coded for data acquisition. These loops starts to execute at the same time but in different rates. Data acquitision loop rate can be changed from the user interface. Here I need to execute two loops together and pass the channel list to the DAQ loop. I have known that it can be possible with queues, notifiers and local variables. Also I am aware of that their pros and cons.
The problem here is when I use notifier or queue DAQ loop waits button to execute. But I need that two loops should execute and when I load a new channel list, the data acquisition process should be updated with nnew channel list.
I am looking forward to hearing solution suggestions
Thank you in Advance.
King regards
			
    
	
		
		
		05-03-2013
	
		
		03:01 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		05-11-2025
	
		
		09:21 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		
		
			Content Cleaner
		
		
		
		
		
		
		
		
	
			
		
Have you had a look at this? http://www.ni.com/white-paper/14116/en
This is a good starting point and it will allow you to change channels, acq rates etc.
			
    
	
		
		
		05-03-2013
	
		
		03:12 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		05-11-2025
	
		
		09:22 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		
		
			Content Cleaner
		
		
		
		
		
		
		
		
	
			
		
I think you don't really understand the concept of running two loops in parallel => producer (UI) / consumer (DAQ)
You can find more information about that here : https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...
Try to understand what is happening with the queue's.
Furthermore, try to avoid Local variables to a minimum. There are plenty of other, better ways of sending data from one loop to the other.. e.g. Functional globals : https://forums.ni.com/t5/User-Group-Resource-Center/Everything-You-Ever-Wanted-to-Know-about-Functio...
05-03-2013 03:25 AM
@ABCPrograms wrote:
Furthermore, try to avoid Local variables to a minimum. There are plenty of other, better ways of sending data from one loop to the other.. e.g. Functional globals : https://decibel.ni.com/content/docs/DOC-21226
If you have a queue mechanism in place, I would use that to pass data from Producer to Consumer. And use a user event to communicate the other way round if need be.