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

Allow "Unflatten from XML" to work without internet access?

$
0
0

Edit: This message was supposed to be posted in the LabVIEW Software board... Sorry about that.

 

Hi all,

 

In my program i'm using the Unflatten from XML and the Flatten to XML vis. On my development computer it all works well. As soon as I put it in the production environment, it stopped working. I narrowed it down to the fact the in my production environment, there is no internet access and I will never be able/allowed to have internet access there.

 

Does anyone have an elegant way to fix this problem? (By 'elegant' I don't mean manually changing every .xml file that I produce to include the path to the local LVXMLSchema.xsd) Is there a .manifest or .config file that we can change to point my compiled program to the right xsd file? Another method maybe?

 

Thanks!

 

Kind regards,

Filip.


Help with photon counting vi using LabView 2014 by USB 6251

$
0
0

Hi, I am a chemistry graduate student who is brand new to LabView. I am looking for some help with using the APD photodiode to count the number of photon. I want to gate the APD by applying on the APD input gate a TTL pulse (which will be generated by LabView 2014 via NI-USB-6251 BNC), I am trying to find a LabView program that can control USB-6251 to do photon counting, but I have no idea how to design a program. I was wondering is there any similar program that I can use? Any help would be greatly appreciated. Please let me know if you need any sort of additional information from me to understand what I am doing.

 

cDAQ 9178 & NI 9401 - ASM Incremental Rotary Encoder not working beyond a certain frequency

$
0
0

I am using a cDAQ 9178 chassis with an NI 9401 DIO module.  I am trying to convert the output from an ASM incremental rotary encoder (in radians) to rpm.  

 

Sensor head (PMIS4-20-50-240kHz-TTL24V-Z0-2M-S)

Magnetic Ring (PMIR7N-20-50-M-20)

 

The encoder outputs 2500 pulses per rev (5V TTL output).  The maximum speed that the encoder will see is 2800rpm, which equals 2800rpm*2500ppr/60 = 116,667.67 Hz in terms of frequency.  

 

From the NI 9401 Operating Specs:

Maximum input signal switching frequency by number of input channels, per channel

8 input channels..........................9 MHz
4 input channels..........................16 MHz
2 input channels..........................30 MHz

 

I'm only using 1 channel so I'm assuming that the 9401 should be more than capable of handling the 116kHz that the ASM encoder is spitting out.  

 

Everything works properly up to approximately 2100rpm (~87,500Hz) but then I start to see a drop in rpm followed by a flattened behaviour and then a slight increase. But never higher than 2100rpm.  Our test rig is being inspected for other reasons at the moment so I can't produce a plot of the behavior (I can reupload later).  I'm thinking that this must be an aliasing issue with the counter or something along those lines.  I have a digital filter set up with a minimum pulse width of 4.0E-6.  This is two times smaller than the minimum pulse width at a frequency of 116kHz (0.0000085714).  I don't think that this should be affecting the calculation.  

 

Any suggestions? This rpm value is critical to our application. 

 

Thanks in advance, 

-MB

Synchronizing encoder data with voltage readings

$
0
0

I'm trying to measure a voltage signal and in some way synchronize those readings with angular position from a stepper motor. I'm controlling the stepper motors with a PCI-7354 and collecting voltage data with a USB-6210 DAQ. My encoders are currently wired into a UMI-7774 for motion control. I've read a bit about taking input from a quadrature encoder in a counter terminal but this is all new to me. Is there some simple way in DAQ Assistant or something to ensure that my voltage and position data are being recorded on the same clock? I know there are some timing issues inherent to using USB and unless I'm mistaken, the PCI-7354 operates on a different clock than the DAQ does.

 

Any help would be much appreciated!

PCI 6601 counter - resource reserved while debugging in Visual Studio

$
0
0

Hi,

 

I'm trying to debug an application which uses counter1 on the PCI 6601 bord to create a continous pulse train. The application is in VB and with Visual Studio 2012 I always get the Error: -50103 specified recource is reserved. This error occurs right after the application is loaded to VS, so no task is created at that time. Has anybody experienced a similar behaviour?

I would be thankful for any ideas.

 

Thanks in advance

 

 

Square wave generation phase offset problems using PXI6602

$
0
0

Hi,

 

I am generating 2 signals to use for simunlating an Incremental AB encoder using a PXI6602.

The signals need to be square wave, 34.133Khz, offset by 90degrees which I am setting by dividing (1/frequency) by 4 and putting the result into the DAQmx Create Channel (CO-Pulse Generation-Frequency).vi initial delay node.

The resulting signals phase difference however does not consistantly measure 90degrees. At least 1 in 5 runs of the vi has a phase angle issue resulting in a failed test.

 

Can anyone suggest a stable fix for this.

 

Thanks,

David

thread

$
0
0

Hi All,

 

I would like to know how will i be able to tackle a seemingly simple issue.
I would want a timer to start immediately, when i type something from my keyboard(or a scanner). All the characters that i type within 1second should be stored, say to a control. And then after 1second the VI should stop its execution.

I think the perfect workaround could be to run the timer in a separate thread, if somethings get typed and using the 'Time has elapsed' property of Elapsed time  to stop the execution of VI. But i dont know how to work with thread. Please help !

Note: I get the keypresses using Acquire Input Data.vi

Counting the number of samples when all counters are being used

$
0
0

Hi All,

 

I'm using PXI-6284 which has 2 counters on it, and I'm outputting 2 pulse trains using these 2 counters. Using an "elapsed time" function to control the number of pulses is not very accurate and I cannot use the finite samples option as there are no free counters.

 

How can I use the elapsed time function to control the output roughly, and then after the fact get the actual number of pulses that were made? CO.Count is not very useful here.

 

I need to be able to compare the number of pulses made with the PXI module against the number counted by the microcontroller on my DUT.

 

Please help.

 

Best,

Adrian


DAQmx Quadrature Encoder Initial Position

$
0
0

Hello, 

I am building an application that requires trackig the raw counts from a quadrature encoder connected to a NI USB-6212.  In order to count each rising and falling edge of both channel A and channel B, I have configured a DAQmx Linear Encoder Channel for 4X decoding with the units set to ticks.  In order to prevent the counter from rolling over when the ticks become negative, I convert the U32 value from DAQmx Read to I32.  So far this all works as expected.  I would additionaly leik to retain to position of the encoder if the VI is stopped but remains in memory.  For this reason I wire the value of the raw counts to a shift register which is read into the initial position input of the DAQmx Create Channel VI.  For some reason, the DAQmx Create Channel VI quadruples whatever value is wired to the inital position input.  I solve this by deviding the previous counts by 4 before writing to initial position.  However, the problem occours that if the value of the previous count was not an even multiple of 4, the inital position must be rounded to the nearest integer, causing the count to jump when restarting the VI.  How can I reset the inital postition to the exact value of the encoder at the end of the previous iteration?

Count number of triggers from paused counter source

$
0
0

I have a very large, very complicated VI that I am using to control an experiment. This experiment requires certain environmental conditions to be true in order to acquire data. Once these conditions have been met, a trigger is sent to an independent data acquisition system to initialize the acquisition. I need to be able to count the number of times these triggers have been sent (approximately one is sent every 10-15 mins) but can't seem to get the CI Cnt Edges scheme to work. I can't use DAQ Assistant because it is too slow due to the size of my VI.

 

Anyways, I have the VI setup so that I basically have an analog output as Pause source on the counter output that sends the triggers. I just need some way to count these pulses but the way I currently have it working, the VI won't stop or abort because I have the Counter sample wait time as -1 (wait indefinitely) and I have to terminate labview from the task manager to stop the VI. Is there an easier way to do this?

 

I am using Labview 2014 with a PCI-6221 DAQ with a BNC-2120 attached for all of my outputs.

how to stop a period counter in a while loop without using abort execution?

$
0
0

I am using a NI x series 6343 andcounting pulses, but when i try to stop the counter with a boolean operator nothing happens, ihave to go and use abort execution, 

 

Help

Digital counter speeds

$
0
0

Hi everyone,

 

I am currently using a NI 9401 with a NI cDAQ 9172. I am using the onboard counter to do the following (pseudo-code):

 

- on every digital edge on counter-input pin 1 : p=p+1

- if (p = 100) { toggle output pin 2; p=0 }

 

It is working great for frequencies in the 10 MHz range.

 

I now want to do the same counting procedure at a rate of 100 MHz.

If I understand the datasheets correctly then this should not be possible with my current hardware. Is this correct?

 

I had the idea to buy and use an NI myRIO board to do this. What would you expect to be the highest input frequency the above code would work with? In your opinion: would that be the "way to go"?

 

Cheers!

 

Counter Output Pause Trigger

$
0
0

Hi!

 

I am having difficulty at pausing an acquisition signal.

Attached are the vi I use: the "INIT_SCAN" is the first one, then come "GET_SCAN" and "CLOSE_SCAN". I believe the modifications I need to do should only be done in INIT SCAN but I attached the others just in case.

My NI card: NI USB-6353, USB X Series.

 

Here's my problem:

So far I have been able to pause the analog output signal and I would like to pause the counter output whenever the analog output is on pause, so that I don't read any information during that time. Unfortunately I couldn't find anything that works.

 

The first counter (CO) I use is the one that creates the gate of the second one (CI), and the second one counts the pulses received by my photodetector.

My problem seems to come from the very nature of the counter, because I can pause an analog input at the same time I pause my analog output without any problem. To do so, I just share the sample clock of my analog output with my analog input (-> second line of my INIT_SCAN.vi).

 

I tried to use a sample clock instead of an "Implicit" timing for my counters (I tried on both counters, on the model of my analog input signal) but it didn't work, including with "Continuous Samples" (I read somewhere that I needed continuous sampling to implement a pause on a counter..?).

 

The error was happening in the GET_SCAN.vi, at the start task of my counter and LabVIEW suggested: "Set the buffer higher to zero, do not configure Sample Clk Timing or set Sample timing type to On Demand".

I followed these suggestions and added a buffer of size "1000" right before the start task and put the "On Demand" mode to the Sample Clock of my CO, but this only shifted the problem from the start task of the CO to the reading task of the CI.

 

I also tried to directly use a pause trigger property node for my counter but it did not work either. What I discovered is that LabView seems to "accept' digital pause trigger but not analog pause triggers for counters.

 

So I could sum up my problem like this:

1) What I think should be best is to pause the gate of the counter input, which is why I focused on the counter output. Should I instead focus on the timing of the counter input itself?

2) Is there a way to synchronize my counter output with my analog output signal the same way I synchronized my analog input? (hardware)

3) If not, is there a way to pause my counter "independtly" (using a property node most likely) with an analog signal?

 

If I didn't give all the information needed, please tell me,

 

Hope any one can help Smiley Happy

Thanks a lot for your time,

 

Estelle

 

 

 

 

 

Using one counter (Dev1/ctr0), how to prevent activation (High state output at Dev1/PFI13) of another counter (Dev1/ctr1)?

$
0
0

Hi, i'm using the PCI-6255 and PCI-6251, both have 2 counters. I have the problem that when i use just one counter, the other generate a high output in the PFI line during the time when the first counter is active. It is possible to avoid this situation? I show the issue in the time diagram.

 

Counters.png

 

Thanks

 

555 Timer

$
0
0

Hello

Ive some problems with the 555 Timer. I'm trying to get an defined pulswidth signal out of a current signal.

My problem is the circuit should work with 0.25 to 1 Hz on the current signal.  I've got it running at 1 Hz but if i try to go lower the timer starts to get crazy.

im a really noob in stuff like that and happy with every little help Smiley Embarassed

i hope someone can help me Smiley Happy

thank you

toobi


PWM measurement pattern for continuous samples over higher frequencies (100kHz) with SemiPeriod(HighTime / LowTime)

$
0
0

Hi Folks,

 

I have a challenge which I like to discuss with you and hope to get some ideas and maybe a solution.

 

I have a National Instruments multifunction data acquisition (DAQ) devices NI-PCIe-6353 this means X-Series!

 

I'd like to generate and measure Pulse-width modulation  signals.

 

DRIVER:

 

 

 

OUTPUT:

Freq: 0.1Hz - 1MHz

Duty:    1%  - 99%

 

change parameter on the fly

 

(This works fine and is implemented)

 

INPUT:

Freq: 0.1Hz - 40kHz

Duty:    1%  - 99%

Method of measurement:  Semi-Period / ContinuousSamples / AsyncCallback 

 

Here I have problems I am running only on a Intel(R) Core(TM) 2 Duo CPU E8500 @ 3,16GHz.

And I want to run 2 PWM_IN and 2 PWM_OUT

 

 

Low frequency work fine!

 

0.1Hz - 20kHz

 

its a Callback loop with

 

myCounterReader_1.BeginMemoryOptimizedReadMultiSampleDouble(2, myCallback_1, myPWM_IN_1, myPWM_IN_1_Data);

Data = myCounterReader_1.EndMemoryOptimizedReadMultiSampleDouble(ar, out myPWM_IN_1_Data_actualNumberOfSamplesRead);

Higher frequency don't work fine!

 

20kHz - 40kHz

 

I get exception Status Code -200279:

 

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

 

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

 

Property: NationalInstruments.DAQmx.DaqStream.ReadRelativeToRequested Value:

NationalInstruments.DAQmx.ReadRelativeTo.CurrentReadPosition

 

Property: NationalInstruments.DAQmx.DaqStream.ReadOffsetRequested Value: 0 

 

Task Name: NI1_PWM_IN_ctr0

 

Status Code: -200279

 

40kHz means period = 25us = 12,5us HighTime and 12,5us LowTime by 50% DutyCycle

 

this means each 25us i get a reading of 2 samples the HighTime and the LowTime

 

I load my Task from Max so here is the configuration(sorry its german):

 

MAXPWM_IN.PNG

 

1. Can someboby explain me what the MemoryOptimized means?

2. Zu lesende Werte means the buffer size 10 is not a lot but increasing the buffer size to lets say 10.000 want help over

    a longer time! 

3. Reading the data more frequently is not possible because the data are live as it is 

4. Specifying a fixed number of samples I have der number is 2 HighTime and LowTime

5. I did not start and stop task! Is it better to start and stop the task everytime so that I always have a new buffer perhaps?

 

Hope someone has an idea for!

 

By 

 

Steven

 

 

 

 

help to check my project convert digital signal (count edge ) to RPM

$
0
0

I want to get RPM from Motor use rotary encoder49770.gifpd.jpg

and insert to colom N on table measurment..

but i doubt , my project is true or wrong..to convert digital signal ( pulse ) to RPM

i used count edge on USB DAQ 6008

Please help me to check in green border..

this is project i create

project.jpg

 

i copy at this article http://www.ni.com/example/13580/en/

Module and wiring for frequency measurement with Yokogawa flowmeters and a speed pickup

$
0
0

I need to measure the frequency output of three Yokogawa AXFA14G flowmeter and a speed pickup using a cDAQ module and 9188 chassis.  I am unsure of the best module and the correct wiring.

 

The Yokogawa meters that I have can provide a passive pulse output.  I have attached the wiring diagram.  The power supply must be less than 30VDC and 0.2A.  I expect to see frequencies up to 11,000Hz.

I also need to measure a speed pickup.  The speed pickup has three wires:  The power supply 5 to 15 VDC, the output signal (5V TTL) and the common wire.  I expect to see frequencies up to 4,000Hz.  

 

I would like to read three flow meters and the speed pickup with one cDAQ module.  I would also like to power all four devices with one power supply.  I am unsure if the devices are considered sinking or sourcing.  I am unsure of the correct module and the correct wiring.

 

My options appear to be:

 

NI 9401.  Powering flow meters and speed pickup with a 5 volt supply

NI 9411.  Has a built in regulator.  I would have to be able to measure both device types as signgle ended.

 

If I only measure the flowmeters, I could consider using the 9423 (if the flowmeters are (sinking).

count revolution per minute with NI 9237 and strain gauges

$
0
0

Hello community,

 

i am a labview beginner and i need some help.

 

I work on a alternating bending machine which is bending a specimen. An AC motor produces the alternating bending. The AC motor in question has a revolution of 1380 per minute. My aim is to count the load cycle. For this i will use a NI 9237 Modul. I installed four strain gauges on the machine, wired them with a wheatstone full-bridge and connect this with the NI 9237. I want to count load cycle out of the determined continuous signal with the zero crossing function. I tried to do this but i always get a different and wrong value. I also tried to adjust the sample values as advised in other posts.

 

Thank you all in advace for your help.

 

Engin

 

 

measure analog signals and frequency simultaneously

$
0
0

Hi, I have a question. I bought a NI cDAQ-9188 chassis and seven modules. Six of them are for measurements for example the temperature, voltage... and one is a counter (NI 9401) for the frequency. With the tool 'Measurement & Automation Explorer' I created a task to measure analog signals, the temperature, voltage, current... and with the counter the frequency (engine speed). I choosed the option analog capture for the analog signals. But when I try to add a new channel for the frequency measurement, with the plus button, my NI 9401 module isn't listed anymore and no provided devices were found though my NI 9401 counter measure the frequency if i choose the option for capture with a counter. But in this option I can't add analog signales. It is possible to measure analog signals and frequency simultaneously? Yex, How? No, is there an alternative for this task? Thank you. Regards

Viewing all 1250 articles
Browse latest View live