LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i generate a single square wave with a period that is defined by the user?


We need to generate a very narrow square wave to trigger one our mass spectrometer.  We've
tried to use the signal generation and the various square wave vi's
to generate the signal.  The problem is that we can't control the
period of the wave.  When I change the frequency to the pulse period
that I need, more than one square wave is generated.  Is there a VI
that I can use to control the period of a single square wave?

James Jones
0 Kudos
Message 1 of 7
(3,450 Views)
James,

what hardware are you using?
i'd advise you to use a counter for pulsegeneration. You can define the hightime of the pulse. Counters used on the NI hardware are normally TTL, so you have a maximum rise/falltime as well as a minimum high/lowtime. These depend on the device you are using (e.g. E-Series with 20 MHz or M-Series with 80 MHz). If your signal fits for this, this should work out very good for you.

Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(3,446 Views)
Hello Norbert,

We're using an M Series PCI-6229 DAQ card.  Can we control the amplitude of the pulse from the front panel or does it have to be a static value?

Thanks again,

James
0 Kudos
Message 3 of 7
(3,442 Views)
TTL implies 0-5V. That's set by the hardware, and you'd need external circuitry to alter it.
Jarrod S.
National Instruments
0 Kudos
Message 4 of 7
(3,434 Views)
James,

another way is to use anaolg out (AO) for this. It is simple to adjust the level of the signal there, but on the other hand, you have to build the signal by combination of single analog values. The speed of output and the number of samples defines the hightime of your pulse. Example:
You define your pulse with 10 values which are {0,1,1,1,1,1,1,1,1,0} as your patter where "1" is your highlevel. The outputspeed is 10 Hz, so your hightime of the pulse will be 8/10 s = 0.8s. The issue here would be that the rise/falltime is 0.1s each (which is not good at all).
So you see that you (nearly) always have several ways to solve an issue, but anyways: for pulsegeneration, Counters are best (with the constraint of TTL-levels).

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 7
(3,409 Views)
Hello again,
I'm still a little hazy on the details soI I thought I'd explain what we're trying to do in more detail.  We have a mass spectrometer that we're trying to detect multiple masses over a time period of about 9 minutes.  For each mass, we need a short square wave pulse.  The input voltage into the mass spectrometer determines the mass (i.e. 0.033 volts = 1 atomic mass unit).  We need to be able to control the input voltage from the front panel.  I've already built a vi to control the input voltage but i can't construct a signal to match.  What we're trying to do is measure mulitple masses in one second.  For instance, if we want to monitor 3 masses, we'd have to have 3 square waves of 0.33s corresponding to the 3 masses, but the signal cannot overlap.  Mass A, would be taken at 0.33 of every second, Mass b at 0.66s etc.  Will the methods previously stated work?  If so, can you explain in a bit more detail?

Thanks,

James
0 Kudos
Message 6 of 7
(3,390 Views)
Hi James,

If you want three separate square waves, you can use 3 distinct output channels, one for each of the masses you are interested in.  If your equipment is such that it takes only a single input signal, and this signal needs to include three pulses in one second, then the best option would be to use a counter pulse generation output, with a frequency of 3 Hz and a duty cycle corresponding to the required pulse length.  Counter outputs are available on nearly all of our multifunction data acquisition (DAQ) boards, and we also produce specialized counter/timer boards for more precise or higher channel-count applications.
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 7 of 7
(3,373 Views)