06-21-2006 01:34 AM
06-21-2006 04:48 PM
Hello NguaHoanUSA,
When doing this type of measurement you need to have your signal connected to
the gate of the counter. If you are missing your pulses and getting
errors, can you confirm that your signal is a TTL signal? The counters
are designed to count only TTL pulses. This type of error could be caused by a non TTL or noisy signal. To test your counters and your application
you can generating a pulse train on counter 0 and read that pulse's
frequency on counter 1. You can generate the pulse train through the test
panel for your device found in Measurement and Automation Explorer (MAX) or
through the DAQ Assistant. You can find
test panels in MAX by expanding Devices and Interfaces >> NI-DAQmx
Devices then selecting your device.
06-22-2006 01:36 AM
hi Jesse:
I would like to thank you for your advice. I am lucky and i solved this problem. It is very interesting. Now, I try to measure the duty cycle of pulse width modulation (analog signal) with DAQ 6016 OEM and labview 8.0. Could you please help me out how to do it?
Thank you for your help and have a good night.
Hoang
06-22-2006 10:10 AM
06-22-2006 10:11 AM
06-22-2006 10:48 PM
06-23-2006 05:35 PM - edited 06-23-2006 05:35 PM
Hello Hoang,
I have taken a look at your code, cleaned some of it up and removed a lot of
it. From the code you attached, I do not know exactly where the error is
coming from, but I assume that it came from the DAQmx Express VI that is
reading your data. To check this I have modified your code. Can you
please download it, and run it. You may need to change the Express VI to
meet your hardware setup.
This error typically means that your task has timed out before you were able to
acquire all the samples you specified. An online Knowledge
Base found here
discusses this. If you are still having problems can you give more
information about what is happening? For example, what loop iteration do
you receive the error and do you get the same error if you increase your time
out or increase/decrease your sampling rate.
If the problem is not with your analog input can you explain where it
is?
On a side note, you do not need to place a DAQmx Start Task and a DAQmx Stop Task after a DAQmx Express VI. Placing these VIs in your code after an Express VI do not help since by the time that code is executed the task has already been ran and the data has been collected.
Regards,
Jesse O.
Applications Engineering
National Instruments
Message Edited by Jesse O on 06-23-2006 05:36 PM