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

counter returns garbage values

$
0
0

I am using cDAQ 9184 and 9401 Digital I/O card,I am using the counters available for frequency measurement(pulses are generated by a hall sensor,whose frequency i want to measure to estimate DC motor speed.But the problem is that counter returns garbage values.I have tested the card and its counters they are working fine.What could be the possible causes of this happening?

attaching a VI snapshot.
Please hep me out at the earliest. :)

Thanks and regards.

 

PID_DCmotor.JPG


i need help in frequency readings‏

$
0
0

Hi,
goodafternoon,
By using the attached file i wanted to read the frequency of the signal " the signal is pulses"
i have done it and record the reading in excel files 
if u check the excel files u will find high values but on the oscilloscope the value for file frequency100 and frequncy101 should be between 430hz to 460hz but in the file it is very high .
can i know what is the problem please ?

i am using cDAQ-9188 with digital input 9401
i connected the signal to pin#14 and the com to the ground of the driver 

Note i have emailed 2 emails before this email and there is no reply since last week, any one can help me in that ?
thanks

How to create timer to delay On/Off

$
0
0

I am currently using the evaluation version of LabView to figure out if LabView is a good choice for an application I would normally use ladder logic for. I am trying to find examples on how to do the following, any advice would be appreciated:

 

-Timer for delaying On condition
-Timer for delaying Off condition
-Counter
-Latching circuit

Counter output internal trigger issue on a 6133

$
0
0

I have a VI whose purpose is to record analog data and produce a TTL pulse at the start of the acquisition. The acquisition is triggered when one of the analog channels reaches a specified level.

The data recording is working properly, but producing the TTL pulse is not. In an early iteration I used the DAQmx Export Signal VI to export the trigger signal, but my other lab equipment does not recognize TTL pulses as short in duration as the NI hardware triggers, so I want to use a Counter Output, triggered by the Analog Comparison Event (the analog trigger for my input channels), to produce a single, longer duration pulse. However, my VI is not triggering the counter.

 

To test, I switched the counter trigger source to an external port, and connected a digital delay generator producing pulses that are 50ns duration. With this external trigger, the counter works properly.

 

Does anyone know why the internal triggering is not working? Any suggestions on a fix?

 

I'm using the following NI hardware.
Chassis:  PXI-1036
Cards:      PXI-6133 (two)

                  PXI-5124 (not used, but available if needed for solution)
 
My VI is attached.

 

 

Any help will be greatly appreciated!

NI PCI 6602 triggered counters

$
0
0

Dear community,

 

I have a general question concerning the possibility regarding the measurement capabilities of the NI PCI 6602. Here is what I need: Data of the form [time,count] with an equidistant time intervall of 1ms. It needs to be synchronized to the actual counts to a very high degree. So CAN I trigger a counter readout which does not vary too much around the desired time mark and stays constant over time? How would I do it? Since this specific card does not seem to have a hardware trigger the only possibilty seems to be a software trigger, but if this is possible, how would I accomplish it (possibly using the Daqmx library)?

 

Thank you very much in advance, 

Kai

How to generate a Single Point (On-Demand) Edge Counting with Pause Trigger

$
0
0

I have problem when creating a Labview program to generate a Single Point (On-Demand) Edge Counting with Pause Trigger shown in FIG 1 below. I only know how to generate edge counter without pause trigger and my program is shown in FIG. 2 and also attached. What change should I make on my program? The DAQ card I am using is PCI/USB 6259.

clock.PNG

FIG1.Single Point (On-Demand) Edge Counting with Pause Trigger

Labivew.PNG

FIG.2 my program to generate Edge Counting without Pause Trigger

 

Frequency/Period measurement with USB-6218

$
0
0

I have been trying to get a USB-6218 to measure either frequency or period and have been running in to issues. I have attempted to connected to each counter gate (PFI1 or PFI2) and have not had any luck. I am attempting to meausre lower-frequency signals (1Hz-1KHz) so the Low-Frequency, 1 counter approach seems to be the one I need. The end goal is to get it working in Labwindows. I have made attempts using both sample LabWindows programs as well as MAX. In each of them, it appears that the frequency measurement is actually coming back with the pulse width of both the low and high portions of the signal. For instance, if I am trying to meausre the period of a 100 Hz signal, with a 75% duty cycle, it will toggle between 0.0075 and 0.0025 seconds for the period. If I increase the frequency of the signal to 10 KHz, it measures the frequency well. Is there something I am missing? Based on the manual, I should be able to meausre lower frequency signals using this method. Any help is greatly appreciated.

 

 

 

Thanks.

NI6321 triggering laser

$
0
0

Hey guys,

 

I have an Agilent signal generator triggering my PCIe 6321 card and an ultrasonic pulser. Furthermore I want also to trigger two other devices (two different lasers).

However, since the signal generator has only 2 outputs, I was wondering if I can control the two lasers via the NI card.

The card has four 32-bit counter/timer outputs and I was hoping I could use these outputs to generate two pulse trains in order to trigger my two lasers.

 

I am quite new to data acquisition, so I am not quite sure if this is possible after all. Also the NI card has to acquire information from a transducer and I am not sure if the card can acquire stuff and generating 2 pulse trains at the same time.

 

Thanks!


Help with Single photon counter (SPCM AQR 15) for fluorescence detection and trigger a solenoid valve by labview

$
0
0

Hi all,

 

Recently I am building a fast fluorescence detection setup with a single photon counter (SPCM AQR 15) and I would like to use the fluoresence signal to trigger a solenoid valve using Labview 2012. I would like to ask:

(1) Do I need a DAQ Card (or even more?) for my hardware communication?

(2) How to monitor the signal real time (if possible?) in labview?

(3) Is there any VIs compatible with the photon counter?

 

Thank you so much and really appreciate for your comments!

 

Matthew

9401, 2 encodeurs and sampling recording

$
0
0

Hello 

I have a NI9401 on a C-DAQ9171. 2 optical encoders are connected to the 9401.

 

My problem is that I want to make an internal timer, in order to be able to record the data with a sampling rate that I can easily change.

 

Thus, I should configure 2 counters for the input corresponding to the 2 encoders, and another counter to make the "internal" clock,  which will allow me to have a valid sampling requency (1000 hz) for example.

 

I have watched many topics about that, but I still don't manage to do that. (I am new to labview..)

 

If anybody could help I would be very gratefull.

 

Sincerely.

 

Jeff 

 

 

semi period measuremen​t with an external clock

$
0
0

Hello

I am trying to make PWM (2ms width) measurement with a counter (PCIe-6363), but with external clk (1MHz) to make 1 measurement (high time/low time) every 100ms

This ext clock is create with another counter.

 

With the code below,  i have the error:

NON-FATAL RUN-TIME ERROR:   "ihm.c", line 100, col 5, thread id 0x000004E0:   Library function error (return value == -200527 [0xfffcf0b1]). Requested values of the Minimum and Maximum properties for the counter channel are not supported for the given type of device.  The values that can be specified for Minimum and Maximum depend on the counter timebase rate. Property: DAQmx_CI_Min Corresponding Value:  100.0e-6  Property: DAQmx_CI_Max Corresponding Value:  5.0e-3  Property: DAQmx_CI_SemiPeriod_Units Corresponding Value: DAQmx_Val_Seconds  Property: DAQmx_CI_CtrTimebaseSrc Corresponding Value: /Dev2/PFI8 Option: 1 Property: DAQmx_CI_CtrTimebaseRate Corresponding Value:  100.0e6 Property: DAQmx_CI_Min Value Must Be Greater Than:  20.0e-9 Property: DAQmx_CI_Max Value Must Be Less Than:  42.949673 Option: 2 Property: DAQmx_CI_CtrTimebaseRate Corresponding Value:  20.0e6 Property: DAQmx_CI_Min Value Must Be Greater Than:  100.000000e-9 Property: DAQmx_CI_Max Value Must Be Less Than:  214.748365 Option: 3 Proper

 

Here is the code:

 

char tcExtClockName [256] = "/Dev2/PFI8";

 

// [ctr1] Create a CO with pulse train triggered by PCO (on PFI2)
 DAQmxErrChk ( DAQmxCreateTask ("TaskPulseTrain", pTaskHandle2))
 DAQmxErrChk ( DAQmxCreateCOPulseChanFreq (*pTaskHandle2, "Dev2/ctr1", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 1.0e6, 0.5))
 DAQmxErrChk ( DAQmxCfgImplicitTiming (*pTaskHandle2, DAQmx_Val_FiniteSamps, 2000))
 DAQmxErrChk ( DAQmxCfgDigEdgeStartTrig (*pTaskHandle2, ACQ_CLOCK, DAQmx_Val_Rising))
 DAQmxErrChk ( DAQmxSetTrigAttribute (*pTaskHandle2, DAQmx_StartTrig_Retriggerable, TRUE))

 
  //DAQmxConnectTerms ("/Dev2/Ctr0Source", "/Dev2/PFI8", DAQmx_Val_DoNotInvertPolarity);


 // [ctr0] Create task measure PWM
 DAQmxErrChk ( DAQmxCreateTask ("TaskMesurePWM", pTaskHandle))
 DAQmxErrChk ( DAQmxCreateCISemiPeriodChan (*pTaskHandle, "Dev2/ctr0", "Demi-période", 0.0001, 0.005, DAQmx_Val_Seconds, ""))
 DAQmxErrChk ( DAQmxCfgImplicitTiming (*pTaskHandle, DAQmx_Val_ContSamps, 100))
 
 DAQmxErrChk (DAQmxGetChanAttribute (*pTaskHandle, "", DAQmx_CI_CtrTimebaseSrc, tcTemp, 256))
 DAQmxGetChanAttribute (*pTaskHandle, "", DAQmx_CI_SemiPeriod_Term, tcTemp, 256);
 
 DAQmxErrChk (DAQmxSetChanAttribute (*pTaskHandle, "", DAQmx_CI_CtrTimebaseSrc, tcExtClockName, sizeof(tcExtClockName)))
 DAQmxErrChk (DAQmxSetChanAttribute (*pTaskHandle, "", DAQmx_CI_CtrTimebaseRate, 1.0e-6, sizeof (double)))
 
 DAQmxErrChk (DAQmxGetChanAttribute (*pTaskHandle, "", DAQmx_CI_CtrTimebaseSrc, tcTemp, 256))
 DAQmxErrChk (DAQmxGetChanAttribute (*pTaskHandle, "", DAQmx_CI_CtrTimebaseRate, &lfRate, sizeof (double)))

 

 

If someone can explain me how to use an external clk for this kind of measurement?

Thanx

 

Need help in NI6602/6259 counting in Matlab

$
0
0

Hi,

 

NI 6259  supposed to be a upgraded version of NI 6602, but why do I got faster count rate with NI 6602

than NI 6259 in Matlab?

In the spec, both cards has the same 80MHz clock/timer frequency and they both acheive 2MHz data acquiring rate in NI Max.

However, the fastest rate I can accuire data is 500 kHz for NI6602/ 30 kHz for NI 6259 in Matlab.  If I try to increase rate and frequency above these numbers, the error message 'Data is overwritten before it can be read by the system...' pops up.   

Could someone please help me to improve the performance of these NI counting cards in matlab?

 

I am using matlab session based interface with the following codes for both cards:

 

% the matlab codes start here

s=daq.createSession('ni');

s.addCounterOutputChannel('Dev1', 'ctr1' ,'PulseGeneration');

s.addCounterInputChannel('Dev1', 'ctr0' ,'EdgeCount');

s.addClockConnection('External', 'Dev1/PFI9', 'ScanClock');

s.Rate=500000;  s.Frequency=500000;

data=s.StartForeground();

% the end of the matlab codes

 

 

 

 

9401 clock source for angle measurement

$
0
0

Hello 

I have a NI9401 on a C-DAQ9178 on slot 5. One encounter is connected to the 9401 and i created a task for the angular position measurement.

 

My problem is that I want to have continuous samples but I din't get the right clock source, so only 1 sample on demand works currently.

Does anyone have an idea how to configure the clock source?

 

Thank you very much in advance, 

Martin

Requesting help with timing of data acquisition

$
0
0

The part of the code that I need help with consists of two main sections. The two sections are inside the same frame of a flat sequence structure. The bottom part is responsible for creating a pulse from NI-9263. 

The top part starts data acqusition for Voltage and temperature. The current set up causes the data acquisition to start simultaneously with the Pulse creation. I want to add a delay between the time when the pulse first starts and when data acquisition begins. For example, if I create a pulse for 150 seconds, I want to start the data acquisition at 100seconds so I will be taking data for 50 seconds instead of 150.  Any suggestions on how to time the data acqusition? 

 

Here's a list of the National instruments hardware  at my disposal: 

 

1. c-DAQ 9174

2. NI-9205

3. NI-9211

4. NI-9263

 

Please check the attached file for more information. 

Thanks!

Continuous Buffered Edge Counting with the NI PCI 6602 using multiple counters

$
0
0

Dear Community,

 

I am new to the DAQmx developement and I have a basic problem which raises some questions. The situation is quite simple: I want to perform, as indicated, a continuous buffered edge counting using multiple counters. I have read some documentation and from what I am given to understand there are some subtleties involved. 

 

I started with the "Count Digital Events-Buffered-Continuous-Ext Clk.vi", which is provided by NI. Here is my first question: I get the "data was overwritten before it could be read by the system", using the VI without modification. What are the possible sources of this error? I am given to understand that there is a limit to this, this limit seems to depend on how fast you can read out the so called FIFO buffer, and that this is limited by the number of counters you use. Is there any specific documentation or some example VIs who address this kind of problem? If I could get my hand on information on how exactly the buffer readout process works and how it changes when you employ different kinds of read out situations occur I would be helped a lot.

 

Thank you in advance!

 

Cheers Kai


get date

$
0
0

Good evening to all,
I want to create a table that contains dates that I record every click
The problem is that I got to record a single value
Help me please
Here attached the vi

Stacking Output Delays

$
0
0

Hi All,

I'm having some problems implementing a delay for an output signal on FPGA.

Basically I need my code to respond to signals with a delay, but during that delay it should still be able to respond to the next signal with the same delay time. However, right now if the pulse is called with the delay that loop is ignoring the next calls to it.

I've attached a diagram of my signals and desired output to illustrate my problem. I've also included a simplification of my code as vi and png.

I've tried to dynamically change the delay time based on if the pulse loop is active, but that doesn't seem to work (not in attached vi).

I'm now thinking that 'wait' might not be the way to go and that I should implement an array with timestamps. The pulse loop would read the earliest array element and execute the pulse generator when timestamp + delay == current time.

I would appreciate your thoughts on this. Any ways to implement this better?
Thanks a lot in advance!

I am new in labview , I want to measure angular position of rotating shafts , I have two encoder NI card 9401 and connection

$
0
0

I am new in labview , I want to measure angular position of rotating shafts in same time  , I have two encoder NI card 9401 and  all connection 

angular position measurement

$
0
0

how to used encoders to angular position measurement of rotating shafts 

 

FPGA dynamically changing array problem

$
0
0

Hi All,

In a continuation of a problem posted earlier (same project, new problem), I'm using an array as a storage of 'time stamps'. Basically, elements get added to the array when a signal is detected and the oldest element gets compared to the current time + delay and removed after further action is initiated in the next loop. (see attached vi for a full simplified program and the png for the relevant array section).

I don't know the size of the array beforehand, but I doubt it would ever even fill up more than 5 elements at a time. However, even when I set my array as fixed with a certain length and I check the 'Autopreallocate arrays and strings' checkbox, I'm still getting "Arrays must be fixed size in current target' errors.

What am I doing wrong? From reading the documentation it sounds like I should be allowed to use build array and delete from array when using a fixed length array and constants.

Thanks a lot for your help!

 

Viewing all 1271 articles
Browse latest View live


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