Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Global variable reliability

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

0 Kudos
Message 1 of 6
(4,013 Views)
Your question has nothing to do with multifunction daq. You should have posted to the LabVIEW board.

You would be better off with a producer/consumer design where you pass values to the second loop via a queue. You are liable to either skip values or get duplicate values when you read the global.
0 Kudos
Message 2 of 6
(4,010 Views)

 

sorry, posted here by mistake.........anyways thanks for the reply.

0 Kudos
Message 3 of 6
(4,006 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(3,998 Views)

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

0 Kudos
Message 5 of 6
(3,996 Views)

You just need to pass the queue reference into your two VIs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,994 Views)