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

9401 line direction configuration in LabView

$
0
0

I use NI 9401 to measure a quadraure encoder. and i want 9401 to output 5VDC to drive my encoder. How to set the line direction for each port on the 9401 in Labview?


timer

$
0
0

Hello everyone, I'm working on automating the capture of voltage, temperature, current and irradiation in a photovoltaic panel. The program design is done, where enters the four values ​​to obtain the IV characteristic curve of a photovoltaic panel, also the power and efficiency is calculated.
The circuit design is in the program, the system: must have two states, the resting and active, all in function of time, the active state is given only every 10 minutes for a period of one minute, and the resting it's during the 10 minutes.
Let's start by resting state, in this state that it's during 10 minutes the entire period, writes in PWM port 11 an output  of  logic 0 (or volts), which connects the panel to the charge controller, also verified temperature, if the temperature in the panel exceeds 30 ° C activated a logic 1 in the PWM port 12, that's it all for the resting state.
As for the active state is once they finish 10 minutes, is activated for 1 minute, in this period, the PWM 11 outputs a logical 1 (5 volts), the program captures all values of the analog ports every 10 seconds (voltage, temperature, current, irradiation as already mentioned) which are stored in a excel file and calculates all equations, graphs and display their outputs once concluded starts again counting 10 minutes in an infinite loop.
But it is not  synchronizated of time, try by all means, anyone can help me with that?.  the active state (Automatizacion curvsa I-V) and the rest (Automatizacion parte2), I regret my ignorance.

How to control two USB 6501 simultaneously

$
0
0

Hi,

I am trying to measure two signal by using two counters of different NI USB-6501 device. The problem is that they measure one after another so I loose half of the time. Can anyone please help me so that I can simultaneously measure them. I have attached the sub vi which I used in the main vi to control both USB-6501.

 

Thank you

 

Best regards,

Somnath

How many PID loops could I run on cRIO RT?

$
0
0

Hi,

 

I am trying to create a temperature process controller. I have 3 RS232-enabled OMEGA mass flow controllers, 12 thermocouples, 6 heaters (that will be connected in sets of two), and 3 PWM-enabled fan banks.

 

My thinking is that I would connect the heaters in parallel to a phase-angle-fired SSR (http://www.chromalox.com/catalog/resources/PDS-PK308-SSR.pdf). That way, I could use a 0-20 mA output signal from the cRIO to control the power appplied to the heaters. I would use PID, and scale the output of the PID to a 0-20 mA signal to control the process temperature. I also want cascade control - I want to have 2 additional thermocouples that are connected to the PID loop acting as limit sensors. If the temperature limit is exceeded in either thermocouple, the PID loop is "turned off" until reset by a user. I would want three of these configurations (2 heaters, 3 thermocouples, 1 SSR - x3, so 6 heaters, 9 thermocouples, 3 SSRs).

 

Rather than control the PWM fans with a PWM output directly from the cRIO (which I heard can be painful) I found a PWM controller that is controlled by a 0-5VDC signal. I wanted to use a thermocouple as a process value, and the 0-5VDC signal would scale to control the fans to achieve the desired temperature. I would want three of these configurations (1 fan bank, 1 thermocouple - x3, so 3 fan banks, 3 thermocouples).

 

 

So now, my REAL question - Would one cRIO chassis be able to control these 6 PID loops AND my OMEGA mass flow controllers? I'm just unsure of the processing power that is required of PID/limit control.

 

I appreciate any help I get - If need any more specifics, please let me know!

 

Thanks!

 

 

Single pulse output and LED indicator

$
0
0

With the Single Pulse Output.vi example (accessed from DAQassistant), used with a SIMULATED NI DAQ 6323 and set to the following parameters on the front panel:

 

Dev2/ctr0

NO trigger (presumably meaning that it starts when the RUN button is hit)

Pulse duration 1 sec

Output terminal Dev2/PFI0

 

...here's the question: how can I verify that the program actually produces a pulse at the (simulated) PFI0 ?  I tried connecting the LED indicator to any place I could find on the block diagram, but it always reports an error that an "event" cannot be connected to a Boolean indicator.

 

So where on the block diagram can the actual output channels or pins be shown graphically, so that an LED can be connected there? 

 

A related question is:  how can I use the output at PFI0  to connect to an input of another counter?  The output and input pins are not on the diagram, so how can they be wired together?  If I try the DAQmx Connect Terminals icon, that also specifies connecting the terminals with virtual wires.  But where are the terminals on the diagram?  Or, how can they be made to appear?

 

I am a total novice with LabView so please do not assume I already know anything.  Thanks for your help.

 

 

Using the 6525 counter to measure frequency: is there a neater way?

$
0
0

I'm currently using the high speed counter on the a USB 6525 module to measure the frequency of a spinning object via a hall effect sensor.

 

I was wondering if there was a simpler/ more effective way of coding it than this?

 

Currently all I do is take the current counter reading, wait a second, take another reading and subtract one from the other. The result is the frequency, in hertz.

 

Is there a way of getting the 6525 to return the count/ change in count after 1 second?

 

Thanks

 

Untitled.png

Delay Trigger Doesn't Work for Time Required - Error Msg

$
0
0

Hello,

 

 Operating with:  X Series 6351 USB DAQ, Windows 7, Labview 2013 SP1

Relative newbie, but not completely.  Have completed Self Paced Training Core 1 and created a data processing VI for R&D but still new enough to be dangerous...

 

Purpose: Trying to take the aforementioned R&D VI and convert it into a production tester.  It turns on a medical surgeon's tool.  This is essentially an enclosed motor in a "drill housing" let's say,  that I am turning on with a relay using a medical power supply it's attached to.  I then break the phases with another multipole relay and read the back EMF to get zero crossings, speed, deceleration, friction etc. all calculated values.

 

In the R&D version I turned the motor on with a Boolean switch that activated the relay.  I used a powered pole on the relay to notify the VI that it had indeed been energized, and turned on the 2nd relay after a 3 second time delay.  The trouble is, production wants a run-in on the handpiece to set the bearing and they want it to be 8 minutes.  My time delay, using a Property Node won't give me a delay that long... hence my dilemma.  I'm sure there is a relatively easy way to set up a delay timer in my VI, but I'm not smart enough yet to figure out the best way to accomplish this.  Event structure? State machine? Also would like to turn off the Boolean switch programmatically.   I am running out of time on this project and I would sure appreciate a point in the right direction.  I attached the full VI and a screen shot of the area I'm having trouble with.  Much obliged for any help and please pardon the spagetti code.  I will get more proficient with practice and some NI training beyond the self-paced stuff I hope.

 

Scott Wargo

Senior R&D Technician

 

I

Logical "OR" with 2 counters

$
0
0

Hello,

i need to produce complex signal (attached as image), the signal is a logical "OR" operation of 2 pulse trains, are there any option in labview to produce such signals with PCI-6602 board?

 

logical-OR 50.jpg

---

Thanx!


Synchroneusly start an analog in task and semi period measurement task in X devices

$
0
0

I am trying to synchronize analog input with timestamps for all edges produced by an encoder.

 

In the DAQ M Series that I was using before, this was nicely achieved as follows:

 

A counter input task is set to do an implicitly buffered semi-period measurement, and it's Arm Start Trigger

is connected with the analog in sample clock. The cumulative sum of the semi-pulse widths then is directly

the timestamp in timebase ticks of each edge of the encoder, referenced to the start of the AI acquisition.

 

However, in the DAQ X Series, that method does not work. When doing semi-period measurements, the

counter does not start counting upon the HW Arm Start Trigger, but only on the first edge on the gate signal.

In fact, the documentation says it does start counting, but the count at the first edge is not stored, contrary to

the M Series. Of course, that first edge count does not correspond to a proper semi period measurement

(and the M Series manual correctly states that in most applications it should be discarded), but it is essential

to establish an absolute reference to start of the analog in acquisition. 

 

Is there any way to make the DAQ X series produce that first sample, or achieve the same effect in some other way?

 

One could of course switch to buffered edge counting with explicit timing (the AI sample clock), but this has two

disadvantages: Since the encoder edges happen much less often than the sample clock, this would be a waste of

data bandwith. Furthermore, using the previously outlined approach, I get sub-sample accurracy, which is

important particularly because the the encoder frequency is low.

 

Another idea that I was unable to completely work out is to try to trigger the analog in task instead onto that

first encoder edge. I can live with loosing the analog input up to that first encoder edge. However, the problem

here is that I cannot gate the encoder edges. As both the analog input and the counter input tasks effectively

start on "the first encoder edge" (after they have been armed), I need a way to arm them simultanesously to

be sure to start on the same edge for both. Unfortunately, the analog input does not seem to have an arm start trigger.

 

I am looking forward to hear any suggestion on how to implement this on DAQ X Series.

 

Thank you in advance,

Yves Delley

can I generate a trigger with counter out put?

$
0
0

Hello,

 

I will be using a digital trigger (0-10V) as a gate for my counter  out0 and  a 100MHz timebase clock as my source for counter out0. I want it to generate finite pulse train or contineous pulse generation. I want to count the pulse/ticks and then after "nth"  pulse, I want to generate  a digital Trigger.  Is it possible ??

 

I am Using a USB X series 6353.

 

 Thank you very much.

 

Best,

pjkunwor1

NI 6602 frequency change How to

$
0
0

Hello!

 

I would like to use the NI 6602 Counter in other frequency base than 80MHz, I have read about it, but still couldn't figure out how to do that. I know that I need an other counter to set the frequency then measure with the second counter, which frequency's I have set. Is there any done example for that? or can you help me in this question? Thanks in advance.

 

Balint

Synchronization issues on USB 6341

$
0
0

Hello,

 

Before I get into the problem that I'm seeing, I'll start off by describing what I want to do.

 

I have the USB-6341 X Series DAQ and two photon counting head PMTs.

 

I want to bin and read the number of counts at each PMT with user-defined sampling rates between 500 and 10,000 Hz, resetting the tick count to zero after each reading.

I want the data from each PMT read/sample to be a single number - this is because I need to compare the two PMT outputs in real-time (i.e. calculate a ratio between PMT 1 and PMT 2 that I use to determine downstream operations).

Lastly, I need the reads from the PMTs to be "perfectly" synchronized. The (PMT 1/PMT 2) ratio means nothing if the data is misaligned by an arbitrary number of samples.

 

I've attached a copy of my code below. I'm using ctr0 to create a frequency pulse train with the same frequency at which I want to sample. The output of ctr0 is used as the source for the sample clocks of my input counters (ctr1 and ctr2) and also as the source for their Arm Start triggers. 

 

Unfortunately, the inputs from each PMT (counters 1 & 2) are unsynchronized, even with the Arm Start triggers (which I read were the only way of synchronizing counter tasks). I know this not only from the reviewing data that I've saved but also because when I stop the program, the number of samples recorded along the x-axis of each strip chart is different. I don't understand how that is possible. This discrepancy is arbitrary for each run. I should mention - I don't see the discrepancy on the strip charts at all if the PMTs are removed from their respective screw terminals.

 

Does anyone have any insight that can help me?

 

As a side note, I also see this behavior when I have two analog inputs that share the same task! That program is also attached below.

 

frequency multiplication on 6602

$
0
0

I am doing frequency multiplication with NI 6602 counter (see attached picture LV 2011 snippet):

Ctr0 is triggered by external clock with measured period (say 50 ms, 20 Hz). Ctr0 task is retriggerable, so it is running continuously.

Ctr3 task is retriggerable finite generation - to multiply frequency 100 times (to 2 kHz, 500 us) I generate 100 pulses, high time+low time slightly below 500 us. So all 100 pulses end just before the next ctr 0 trigger. Phase between this task and input triggers is controlled by changing low time of ctr0 task during runtime. 

 

My problem is that when I change delay, ctr3 task can skip one trigger period (50ms). It happens when I reduce the delay and ctr0 pulse is generated before previous ctr 3 finite generation finishes, so ctr3 waits for the next pulse. But they should be running continuously, allowed pause in generating pulses is 5 ms maximum. 

 

One solution is to use a different counter to generate 500 us pulses, and connect it while main tasks are switching. I will have wrong phase for a while, but pause in generating will be smaller.

But I am running out of counters, also disconnecting main task and connecting different task will take time. And I do not like this solution. Any advice?

I can not generate 99 pulses, switch phase, then switch back to 100 pulses, number of samples can not be changed at run-time.

 

Square waveform generator

$
0
0

Hi,

 

I want to make a continuous square waveform. there are some samples and files online to do so, but I'd like to be able to change the frequency of waveform continuously, I mean something like a function generator. I try to use PFI channel in NI 6221, but It just provides waveform with constant frequency. I am wondering if it is a good idea to use PFI channel? I want to provide 100 to kHz square waveform.

 

Thanks,

How to trigger automatic input data changes

$
0
0

hi I am very new to labview, as a part of an experiment i need to control an agilent N6700B mainframe voltage controller using labview. I had established all the comm using GPIB . At the moment I am able to control the output voltage by using the attached labview program (this is a modified version of the example program i got from agilent). Whenever i give a voltage input in labview (marked as red in block diagram) I am getting the same voltage at hardware output.  

 

Following are my questions

 

1) how I can change this manual voltage entry to an automatic mode . For example when i click run output should change to 5 V then without pressing anything it should change to 15 V after some seconds,later change to another Voltage. 

 

2) when I press stop ,labview is stop working.but the hardware is stillgiving an output voltage, how can i reset my hardware (change voltage to zero) by pressing stop button

 

3) this program iscontrolling only one channel of my hardware. my hardware has multiple channel outputs. How I can controll all simoultaneaosly . I tries to copy and paste the block s to create another branch. But allchannels not working when I did so. 

 

 

My quistions might be silly as I am really new in labview. But it will be really helpful if you can give a hand 


pxi 6602 pulse generation

$
0
0
Hi i am new user and i got pxi 6602 iwant to generate a 5 khz 3.5ms 2.5 amplitude and 2.5 offset i probably need to use 2 counters can someone tell me which wires i need to connect on scb 68 device and how ican write this program?
Thanks for helping me

voltaje de pulsos para contador NI USB 6009

$
0
0

Hola a todos,

tengo un problema con un Encoder y mi tarjeta NI USB 6009.

Tengo que contar las RPM de un motor, en encoder se alimenta de 12V y los pulsos o señales las entrega en 12 para nivel alto y menos de 1V para nivel bajo. esta señal la quiero adquirir en el contador de eventos de la tarjeta, pero en el manual dice que el contador trabaja con 5V para nivel alto (1) y o.7V para nivel bajo (0).

existe alguna forma de bajar esos 12V de la señal a 5V para poder conectar el encoder a la tarjeta de adquision de datos sin dañarla?

Muchas gracias por su ayuda.


buen dia. ...

HW Timed Single Pulse generation speed

$
0
0

Hello!

 

I'm looking for a recommendation on how to speed up a counter pulse generation.

 

Currently I am generating a clock tick using a counter, and routing this counter through the PXI back plane and into several multifunction DAQ cards to acquire one sample of data (multi channel from all the DAQ cards) for each loop iteration. 

 

There are several reasons I do this:

 

  • I need 1 sample (multi channel) of data from multiple DAQ cards per software loop, identical to a control loop.
  • I have to time the loop based on a software IRQ, specifically a reflective memory ScramNET card.  I cannot use pulse trains or external hardware clocks.  I have to use the software IRQ as the synchronizing clock, thus I need to trigger the pulse for every IRQ received in software.
  • I use a HW Timed Single Point Read for each data point, with the card channels in parallel.  Software Timed On Demand is a slower process, and won't multi-thread and thus parallelize like HW timed will.
  • I run the multifunction DAQ cards in parallel for synchronization and maximum speed.
  • They are X series cards, but the X series DAQmx Task synchronization doesn't work across multiple DAQ cards for single point I/O.  Thus I need to create and route the pulse through the chassis.
  • I create a DAQmx counter pulse with a very small time duration.  Since the pulse has to occur immediately after the software IRQ, this seems like the only way.  I've debated starting a pulse train and tweaking the frequency to realign every so often, but that sounds a little convoluted.

The only way (currently) I can fire this counter pulse is by Starting and Stopping the task each iteration.  Even the shipping examples do it this way.  Using Execution Trace Toolkit, it's clear that the Counter Start Task takes 168 uSec, and the Counter Stop Task takes 100 uSec. The total of 268 uSec is a lot of time, and limits the ultimate loop rate I can run.  My Single Point Read (only) takes 226 uSec (and runs in parallel multi-thread which is great).  So the pulse generation consumes a lot of time relative to my desired loop rate.

 

I've been doing it this way for some time, but I would like to speed up the pulse generation somehow.  Starting/stopping the counter task with each iteration seems inefficient. But alas I'm no expert on counters.  If needed I can attach any VIs.

 

Thanks for any help!

 

Patrick

 

Analogue Signal Pulse Count

$
0
0

I am using CDAQ with a NI9229 4 Channel analgoue input card. 

 

I have a sensor that outputs an analogue 5v square wave signal. The pulses are triggered from eithe a north or south pole of a magnet. I have  an aluminium wheel with 30 magnets, all magnets are in opposition to each other. when the wheel is rotated the output is a square wave.

My magnet wheel is rotating at 182° per second. Over 360 degrees there is 30 magnets. Thus making the sensor switch 30 times.

The time to revolve the wheel one revolution is 1.978 seconds.

 

I have set up the NI9229 to the following

- sampling rate is set to 25kS/s So to record the data for one revolution it works out as 49450 bits.

- Have set the trigger levels for recording a hi or lo pulse to 2.7 and 0.7 volts.

 

50000 samples would be two seconds worth of data which would be more than 360° of rotation of the magnet wheel.

 

The problem I am having is that my pulse count changes between 30 and 31. But as I am only recording 1 revolution of data there is physically only 30 switches. Do you know why I am getting a change of 30 and 31.

 

 

 

 

Measurement of frequency ramp over fixed time

$
0
0

Hello,

 

firs, my setup:

LabVIEW 2013 + Sound & Vibration Suite

cDaq 9172

NI 9423 DI (frequency via Keyence LED Light sensor)

Ni 9215 AI (vibration vie 3-axis force sensor)

 

With this hardware, i want to measure the vibration of a fan-motor at different speeds. The rotation speed is measured with a light sensor looking through the fan blades (23 blades in total). I can control the motor speed with LV and will let it run from 500 rpm to 4500 rpm in a linear ramp in ~ 10 to 20 seconds.

What i need to know is the best method to geht the most exact values of frequency and analog input values. I need to be sure, which analog values go with which frequency values, because I will do a spectral analysis later on.

I can live with getting all values at the same time after the ramp has finished.

 

Do i put both channels inside one Task in MAX to get the same timing? Doing so would mean the slowest card would set my maximum sample rate?

Are there better ways? Is it best to use finite sample mode?

 

Thanks for your help guys!

 

Greetings from germany

Viewing all 1271 articles
Browse latest View live


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