 swap15
		
			swap15
		
		
		
		
		
		
		
		
	
			08-28-2014 02:17 AM
Hello,
I am using a Global variable to transfer data from one VI to other. In one VI, I am writing to the global variable contineously.
And in the second VI, I am reading this global variable and writing it in a text file. Both the processes ( writing to and reading from GV) occur simultaneously. I have tested the software for 24 hours and I had no problems like race condition.
My question is, I have to run this software non-stop for 180 days for permanant monitoring and logging.
I want to know if the Global variable approach is reliable in my case?
regards,
Swap
 Dennis_Knutson
		
			Dennis_Knutson
		
		
		
		
		
		
		
		
	
			08-28-2014 02:30 AM
08-28-2014 02:33 AM
sorry, posted here by mistake.........anyways thanks for the reply.
 crossrulz
		
			crossrulz
		
		
		 
		
		
		
		
		
	
			
			
    
	
		
		
		08-28-2014
	
		
		06:20 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		05-15-2025
	
		
		11:18 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		 Content Cleaner
		
			Content Cleaner
		
		
		
		
		
		
		
		
	
			
		
Pet peeve of mine.
I inherited a VI much like what you are describing. It somehow worked on a test system for many many years. Then there was a computer upgrade and suddenly only 1/4 of the data was logged. Race conditions.
Luckily, I was already changing that VI to use Queues and then it worked perfectly and didn't burn up the CPU nearly as much.
Look into the Producer/Consumer. That is what you really need to do.
08-28-2014 06:50 AM
Hi Crossrulz,
I have never used producer/consumer loop. I have looked into the producer/consumer example but it was to transfer data between two
different loops in the same VI.
In my case, I have two different VI's (not SubVI). Could you please give me an example of how to do it using producer/consumer loop
for two different VI's ?
I would appreciate if you could help me.
Thanks in advance.
regards,
swap
 crossrulz
		
			crossrulz
		
		
		 
		
		
		
		
		
	
			08-28-2014 07:18 AM
You just need to pass the queue reference into your two VIs.