I have a power supply that provides a voltage signal that is proportional to the current draw. I need to detect a short current spike of around 70 amps. The baseline voltage varies from .2 to around .5 volts and the spike is around around 7 volts. Is there a way to set the threshold of the counter to say 4 volts?
These are the two functions I am starting with.
INT32 CDAQCounter::StartCounting()
{
DAQmxErrChk (DAQmxCreateTask("",&m_TaskHandle));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(m_TaskHandle,m_CardID/*"Dev1/ctr0"*/,"",DAQmx_Val_Rising,0,DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxSetArmStartTrigType(m_TaskHandle, DAQmx_Val_DigEdge));
DAQmxErrChk (DAQmxSetDigEdgeArmStartTrigSrc(m_TaskHandle,m_SourceID/* "/Dev1/PFI0"*/));
DAQmxErrChk (DAQmxSetDigEdgeArmStartTrigEdge(m_TaskHandle, DAQmx_Val_Rising));
DAQmxErrChk(DAQmxStartTask(m_TaskHandle))
}
INT32 CDAQCounter::GetCount()
{
uInt32 data = 0;
DAQmxErrChk (DAQmxReadCounterScalarU32(m_TaskHandle,10.0,&data,NULL));
return (INT32)data;
}
I am going to be polling the GetCount() function while I programatically increase an output frequency. When I get back a value, (I should get back a one), that will be the end of the test.