LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CPU execution time priority loops during hardware acquisition

hello,

I get data from a USB hardware.

I have two question:

 

1) during the continue loop acquisition, if I introduce a new process for the CPU (in ex. if I move the mouse, or if I open another program, etc) the acquisition time frquency of the loop change.

 

I try to explain better:

if the time of my while loop is set to 100ms, when I introduce a new process for CPU the time varies (increase random -read non deterministic-).

 

2) the other question is:

during acquisition the time is still set to 100ms, but the real iteration time increase. after 10 minutes is about 1s and not yet 100ms. after 1 hour the time is 4s.

This is probably because the CPU work also to build the graphs and to process the acquisition points, TDMS file write, etc.

 

 

I try to set the .vi execution property to high priority (time critical), but I don't see improvements.

I try with 2 while loops (one internal to other), in the first -high priority- the continue hardware acquisition, in the second -low priority- the other process (graphs, write file, etc).

I try with 2 parallel while loops.

 

The problem is still present.

 

I precise that I need to set the time acquisition not with a "wait time" (because during wait the loop is stopped), but I measure the time clock and after my setting time control the loop exits from iterations.

 

My goal is to have at least one while loop with a stable, secure time process.

0 Kudos
Message 1 of 6
(2,410 Views)

What sort of sample mode did you have set? What do you have for number of samples to read? Are you really doing hardware timed acquisition? Post your code.

 

Using the wait function in a loop to time your acquisition will not be precise on any OS except a real-time one.

 

0 Kudos
Message 2 of 6
(2,393 Views)

@Dennis Knutson wrote:

What sort of sample mode did you have set? What do you have for number of samples to read? Are you really doing hardware timed acquisition? Post your code.

 

Using the wait function in a loop to time your acquisition will not be precise on any OS except a real-time one.

 


Ditto that!

 

Search this site for "Producer/Consumer" to see how the acq can be sepearted from the saving/display work.

 

RE: Setting the priority higher

 

Don't. That is like dealing with a slow assistant by yelling at him louder. Get the stumbling blocks (asyncrounous operations like GUI updates and file write) out of his way and let him concentrat on the imporatant work.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 6
(2,380 Views)

 

 Ben wrote:

RE: Setting the priority higher

 

Don't. That is like dealing with a slow assistant by yelling at him louder.

 


 

 

That's a wonderful metaphor.  And good advice.

 

Jim

LV 2020
0 Kudos
Message 4 of 6
(2,375 Views)

what is the site? Do you mean a Post Message in the discussion forum?

Sorry I don't understand.

0 Kudos
Message 5 of 6
(2,358 Views)

Like THIS.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(2,354 Views)