473,396 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Data Acquisition Problem

Hi friends,

I'm using Windows Timer in my VC++ application. But since a few days back i noticed a peculiar problem in my application. The application is unable to acquire data for a period of 100ms and after that it is again coming back to normal operation. This is happening at different instances but every time duration is always near about 100ms. I have checked the software thoroughly and I could not find any bug in the code. Is this a Windows timer problem? If so, what is the way out for me? Kindly, help
Feb 6 '08 #1
3 1524
hdanw
61
Lets see some code.

Is your timer reintrant?

If your timer is not responding to windows properly then It will be removed from the list of handlers that recieve timer messages.

This would happen if your Timer was ticking away at faster rate than what you are able to process data and realease control back to the os. You would get one tick at t0, and On the second tick at t100ms your first timer action is incomplete, and windows marks the process as non-responsive.

SHOW US SOME CODE.
Feb 6 '08 #2
[quote=avijit123]Hi friends,
Hello friends,

I'm attaching some part my code. Kindly, go through it and reply if you can make out anything from it. The data I'm acquiring is @ 6ms . Only while going through the log whiles I could make out that 100ms data was missing.

dwCycRunTime = (DWORD)m_Rtc.GetTotalElapsedTime();
int cycle=0;
DWORD time1;
timeVal=0;




while((dwCycRunTime <= (time1+9000)) && !pMw->m_bCancel)
{
insetDacVal[0] = (float)(Vlevel*sin(2.0*PI*freqSinWave*timeVal));
insetDacVal[1]=insetDacVal[0];
m_MiuCmd.DacCommand(2,insetDacNo,insetDacVal);
m_MiuCmd.AcquireDipStatus();

dwCycRunTime = m_Rtc.Wait(dwCycRunTime+5) ;
m_MiuCmd.ReadDip(wDipR,ucDipSts);
fprintf(fDipdata,"%5.2d\t\t",dwCycRunTime );
for(i=0; i<6; i++)
fprintf(fDipdata,"%u\t" ,gMiuSts.wDipData[i]);
fprintf(fDipdata,"\n");
m_MiuCmd.AcquireAdcStatus(gucA323Adc[0][0],&gucA323Adc[0][1]);

dwCycRunTime = m_Rtc.Wait(dwCycRunTime+5);

m_MiuCmd.ReadAdcStatus(gucA323Adc[0][0],fAdcV);
for(i=0; i<gucA323Adc[0][0]; i++)
{
fprintf(gfpLog,"%06.2f\t",gMiuSts.fAdcV[i]);
}
fprintf(gfpLog,"%06.2d\n",dwCycRunTime );
pMw->DoEvents();
UpdateData(FALSE);
timeVal=timeVal+0.01;

LONGLONG CRtcTimer::GetTotalElapsedTime()
{
LONGLONG tmElapsed;
LONGLONG tmCurrent;

if(gucTimerType != TIMER_PC)
{
tmElapsed = (LONGLONG)(GetRtcCnt()*10); // Reset last call
}else
{
QueryPerformanceCounter((LARGE_INTEGER*) &tmCurrent); // What's the time now?
tmElapsed = ((tmCurrent - m_StartTime) * 1000) / m_Freq; // Time since start
m_LastTime = tmCurrent; // Reset last call
m_RunLastTime = gdwTotalRunTimeSec-1; // Reset last call
}
return tmElapsed; // Returned in milisecon
Feb 7 '08 #3
arnaudk
424 256MB
I think the problem is that you're missing a main(), and maybe even some function definitions.
Feb 7 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Johann Blake | last post by:
If you are, I'd be interested in knowing what kinds of applications you are working on and the problems, if any, you are confronting. Best Regards, Johann Blake CloserWorlds Mobile Solutions...
4
by: Alexander Arlievsky | last post by:
We are developing an application that involves a PCI driver to a DSP card that generates data at high rates (over 40 interrupts/sec, about 3MB/sec). We use WinDriver for the driver (no kernel...
1
by: Ryan Melville | last post by:
Hi, I need to use WIA (Windows Image Acquisition) from managed C++. Is there a "new and improved" way to access WIA from managed C++ (i.e., through .net)? Or, is it the same COM calls as from...
7
by: jude | last post by:
Hello, We are starting to discuss a new ASP.NET application that will be a data acquisition display application. The data to be displayed will come from multiple sources--database tables, serial...
11
by: mwt | last post by:
Hi. I'm reworking a little app I wrote, in order to separate the data from the UI. As a start, I wanted to create a iron-clad data recepticle that will hold all the important values, and stand up...
9
by: David Harris | last post by:
Ok, so I'm semi-new to .NET, having done everything manually with SQL code back in VB6. So before I program this up completely manually again, I thought I'd ask for better ways to think through...
3
by: Roberto Hernández | last post by:
I try to use the Windows Image Acquisition (WIA) with a sample in vb.net but it takes only back photos and also at low resolution. How can I put ther resolution at 640x480? I have a Labtec webcam...
0
by: Scott | last post by:
Biopotential Biofeedback Data Acquisition DataQ Data Acquisition Custom Software 1 to 32 channels (AuroScroll 4ch/time) 35+ DataQ Devices supported Record / Playback Functions 0-15 Plot bits +...
36
by: Ulysses | last post by:
Could someone tell me how to go about getting data from a data acquisition card using C?...<Just general information would also help........I'm just working on an idea at the moment>.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.