Quantcast
Channel: Counter/Timer topics
Viewing all 1271 articles
Browse latest View live

Photon counting using R series FPGA. Problem generating TTL signals

$
0
0

Greetings,

 

I'm trying to use NI R series FPGA to read and count the TTL pulses from a discriminator (Hamamatsu C9744 photon counting unit) connected to a PMT (Hamamatsu H7422P-40). The output from PMT looks fine (H7422P-40 signal.png) but the discriminator was not able to generate corresponding 5V TTL pulses. There were some sparse and random spikes but nothing meaningful. Instead, the only stable signal from the PMT was a single +5V pulse no matter how I adjusted the control voltage of the PMT (C9744 output.png). The PMT and the discriminator is connected by a regular 50 ohm BNC cable.

 

I'm really puzzled because it was supposed to be a really simple setup. Did anyone have similar issue or have the similar instrumentation setup (but without issue)? Any comments/suggestions are greatly appreciated.

 

Thanks very much in advance!

 

 

 

 

 


10MhzRefClock as Trigger

$
0
0

Hello

I'm using a NI-USB 6343 device. I was able to generate 2 TTL signal with one is delayed from the other. 

 

I'm using 10MHzRefClock as trigger. It seems to work.

 

Is it the right way to do so? (i.e. generate an internal trigger event?)

 

Thanks for any inisght! 

How to use the counter present on cDAQ 9174 through the digital output module NI 9472

$
0
0

Hello,

 

I have a cDAQ 9174, which I believe has 4 counters on it, I need to generate a pulse train (0-5V) using the cDAQ and digital output module NI 9472. Is this possible? And how do I do it? The pulse train will then be sent to a relay switch.

 

Thanks

Minimum pulse width detectable counting with USB-6210

$
0
0

Hi,

Can anyone tell me which is the minimum width of a pulse at a digital input that the counter of an USB-6210 module can count?

The specs sheet only talks about the debouncing filter, which has a minimum setting of 125 ns. However, this filter can be disabled. How long does the pulse has to be in order to be detected (counted)?

For example in the NI6602, this time is 5ns without prescaling.

Any help will be appreciated

Regards,

Miguel

Counter timing issues

$
0
0

Hello!

I am using an NI USB-6001 to calculate the speed of a moving wire. 

The wire rotates a wheel with a known diameter and an inductive sensor pulses 4 times each rotation when it detects holes evenly spaced around the wheel. 

The sensor output is connected to the P2.0/PFI 0 input. 

I use a counter function The Daqmx U32 single channel single sample. Each time the aquisition loop runs I use a get time in seconds function to timestamp the aquisition.

Aqquire.PNG

 

I calculate the speed in a paralelle loop by subtracting the timestamps taken from the 2 newest counter increments. 

CalcSpeed.PNG

 

The program also does other tasks such as monitoring other inputs and uppdating outputs. It also collects values in an array and writes an excel report when data gathering has ended. 

 

When the wire was pulled by a machine at a relatively constant speed I noticed spikes in the graph for the wire speed. 

 

Wire speed.PNG

 

I suspected there was a hardware fault so I made a pulse generator from a PLC and connected it to the counter input and got the same results. 

Now I suspect there is a timing issue or it has something to do with OS scheduling and labview priority. This is running on a windows 8 laptop.

 

Any ideas?

 

large frequency readings using the DAQ Express VI: Counter

$
0
0

I am currently using a 6341 DAQ and trying to read a speed signal from an electric motor (5 vdc square wave) using the DAQ assistant express VI.  I can read the correct frequency of the square wave, but periodically get a reading of a million or more for the frequency.   Given the fact that the 6341 can only sample at 500 k Hz, i know that frequency cant be real.  The signal on an external O-scope shows the signal to be fairly clean.

 

Does anyone know why i may be getting the high frequency readings?  and at what voltage does the counter trigger at, when counting the voltage rise of each wave?

 

Thanks

Erik

 

Help to implement simultaneous 3 counters on PCI 6602

$
0
0

Hi,

I have a problem and need your advices.

Currently, I am using Pci 6602 board with labview and I can use 2 counters simultaneously.

However, when I add one more DAQmx task with one more counter, all the counters do not work.

Some people suggested me to use interrupt to configure the DAQmx task, I tried it but I was fail.

Anyone can give me the suggestion in this case ? Whether possible to use 3 counters simultaneously with  NI Pci 6602 ?

Buffered pulse train generation with cDAQ-9181 and NI 9474

$
0
0

Hi,

I would like ask, is it possible to make a buffered pulse train generation application using cDAQ-9181 and NI 9474 as hardware?

 

I have an application, in which  approx. 18 bits are generated, with pulse width of ech bit varying approx. 300...500 us range. One microsecond resolution (at least 10 us) would be needed to adjust pulse width. According to specifications, NI 9474 should be capable to do it. The withd of the pulse high and low states should be varied independently. An example of the situation is shown in the figure below (figure was taken from daqmx help, Buffered Pulse Generation).

 

Buffered Pulse Generation figure.png

 

 

Is there some kind of software buffer in cDAQ-9181 orNI 9474, which could be utilized to first load this "waveform data" to DAQ memory, and the trigger it to execute to needed pulse pattern?

Do I have to use "Ready for new value"-propery to update pulse parameters on fly? I tried already this, but the result was not succesful.

Daqmx-help also mentions the use of two counters in some cases. Is this a potential solution for my case?

 

By this far, I have been succesful to produce single finite pulse (based on "Gen Dig Pulse Train-Finite.vi" LabView example in Generating digital pulses gategory) or series of identical pulses.

 

Best Regards,

Jukka

 


Generating arbitrary pulses with PXI-6602

$
0
0

Hi everyone!

 

I have a problem generating pulses with the PXI-6602. What I need is a sequence of pulses that appear for example at t0=0, t1=1ms, t2=5ms, t3=100ms and loop after 1000ms.

 

As far as I understood the NI-DAQmx-functions and -examples, I should be able to achieve this with the "DAQmxWriteCtrTime(...)" / "DAQmxWriteCtrFreq(...)" / "DAQmxWriteCtrTicks(...)" functions, as used in the example "DigPulseTrain-Cont-Buff-Implicit".

 

The problem is: When I try to run this example as it is on my PXIe-1075 chassis with the PXIe-8135 controller and the PXI-6602 in Slot 2, I get an error saying that I have to start the task before calling the write-function (see screenshot).

DAQmxError.PNG

 

So I copied the line with the "DAQmxWriteCtrFreq(...)"-function below the "DAQmxErrChk (DAQmxStartTask(taskHandle));"-line. Now the program is running, but on the oscilloscope I see that it just repeats the same puls over and over and does not change the ratio as it should do. Looking at the output of the write-function I can see that only one sample was written to the buffer, instead of 1000 samples which I expected.

 

When I tried to google the problem, I found these two threads, which seem at least related to my issue.

https://forums.ni.com/t5/Counter-Timer/buffered-counter-output-in-C/td-p/2791758

http://forums.ni.com/t5/Multifunction-DAQ/Auto-Start-DAQmx-task-functionality/td-p/456366

In the first discussion it is mentioned to use the write-function before starting the task, in the second it says to simply start the task before writing to the buffer.

 

I am using Labwindows/CVI 2009 on Win7 64bit. Maybe someone has an idea, what I did wrong or how to fix the problem.

 

Thank you very much in advance!

Best regards,

Christof

NI PXIe-6612 Quadrature Encoder Setup

$
0
0

I plan to use a NI PXIe-6612 and count up to 8 linear quadrature encoder sensors.  

 

I've determined that quadratures use the Gate, Source and Aux counter I/O.  I would like to know if I can se the Out counter I/O as a static digitial input/output with using the same counter for quadrature encoder sensing.  

 

Here is an example.  

 

I connect my quadrature encoder to Counter 1 Gate, Source and Aux connections.  Can I use Counter 1 Out connection as a statis digital I/O?

 

I plan to use P0.0 to P0.7 as digital outputs and need to use the counter OUT connections for digital inputs.  

 

Thanks,

 

ADam

How many quadrature encoders can be read simultaneously with the cDAQ-9188 chassis?

$
0
0

We may need to record position periodically of 8 motors (at the same time that we sample corresponding analog inputs).  It looks like the 4 built-in counters limits the chassis to 4 encoders.  Is this correct?  I am familiar with PLC counter modules that handle the high-speed counting, and then the CPU periodically poles for an update of the total counts.  Is this how the NI 9401 card would work?

6120 double counter generation and routing through backplane

$
0
0

Hello everybody,

 

I would like to use NI6120 (in PXI 1045 chassis) to generate double counters (counter 0 and counter1). I am using .NET platform. For each counter generation, I create a task, then here is the following code:

 

Task_For_DAQ1_Cnt0.COChannels.CreatePulseChannelTicks(GetDeviceMap.DaqOne + "/ctr0", "daq1cnt0", "/" + GetDeviceMap.DaqOne + "/PXI_Trig2", COPulseIdleState.Low, 0, low_ticks, high_ticks);

Task_For_DAQ1_Cnt0.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples);

Task_For_DAQ1_Cnt0.ExportSignals.ExportHardwareSignal(ExportSignal.CounterOutputEvent, "/" + GetDeviceMap.DaqOne + "/PXI_Trig0");

 

Task_For_DAQ1_Cnt1.COChannels.CreatePulseChannelTicks(GetDeviceMap.DaqOne + "/ctr1", "daq1cnt1", "/" + GetDeviceMap.DaqOne + "/PXI_Trig2", COPulseIdleState.Low, 0, low_ticks/2, high_ticks/2);

Task_For_DAQ1_Cnt1.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples);

Task_For_DAQ1_Cnt1.ExportSignals.ExportHardwareSignal(ExportSignal.CounterOutputEvent, "/" + GetDeviceMap.DaqOne + "/PXI_Trig1");

 

 

If i start tasks running, second task throw the following exception (first one runs fine, and see the signal coming out - NI6124 (in PXIe 1065 chassis) have no problem by double clock generation and routing)

 

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: NationalInstruments.DAQmx.COChannel.PulseTerminal
Destination Device: DAC1
Destination Terminal: PXI_Trig1

Required Resources in Use by
Task Name: _unnamedTask<4>
Source Device: DAC1
Source Terminal: Low
Destination Device: DAC1
Destination Terminal: Ctr0Gate

Task Name: _unnamedTask<5>

Status Code: -89137

 

 

Please help me out to solve this problem. When I create tasks on NI-MAX, double clock generation is OK, but can't route them on the backplane.

 

PWM Acquisition at same rate

$
0
0

Hello All,

 

I am currently trying to read continuously a PWM using the counter input of a NI USB-6361.

 

The PWM has a frequency of 1kHz, therefore I should read a sample every 1ms. Unfortunately, the loop take about 3-4ms to execute which means I lose about 75% of my data. I wonder what I should do to acquire my PWM once every 1ms.

 

A simple VI of how I acquire my data looks like this:DAQ PWM.PNG

 

I tried adding this DAQ function:DAQ CLK.PNGbut every time I do I get different errors like the clock is too fast or I try to acquire a sample before it is ready etc..

 

Any help would be greatly appreciated because I know the card is fast enough to aquire at 1kHz and I am just wasting its potential right now.

 

Sincerely,

Cynthia

6602 PCI

$
0
0

Hello Everyone, I am no expert in the field of electronics.

I have his older model 6602-PCI timer-counter (it was puschased back in 2001) for the fast multi-tau real-time correlator PCS (Photon Correlation Spectroscopy) DLS (Dynamic Light Scattering) application.

 

To upgrade the equipment, I need help from you to choose NEWER version(s) that can function the same but faster.

Thank you very much in advance for your support and comments.

 

Two independent but synchronized pulse outputs

$
0
0

Hi everyone,

 

I have a NI cDAQ-9174 with a NI9401 card (4 counters, 8 DIOs). I want to do the following:

 

I want to have two pulse outputs on different terminals, both completely adjustable (i want to set pulse widths and delays independently for both of the pulses) but the timing between these two should be well defined, as in the jitter should be as small as possible. I managed to get two independent output pulses with the attached VI but the timing unstability is within 1 ms or so which is too much for my purpose. Might be a stupid question but I'm new to this DAQ stuff and couldn't really find an answer here. Is it smarter to combine the two to one task maybe?

 

Thanks,

 

Nico

 vi.png


how to connect four counters via SC-2345 terminal block

$
0
0

Given

  • USB-6361 mass-termination DAQ (spec sheet)
  • SC-2345 carrier (manual)
  • 2 counter inputs: 2 X4 rotary encoders
  • 2 counter outputs: 2 PWM signals that modulate power from benchtop power supply to electromagnets

I've connected 1 encoder and 2 PWM signals to my DAQ via the carrier's terminal block (see diagram on page 28 of carrier PDF).

The encoder requires A, B, Z, 5V, and GND terminals, while each PWM output requires a "signal" line and GND.

  1. encoder 1:
    Device A - sc terminal A37/PFI 8 - DAQ PFI 8/ CTR0 A
    Device B - sc terminal C45/PFI 10 - DAQ PFI 10/CTR0 B
    Device Z - sc terminal C3/PFI 9 - DAQ PFI 9/CTR0 Z
  2. PWM 1
    signal - sc  terminal C40/PFI 13 - DAQ PFI 13/CTR1 OUT
  3. PWM 2
    signal - sc terminal A1/PFI 14 - DAQ PFI 13/CTR2 OUT

Power and ground are connected to the single power and multiple ground terminals in the carrier.

 

Problem

I need to connect another rotary encoder. I tried shifting my setup to the following configuration:

encoder 1 = CTR 0, encoder 2 = CTR 1, PWM 1 = CTR 2, PWM 2 = CTR 3

 

  1. encoder 1:
    Device A - sc terminal A37/PFI 8 - DAQ PFI 8/ CTR0 A
    Device B - sc terminal C45/PFI 10 - DAQ PFI 10/CTR0 B
    Device Z - sc terminal C3/PFI 9 - DAQ PFI 9/CTR0 Z
  2. econder 2:
    Device A - sc terminal C42/PFI 3 - DAQ PFI 3/ CTR1 A
    Device B - sc terminal C46/PFI 11 - DAQ PFI 11/CTR1 B
    Device Z - sc terminal C41/PFI 4 - DAQ PFI 4/CTR1 Z
  3. PWM 1
    signal - sc  terminal A1/PFI 14 - DAQ PFI 14/CTR2 OUT
  4. PWM 2
    signal - sc terminal ???/PFI 15 - DAQ PFI 15/CTR3 OUT

 

But the carrier's terminal block doesn't have any additional counter I/O terminals. What can I do? 

  • Is there any easy way to reconfigure one of the unused carrier terminals into PFI 15/CTR 3 OUT?
  • Should I use one of the carrier's analog or digital I/O for counter I/O?
    A cursory internet  search reveals that this is possible and discouraged for PWM control of power supplies (which is what I'm doing), so I'd use this for encoder input.
  • If I have to resort to modifying analog or digital I/O for counter I/O, what would you recommend--analog or digital?
    I'm thinking I'd use a software-timed digital input. Is this correct?

 

I'd appreciate any and all insight!

 

-Farid

 

Attached: picture of all instrument pin-outs

Semi-Period Measurement with 3 synchronously starting Counters

$
0
0

Hello Everybody,

 

I am a very Beginner to the NI DAQ Cards.

I use X Series Cards and want to programm it in C.

 

My Problem:

 

I need to measure the Changes of three Digital Pulse Signalsover Time , very important is the Phase Shift of the three Pulse Signals to each other.

 

For that Reason I use 3 Counters connected with the 100 MHz internal Clock as Clock Source.

The three Gates are connected with three PFI Inputs.

I configure the three Counters for Implicit Buffered Semi Period Measurement.

That is, the Measurement starts with Arming the Counters.

The First Starting Egde of the three Counters is set depending on the current ( when Arming ) Level of the respective Signals to measure the Duration between Arming and the next Edge.

 

After the Measurement has finished, the three Signals are processed considering the Phase of the Signals to each other.

 

 

Now my Question:  How can I let start the three Counters simultaneously ?

 

Is it possible to enable / disable the Clock Source of the three Counters simultaneously ?

 

Could I use another Counter, which outputs a 20 MHz or 100 MHz Clock as Clock Source for the three Counters ?

 

Extending the Number of Signals to 5 will require to use 2 DAQ Cards.

 

Can the Counterstart be synchronized via RTSI Bus in this Case ?

 

Is there any C Code Example how to implement Synchronization of the Counterstart ?

 

 

Many Thanks for Your Help !

Kind Regards

 

 

 

How to synchronize 2 Counter tasks in .Net

$
0
0
I create 2 Counter tasks to measure the same square wave signal in c#. Task 1 will measure the signal's semi-peroid, sample size 20 and start at rising edge. Task 2 will measure the signal's peroid, sample size 10 and start at rising edge. I want the 2 tasks start at the same rising edge. If that, the each peroid result of task2 will equal to the sum of each 2 semi-peroid results of task1. So, how to set the 2 tasks start at the same rising edge in c#? Or, should I put the 2 measurements in one task? Regards, Daniel

while loop inside control & simulation loop

$
0
0

Hi all,

 

I have a problem when using while loop inside mathscipt used inside control & simulation loop.

 

I want to read a excel cell each 5 seconds and to do it I'm using matlab scrip to know when I have to change cell.

 

My inputs on mathscipt are: run_time and sim_time. 1st one is the running time from control & simulation loop and 2nd is the time of each simulation.

My output is cell to go to the VI excel reader.

 

So, to do it I'm using a while loop like this:

 

cell=H1;                                       % starting on excel cell H1

count=1;                                       % creating and starting counter variable

h=5;                                               % creating and starting second counter

 

while run_time < sim_time do   % while loop: do it until reach simulation time.

 

if run_time ==h                             % compare running time with next 5 second (5,10,15,20,...)

count = count +1;                         % increase counter for next 5sec

h=h*count;                                     % to compare on "if" next loop (5+5, 10+5, 15+5,....)

cell=strcat('H',int2str(count));     % put on ouput next cell: H2,H3...

end

 

end

 

But, when I used while loop it doesn't do nothing. My code is working without while loop, but it only does 2 cells. I want more than that.

 

Is there anyone can help me with it? another way to do it?

 

Thanks in advance.

 

Regards.

Marco

Pulse Measurement with PXI-6624

$
0
0

My PXI-6624 works with PXIe-8135. I want to measure a PWM both frequency and duty cycle. I set up the select measurement type is "Pulse Measurement" in System Explorer. Once I deploy it, I got an error code " -200431":

 

"Selected physical channel does not support the measurement type required by the virtual channel you are creating."

"Create a channel of a measurement type that is supported by the physical channel, or select a physical channel that supports the measurement type."

 

Can this card work in "Pulse Measurement" type? How can I test both frequency and duty cycle of a PWM? Is there some add-on custom device that I can download and use?

Viewing all 1271 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>