LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ System Hanging Up on "Write to Text File"

Hi All,

 

I am collecting data using two SCXI chasses with 1120 amplifier modules and SCXI 1112 thermocouple modules.

 

I am monitoring 12 input voltages and 4 thermocouple inputs.

 

I have set the samp,e rate to 2500S/s, and I am letting the software figure out how many samples to take each measurement.

 

Most of the time, the system runs fine, at about a 16ms loop time.  However, every few seconds, the system will hang up for ~500ms or more between readings.  This only happens when I am logging data to a text file.  When I have the logging function turned off, the system never hangs up.

 

Any thoughts as to what could be causing this and how to fix it?


Many thanks!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 1 of 10
(2,381 Views)
0 Kudos
Message 2 of 10
(2,377 Views)

Yes, do your logging in a parallel task so that it will not impact the data collection. When you do it within the same loop as your data collection you take the hit for the file I/O. There is a variety of ways you can pass the data to the logging task. You can use a queue or a notifier to pass the data. If you have your data accumulated during your data collection you could use a functional global to store the data. Both loops can access the data via the functional global. Since your data set is not that large I would use a queue to pass the data.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 10
(2,375 Views)

If I have broken a rule in posting a question about a related but significantly different issue, I apologize.  However, I have ruled out the primary failure mode I suspected in my first post, and have moved on to another suspected failure mode, thus the change in subject line.

 

 

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 4 of 10
(2,374 Views)

It looked like you had the same text in both messages.  If you truly have a different question, then post a new thread.  But then I would suspect your message would look substantially different.

 

If you have a related question, then you should keep it in the same thread that way the continuity of the discussion continues.  Since you said, "hey I don't think it's this problem anymore, now I think it's this", you are basically continuing with solving your same problem and should stay in the same thread.

0 Kudos
Message 5 of 10
(2,369 Views)

Hi Mark,

 

This sounds perfect, but I lack the technical knowledge to put your ideas into code.  Any chance I could get you to either post code (I am running LV 2010, V10.0, 32-bit) or post a picture of the associated block diagram?

 

I found the "Queue Basics" VI in queue.llb.  Am I on the right track?

 

Thanks again.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 6 of 10
(2,363 Views)

Yes, that is basically what you want to look at. You should also use the "Find Examples" to look at the shipping examples for queues.

 

Here is a very basic piece of code which illustrates what I was suggesting.

 

Basic Queue.png

 

This simulates collecting data in the upper loop. Every 250 points it posts the collected data to the queue for the lower loop to process. In this example I do nothing more than update the indicator. In your case you would want to put the code there to write it to file.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 10
(2,356 Views)

That's what I thought you meant.  Thanks for posting it.

 

My main thread uses state machine architecture.  Looks like I would have to build a second loop, outside the state machine, to do the logging.  Please let me know if that is not correct.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 8 of 10
(2,353 Views)

Yes, that is what I have been suggesting. If you keep the logging in your state machine you will take the hit on the performance because the file i/o is slow. If you separate it out your data collection loop will be unaffected by the data logging.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 10
(2,351 Views)

Understood.  I am such a gumby at this, I just wanted to make sure I was comprehending the obvious.  I will set it up and run as you suggest.

 

Thanks for your help and patience.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 10 of 10
(2,349 Views)