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

gated two edge counter -200452 error

$
0
0

Hello Forum,

                         As I wrote earlier, I am trying to implement a two edge separation measurement that could be gated. In an updated version of an earlier program, I tried to use the pause trigger property node. However, I can't get it to work and keep recieving a -200452 error. Can anybody at least explain what is wrong the program (attached).

 

Regards,

                 RL


Reading in MAX but not LabVIEW

$
0
0

Hello,

 

I have a very difficult problem reading four counters from a NI 9401. In MAX they read just fine but in LabVIEW they read zero. I browsed the internet and the discussion boards and cannot find anything on this. Please forgive me if this is a simple thing to fix. Im attaching two png that shows where I'm reading the counters and a picture of my task. I know that the whole VI would work better but Im not posting my whole project.  I fixed it where some forum posts I found said having it this way is better. Any help would be great. If you need a certain thing just let me know.

 

Regards,

 

caleb1993

 

ni 6008 wrong counts

$
0
0

I use a ni 6008 device, to count TTL-Signalls from a descrete particle counter.

99% of the time, the ni 6008 counts are correct and the same as the particle counter, but sometimes I receive wrong counts from the ni6008.

The NI 6008 counts much more events, than the particle counter.

 

I suspect static electricity as a cause. The particle counter ist conected to the mains, the laptop works on batterie. the line between particle counter

and the NI 6008 is shielded.

 

Is there a solution for my problem?

 

Thank You

 

Jochen

I need to use NI9481 as 4 channel counter with 2ms On time and 2ms Off time. As per specification in manual it is given 1 cycles / Second. Is it possible used this NI9481 RO module as Counter Output for very low period of 2 ms?

$
0
0

Default On Time is 10ms and Off time is 10 ms.

Analog triggered counter

$
0
0

Hello,

 

I am attempting to use analog edge detection to increment a counter, which I will then read from at a regular interval. I keep hitting brick walls when trying to run/adapt the examples on NI's site. 

 

I'm using a cDAQ-9174 chassis and a NI9223 analog input card with LabVIEW 2014 SP1. 

 

Any suggestions would be greatly appreciated. 

 

Thanks,

 

Emach

Error -200684 Duty Cycle not valid on any value

$
0
0

I'm using the LabWindows CVI DAQmx Library to write a counter frequency using DAQmxWriteCtrFreq
If it matters, im using LabWindows 2013 ds2 and DAQmx 9.7.5
Im using a PCI-6602 simulated in MAX.
I have a task containing 4 Channels named Freq_Out.
I have an array of frequency values named Freq_Data containing {0.1,1,0.1,5120}
I am using a duty cycle of 0.5.
This returns an error code -200684, which states that the duty cycle is invalid. However i have tried this with many different values across the range 0  - 0.99 and this appears no matter the value.

Any help or advice would be apreciated.

Error -200141 encountered while counting edges using a PCI 6251 device using an external clock

$
0
0

Hi,

 

I have a NI PCI-6251 device. I have created a counter input edge-count task. I receive the following error when I try to sample at 300,000Hz with an external clock:

 

Error -200141 occurred at DAQ Assistant
Possible Reason(s):
Data was overwritten before it could be read by the system.
If Data Transfer Mechanism is Interrupts, try using DMA or USB Bulk. Otherwise, divide the input signal before taking the measurement.

 

Providing an external clock from a function generator does not help resolve this. Sometimes I see this at 270,000Hz. My experiment was conducted on NI-Max. Here are the steps I followed:

1) Create a task. Select the "Acquire Signals" drop down, then under "Counter Input" select "Edge Count". 

2) Select the NI PCI-6251 device. 

3) In the configuration tab's Timing settings, set the Acquisition Mode to "Continuous Samples" and set the rate to 270k. 

4) Click on the "Advanced Timing" tab.

5) Set the external clock source to the correct terminal. 

6) Click "Run"

 

The error shows up in a pop up window. Please note that this experiment was performed on a real device and the behavior isn't reproducible on a simulated device.

 

Please let me know what is the correct setup to be able to count edges at rates such as 2MHz. Is is the upper limit on the sampling rate? If yes, what is the limit? Is there a NI-DAQmx function that I could use to find that number for a PCI device. 

 

Thanks,

Varun Hariharan.

MathWorks

Periodically Extract Payload from CANBus Frames using cRIO in FPGA mode

$
0
0

Hi All,

 

I am new to LabVIEW and NI products and I'm trying to accomplish the following (I expected this to be simple to do!):

 

I have a bunch of CAN devices (let's say 12 of them) and I'd like to periodically read data from them. To do so, I write a certain frame (as specified in one of the device's datasheets) to set them all in operational mode. I only need to this once. To read data, I have to write a frame requesting the data and then read the frame I receive, and extract its payload. I set the bus speed to the maximum possible which is 1 Mbit/sec. I think each frame has around 109 bits max (based on the datasheet too), so my expectation is that 250 microsecond is more than enough for one request and receive operation.

 

Since I am using cRIO9022 (cRIO-9114 chassis) and a NI 9853 CAN module, I was not able to run in scan mode, which seems to be easier to do from the tutorials I saw. I had to run in FPGA mode, and so I used the section 5 in the following tutorial: http://www.ni.com/tutorial/11198/en/ combined with code from "CAN Basic (FPGA).vi" example code to come up with something. I have no problem sending and receiving the frames I want and extracting data, but I'm having trouble writing data to a file using a fixed sample rate and in real-time.

 

I have two files, the first runs on the FPGA target. It continuously runs, requesting data from the 12 elements, extracting data from the received frames and writing that to a FIFO once I read from all 12 devices. What I'm trying to do in my code is to only spend 250 microseconds to do a request/read operation. I don't know if I implemented correctly, and I'm not sure if the hardware is actually reading every 250 microseconds although I expect it to. I'm not sure how to debug that either.

 

The second program runs the FPGA target program and sets the send/receive period for it. It's supposed to record data for a set recording time and write it to a tdms file. It somewhat works but what's happening is that the data is not actually always real-time. If I set the frame send/receive period to 250us, it records for a longer time (probably another timing issue in my code). If I set it to 800 us, it seems to match real time as expected. If I set it to more, it records for a shorter amount of time. I tried recording the time elapsed and things don't seem to be timed as I expect.

 

I attached the code, I think it's simple and has enough comments. It has the project file and VIs. I included the CANOpen communication datasheet for the device(s) I'm reading from. I also included a sample log file. Rows 2 to 12505 are the data measurements and the remaining ones are "timestamps" (taken based on write-to-file time) for 12 measurements.

 

Please let me know if anything need clarification. I need help resolving my timing issues, or if you can recommend any easy way to do this. I can't be the first one trying to periodically extract and log payload from a CANBus!

 

Your help is appreciated!

 

Thanks


Configure a buffered counter in python

$
0
0

Hi, 

I'm trying to build an application in python that's very simple. The only thing he has to do is start counting the rising edges on a digital input channel. In the attached python script the counting works, but not in the way I want.

The counting of the edges should be independent of what the python script is doing. In the manual I read something about the buffered edge counting, but I don't understand how to build that.

 

I'm using the python PyDAQmx library

 

 

so please give me a hint how to do it.

Thanks in advance,

R de Vries

 

Large Range of Frequencies using Two Counters Measurement Method on PXI 6229

NI DAQ card for SinCos encoder?

$
0
0

We have a heidenhain RON285 encoder which uses the 1Vpp signaliing for "infinite precision."  Essentially it outputs two differential Sin/Cos signals and the phase angle between them allows you to get extreme precision for the encoder angle.    You still need to send the two signals through a comparator with hysteresis to essentially convert it to a quadrature encoder signal and count the pulses.  The phase angle calculation gives you the fractional precision.  

1) Has anybody ever used an NI DAQ card to read in the raw voltages and do the necessary calculations to convert the SinCos singal to a high-precision angle? If so, are you willing to share the code?

 

2) Can I do the SinCos --> Quadrature conversion on the card itself by forking off the two SinCos singals into two other channels and specify that those two channels are quadrature encoded singals or must I have external hardware do the comparator + hysteresis before inputting it into the card?

 

P.S.

I just found this piece of hardware which does exactly what I was describing in #2 above, can I get this same functionality by just using the DAQ card itself?  http://www.motrona.com/sincos.html

Pulse or two edge separation measurement with implicit timing in ticks: What do minVal and maxVal mean?

$
0
0

When I do pulse measurement or two edge separation measurement, using implicit timing, DAQmx chooses (I believe) a suitable internal timebase for the measurement. My X series board (a 6320) e.g. has an internal 100 MHz timebase. I think I can enforce usage of a specific timebase (using the DAQmxSetCICtrTimebaseSrc property setter to set the counter timebase to the value "100MHzTimebase"). But the docs of the DAQmxCreateCIPulseChanTicks and the DAQmxCreateCITwoEdgeSepChan functions (the latter one called with parameter units set to DAQmx_Val_Ticks) make me pass a minVal and maxVal. These values are supposedly used to (internally) determine a suitable timebase for implicit timing. But how should I choose the specific values for minVal/maxVal? They obviously depend on the timebase, so this is kind of a chicken/egg situation. Should I simply say "1" or "0.1" or even "0"? Because I *want* the 100 MHz timebase to be used. Or can I simply call DAQmxSetCICtrTimebaseSrc after DAQmxCreateCIPulseChanTicks?

Signal Express wrong time file with NI9361 Dynamic Average Freq

$
0
0

I am having an interesting problem with recoding frequency measurements to a file with SignalExpress and an NI9361. I was able to find a workaround, but here's the issue:

 

As in the attached SignalExpress project, I am acquiring analog voltage using a NI9234. In this case the module is in place only so that the /cDAQsim/ai/SampleClock channel exists for my next step to reference. I am also aquiring Frequency with the NI9361 in Dynamic Averaging mode using the external clock reference from the analog input step above. I then have a Save to ASCII step where I want to write a cheric ASCII file, comma delimited with Absolute Time.

 

Here's the rub. In this instance I only cared to record Frequency to file. But, when I did this the absolute time would count by seconds for 100 points then loop back to an earlier time and count up again. (See Test01.csv attached.) This is the same behavior as if I tried to record data using just the NI9361 without an external sample clock. 

 

If instead I have the Save operation grab FIRST the analog input then the frequency I will get a file with correct absolute time such as Test02.csv, attached. Even if I save frequency as the first input then voltage the problem in the time scale will come back. 

 

Does anyone know why this would happen? Is there a simpler way to recored buffered frequency measurements with the NI9361 and SignalExpress without recording analog data? without using an analog input module at all?

Is Task Done on edge counting task on USB-6008

$
0
0

I noticed that an edge counting task on the USB-6008 device will always return true when asked if it is done, even immediately after starting the task. This is of course not true for other devices. Is there some reason why this is so?

Sample C or CPP code for Continuous Pulse Train Generation on the PCIe 6612 card

$
0
0

Hello,

We would like to generate a continuous pulse train from one of the counters of an NI PCIe 6612 card using C/C++ language, with the NIDAQmx interface.

Our software needs to be able to continuously go to sleep and wake up each time counter output changes from low level to high level (i.e. on the rising edge of the counter output).

In some scenarios, we need to wake up on the falling edge of the counter output.

Note that we do not want to poll in a busy-loop for counter output.

The pulse train frequency needs to be constant (e.g. 100 Hz).

Is there an example program that demonstrates how to do that?

Thank you,

Itai

 


photon time stamping error -201314

$
0
0

Hi,

 

I'm making setup for fluorescence correlation spectroscopy (FCS). For photon detection, I'm using COUNTER-100C (LASER COMPONENT) as a photon counter, PCIe-6353 and BNC-2120.

Now I'm building lavbiew data aquisiton program for photon time stamping from the counter.

I used 100Mhz timebase for counter input terminal and signal from counter for sample clock gate (connected to PFI4, Ctr1 gate). But when I run this program with photon counter head closed to measure the dark signal, I almost always got error code -201314 in random time.

'Multiple Sample Clock pulses were detected within one period of the input signal. Use a Sample Clock rate that is slower than the input signal. If you are using an external Sample Clock, ensure that clock signal is within the jitter and voltage level specifications and without glitches.'

 

I tried to find same case as mine. But I could not find solved case. Does anyone can help me to solve this problem?

 

Thank you,

 

Minhyuk

Acquiring analog voltage and Freq using producer/consumer architecture

$
0
0

Hi

When I acquire voltage and Freq data using PCI6221, I select a producer/consumer architecture with three loops,which are events loop,daq loop and error loop,I put the analog read VI and counter read VI in the same state that in DAQ loop, but when freq sensor runs slowly or stop, the counter VI will wait data to come,which always lead the analog buffer overflow.Anyone knows what should I do if I must use producer/consumer architecture because of the complex controlling need.

 

Thanks.

Generating pulse packets on PCIe6612 (or PCI6602)

$
0
0

Hi,

 

I'm trying to generate a high frequency pulse train that turns off when my gating line is down. The attached VI does just that, but there is a drift between the high frequency line and the gating line.... (Note: there is no drift when the duty cycle of the gating line is set to 0.5)

 

Thanks!
Marc

Using PXIe 6612 to measure PXI 6528 channel pulsewidth - channel not available.

$
0
0

Hello everyone,

 

I am using PXIe 6612 counter card to measure the pulse width of the signals on PXI 6528 DIO card. Both these cards are in the same PXI chasis (NI PXIe-1065). I could measure the pulse widths using the LabVIEW 2013 example Counter - Read pulse width and frequency (finite).vi example. However not all the channels of the PXI 6528 card are shown in the drop down list of channels on which pulse width can be measured. Trying to connect any channel other than those available in the drop down list returns error. On PXI 6528 card port 0,1 and 2 are input ports and port 3-5 are output ports. I can measure pulse width on port 0, port 3 and only line 0 of port 1 and 4.

Can anyone explain to me why don't I see port 1 or port 2 channels in the drop down list or force the VI to measure pulse width on these channels ??

I can connect PXI 6528 input channels externally to PXIe 6612 counter input channels and measure the pulse width, but If possible I would like to avoid the external cabling between the 2 cards.

 

sync encoders with NI 9411 and 9423 in cDAQ 9178 chassis

$
0
0

Hello everyone,
I have problem with synchronization of 4 inputs - 2x angular encoder, 1x frequency, 1x linear encoder, where angular encores are connect to NI9423 and frequency input together with linear encorer is connect to NI9411. I need to measure synchronously all four inputs.
I define for each input one task. All tasks are define in NI MAX and it's running in test mode. Like a first step I am trying to run together angular encoders and frequency input, but program write me error message on task for frequency input:

 

Error -50103 occurred at DAQmx Start Task.vi:7220006
Possible reason(s):
NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
Task Name: Speed_Rotor_Jonas_Sensor1_NI9411

 

It is possible to measure all 4 values together with this HW in same time? If yes could you help me how to change program or/and task settings? My current program is below.

 

Many thanks for your help

 

Pavel

Viewing all 1271 articles
Browse latest View live


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