Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

CWBufferedAO.zip uses 100% of CPU

This sample program is modified as follows,
CWAO1.UpdateClock.Frequency = 1024
CWAO1.NUpdates = 1024
CWAO1.ProgressInterval = 256

When PCI-MIO-XE16-10 is used and NUpdates is the same value as Frquency, this program uses 100% of CPU and "STOP" button does not work.

Our program was developed for DAQCard-6036E and was intended to use it on PCI-MIO-16XE-10. Because of programming requirement, the stopping process should be taken within 1 second after STOP button is clicked.

Is there any reason why this sample program uses 100% of CPU when small value of NUpdates is applied?
0 Kudos
Message 1 of 5
(3,581 Views)
Greetings,

I ran this example and and only modified the UpdateClock.Frequency, NUpdates, and ProgressInterval values as you indicated above. I was able to see the problem you are reporting. The issue at hand is that the the timing is all messed up between the CWAO1_Progress() callback function and the data waveform you are outputting. You have changed the output buffer size, but not changed the actual data you will be outputting. If you change the NUpdates buffer to 1024, then you also need to change the data buffer size. Right now you have probably left it at an array of 4096 points.

You need to change the size of the arrays data and data4. In your case, data will be 1023 and data4 will be 255. You will also have to modify Form_Load() to fill the
se new arrays.

Regards,
Justin Britten

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,581 Views)
Thank you for your comment. After you modified this program properly, did it run normally? I think it still takes 100% of CPU.

We have developed a program using DAQCard-6036E to output signal with the AO settings mentioned. After STOP button is clicked, it decreases the output level to zero volt within a few seconds.
Our customer requires that to decrease the level should start within one second after STOP button is clicked.

This program was tryed to test using PCI-MIO-16XE-10 and 100% CPU problem occurred.

Is the 100% CPU problem the spec or a bug?
We expect that the E series cards and boards work in the same way.
0 Kudos
Message 3 of 5
(3,581 Views)
After I modified the program I was able to use the Stop button to terminate the program. When I only made the changes you indicated it consumed 100% of the CPU and the Stop button did not work. I had to use the Windows Task Manager to kill the program.

With the changes I suggested you make you should be able to use the Stop button. If you want to guarantee that the result be 0V after the Stop button is clicked I would have the card output 0V at the beginning of the Stop routine before the board is reset.

Your program is set up with a Progress interval of 256 samples. Every time 256 samples are acquired the data will be read in. Depending on your sampling rate and how fast it takes to get 256 samples you could potentially be runni
ng your program very fast. If you are doing a continuous acquisition and it takes 10ms to get 256 samples than you effectively have a loop timer of 10ms. If this is the only process on your computer actively requesting CPU time it will try to use as much as possible. Windows will grant this unless another program asks for CPU time. You should notice that while it may run close to 100% your computer isn't very slow and you are still able to open applications and do other work.

Regards,
Justin Britten

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,581 Views)
My PC is DELL Precision-620 (2 CPU's) with Win2000.
The sampling rate is 1024Hz so that 256 samples take 250ms. It is very slow operation.
STOP button does not work and some user logics do not work in Progress routine.
Attached a slighly modified program to show you the strange opeartion in Nidak32.sys. Are the Update count
and Time Editbox updated on your PC?
Download All
0 Kudos
Message 5 of 5
(3,581 Views)