08-20-2012 09:00 AM
Hello,
I have a PCIe-6602 and I wish to measure the edge speration of two quadrature wave forms from an rotary encoder. Example: I watch for a transition of channel A. This transistion is can be either positive or negitive going edge. On the transistion the timer starts and then stops when the other channel, channel B sees a positive or negative transition. This delta is the time that I am interestined in and that needs top be captured.
Thanks for help,
Mike Walczak
08-21-2012 10:50 AM
Hello Mike,
You can just use the Meas Two Edge Separation.vi from the Example Finder (Help » Find Examples » Hardware Input & Output » DAQmx »Counter Measurements »Two-Signal Edge-Separation) Just put a DAQmx channel property node to specify what channels you are going to use as inputs.
11-26-2012 08:18 PM
Hi, I am having some problems with Two Edge Separation method, and I use .Net exmple from DAQmx.
The problem is that I wanna measure following two signals separations.Separation between two raising edges is 52ms.
However, when I measure it using .Net example. I get Time out error or inaccurate values.
I used following setting to measure it. Another problem is that the acquisition Data changed if I changed Maximum Value and Minimum Value.
For example,
There are other timing signals to measure as well. The edge separation for other signals are 10ms, 12ms and 112ms.
I can only measure accurately for 112ms Timing Signals using .Net example
.
I tested 112ms Timing Signals at other CTR channels and it showed accruate values too.
Please advise me for that problem. Thank You.
Yan
11-27-2012 01:24 PM
Hello Yan,
I tried out the Measure 2 Edge Separation example from the .NET 4.0 folder, and it worked just fine for me, as expected. I tried to read in two counters, and set up a delay of 52 ms for each counter pulse.
11-27-2012 08:52 PM
Hi Daniel,
Thank you for your reply.
I don't know what is wrong with input signals for 52ms separations. However I can still get the correct input waveform on Oscilloscope.
11-28-2012 02:43 PM
Hello Yan,
myTask= new Task();
myTask.CIChannels.CreateTwoEdgeSeparationChannel(
counterComboBox.Text,"",
Convert.ToDouble(minimumTextBox.Text),
Convert.ToDouble(maximumTextBox.Text),
firstEdge, secondEdge, CITwoEdgeSeparationUnits.Seconds);
//Set the counter input channel as an Internal Counter of my pulse output channels
myTask.CIChannels.All.TwoEdgeSeparationFirstTerminal = "/XSeries/Ctr0InternalOutput";
myTask.CIChannels.All.TwoEdgeSeparationSecondTerminal = "/XSeries/Ctr1InternalOutput";
counterInReader = new CounterReader(myTask.Stream);
double data = counterInReader.ReadSingleSampleDouble();
11-28-2012 04:15 PM
Hello Yan,
I discussed your issue with Daniel. We believe this could be a possible RMA. Could you please do some further testing and see if only the signals near the range of 52 ms are the inaccurate ones. If so, then I would recommend calling to NI support and creating a service request for RMA. You will be transferred to one of our applications engineers for further troubleshooting and processing. It sounds as if the timebase parameter for this range is damaged.
Best Regards,
Alina M
11-29-2012 03:56 AM
Hi Daniel and Alina,
I modified the program according to your example program as shown in attached program. However, I don't know which value to set for parameter values (Physical Channel,min and max value range, First Edge, Second Edge).
I also measured internal Time Base as you suggested. There is no edge source option for 100kHz to select. Below images are results for 80MHz and 20MHz when I run it for 10sec.
Is there a way to generate signal of 52ms puls width because I don't have DC source with me to generate it.
Thank you.
Yan
11-29-2012 11:46 AM - edited 11-29-2012 11:46 AM
Hello Yan,
In my example, I used CTR3 as my Physical Channel, but you can use any counter you want, as long as it is not the counter you are generating your signal from. You can use the combo box default parameters for min and max range (1E-7 and 0.1, respectively). For the first and second edges you can select rising edge.
It seems as the 80 MHz and 20 MHz timebases are working fine, but I’m not that sure on the 100 KHz one, though. According to this KB, if you select a min and max value that are high enough, DAQmx selects different timebases. However, we can force DAQmx to use a specific timebase. Use the “MeasPulseWidth” example and insert the following line before your task starts.
myTask.CIChannels.All.CounterTimebaseSource = "/XSeries/100kHzTimebase";
Regarding the 52 ms generation pulse, use the GenDigPulse example (Programs » National Instruments » NI-DAQ » Text-Based Code Support » .Net4.0 Examples.
12-13-2012 12:43 PM
Hi,
I am trying to measure two edge separation between two square waves separated by 10 milli seconds. I am using external source connected to PFI 39.
myTask.CIChannels.All.CounterTimebaseSource = "/Dev1/PFI39";
myTask.CIChannels.All.CounterTimebaseRate = 60000000;
CIChannel cChannel = myTask.CIChannels.CreateTwoEdgeSeparationChannel(
counterComboBox.Text,"",
Convert.ToDouble(minimumTextBox.Text),
Convert.ToDouble(maximumTextBox.Text),
firstEdge, secondEdge, CITwoEdgeSeparationUnits.Seconds);
I am getting the following values when i use seconds to measure
12/13/2012 10:23:05 AM,3.3333833333333334 milli secs
12/13/2012 10:23:06 AM,3.3333833333333334 milli secs
12/13/2012 10:23:07 AM,3.3333833333333334 milli secs
I am getting the following values when i use ticks to measure
12/13/2012 10:23:37 AM,200001000
12/13/2012 10:23:38 AM,200002000
12/13/2012 10:23:39 AM,200004000
12/13/2012 10:23:40 AM,200002000
Can you tell me the value should be around 10 ms, why i am getting 3.333xxx as the value?
My setup is simple i have two inputs connected to PFI 37 and 38 seperated by 10ms and external source connected to PFI 39?
Thanks