Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Time out even though a measurement is made for pulse width

Hello,

 

I have a system with Windows 10 and PXI-6229. I am trying to make a pulse measurement. A very simple one. My signal goes up to 5 V for 300-600 ms and drops to 0. I was getting a time out in my code so I set up a task in data neighborhood. When I run my task it returns a value, I can see it in the upper section of the screen but still times out and pops up a message box with an error. My acquisition sample is set up to "1 sample".

Thanks 

J.

0 Kudos
Message 1 of 24
(4,350 Views)

Hi Cimteker, 

 

Whats the error you are receiving?

 

Check the M series Manual for more information about counter funtions. 

 

http://www.ni.com/pdf/manuals/371022l.pdf

0 Kudos
Message 2 of 24
(4,309 Views)

I can't see enough about the MAX config to say much with confidence.  I do notice a mismatch between your Max/Min values and units -- there's no such thing as fractional "Ticks" for counting.  The count value you get is almost 1 million, so it *does* appear to be measuring in Ticks units.  But those million ticks would still (likely) represent only about 12 msec, not 300-600.  (Odds are the board uses its max timebase of 80 MHz for the measurement.  A million cycles takes 1/80th sec.)

 

Try a shipping example for pulse width measurement and see if you get better results.  Or post your original code (if necessary, "save for previous version" to LV 2016 or earlier please) and I can try to make sense of the timeout problem.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 24
(4,306 Views)

This is the error I am receiving:

 

Error -200474 occurred at DAQ Assistant

Possible Reason(s):

Specified operation did not complete, because the specified timeout expired.

0 Kudos
Message 4 of 24
(4,303 Views)

I must have played with units. Originally it was set to seconds.

Another screen attached. This time it reads what it looks like 400 ms and still generates an error.

 

0 Kudos
Message 5 of 24
(4,302 Views)

This is my code. It's in Python.

 

try:
taskHandle = OnStart.hNiDaq.CreateTask("myTask")

channel = "PXI_6229/ctr0"

minVal = 0.01
maxVal = 2.0
startEdge = OnStart.hNiDaq.CONST.DAQmx_Val_Rising

OnStart.hNiDaq.CreateCIPulseWidthChan(taskHandle, channel, "",
minVal, maxVal, OnStart.hNiDaq.CONST.DAQmx_Val_Seconds, startEdge, "")
OnStart.hNiDaq.SetCIPulseWidthTerm(taskHandle, channel, "PFI0")

OnStart.hNiDaq.StartTask(taskHandle)

time.sleep( 0.25 )
IO.setOutput("Nest1/LIInput")

pwidth = OnStart.hNiDaq.ReadCounterScalarF64(taskHandle,5.0)
my.testResult.value = pwidth

except Exception, e:
RDX.printError( e.message)
finally:
if(taskHandle != None):
OnStart.hNiDaq.StopTask(taskHandle)
OnStart.hNiDaq.ClearTask(taskHandle)

 

0 Kudos
Message 6 of 24
(4,300 Views)

<