LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble with AvailSampPerChan.

I set up DAQmx tasks in an inialization sequence and use the DAQmx Read function in a while loop and it runs great.  However, when the operator retrieves a data file, which momentarily interupts the program, the AvailSampPerChan rapidly fills up and gives error -200279. 
 
Why is this happening when the DAQmx  Read function is in it's own while loop that is assigned to run in a separate processor?  Please see the attached screen shot.  The top while loop only runs the DAQmx Read function and is assigned to processor 1.  The lower while loop runs all the UI programming and is assigned to processor 0.
 
Is there a way to programatically place the DAQmx tasks on hold when certain events happen in the application, therefore avoiding the sampling error?
 
I'm using Win-XP and LV 8.5.
 
Dave
0 Kudos
Message 1 of 3
(2,578 Views)

Hello Dave,

Thanks for contacting National Instruments. 

Using a timed loop with Windows XP usually does not have the intended results.  This is due to the fact that Windows has more than one thread running and usually tries to balance the processor load between the two cores.  As a result, other Windows processes could be running on the core that is intended only for the read.  National Instruments usually recommends using a different architecture for your VI due to the lack of explicit control over threading offered by the Windows XP operating system.  I am not sure what exactly is going on in the rest of your code, if you could post a full screen shot or the VI, that would be most beneficial. 

What kind of functionality do you want your application to have?  Normally performing a read with DAQmx and using a file for input and output is used with a producer consumer type architecture.  A template for this type of design pattern can be found in the New Window (Under File -> New) in the path Frameworks -> Design Patterns.  This type allows for acquisition to occur at one rate while processing occurs at another rate. 

What does your VI do with the data file?  What functionality do you want from the VI you are creating? 

Please post back with your response and any questions. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 2 of 3
(2,560 Views)

Hi Browning,

Thank you for your reply and I'm sorry for the delayed response.  I've been out of town.  The statement "Using a timed loop with Windows XP usually does not have the intended results" is distressing to me because I have several released programs based on this architecture.  I’m using the timed loop because of the extra control that they provide.  However, I interpret your response to say the timed loop is a poor choice to use.

This particular code is several years old and only recently I’m having this trouble.  About a year ago I took nearly all the LabVIEW training available and I then came to realize that I have a lot of “bad habit” programming.  From this training I’m aware of the producer-consumer architecture; so I need to look into it.

It’s maddening and painful to realize there are more appropriate ways to do things.

As far as the rest of the code goes, it’s just user interface issues.

Thanks,

Dave

0 Kudos
Message 3 of 3
(2,539 Views)