LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using DAQ generate a 38kHz on an analog output on and off for ms using labVIEW

I wish to generate a 38kHz pulse on an analog output of a mydaq to drive a infrared led. The 38kHz signal is not continuous but is on for 1ms and off for 1ms.

0 Kudos
Message 1 of 7
(3,047 Views)

You're going to run into issues working with timing that precise using the myDAQ.  It's software timed.  This means you're going to need Windows to give you resources to perform your desired task.  That's not a likely event when you're worried about 1ms.

0 Kudos
Message 2 of 7
(3,029 Views)

The analog output is hardware timed with sampling rates to 200 kHz. At 38 kHz you will only get slightly more than 5 samples per cycle so you may not get the precise timing you want or get very clean waveforms.

 

Another issue is the output current of 2 mA maximum on the analog output.  This is not enough to drive a typical LED. You will need to add an amplifier to drive the LED.

 

The AO FIFO holds 8191 samples so that could give you about 440 ms at the 200 kHz maximum sampling rate.

 

With an amplifier you should be able to do much of what you want.

 

Lynn

0 Kudos
Message 3 of 7
(2,976 Views)

@johnsold wrote:

The analog output is hardware timed with sampling rates to 200 kHz. At 38 kHz you will only get slightly more than 5 samples per cycle so you may not get the precise timing you want or get very clean waveforms.

 

Lynn


With his desire to start/stop every 1ms, you're leaving the hardware timing and moving into software timing.  While you can put out the 38 kHz signal, you can't precisely start and stop every ms.  If that specific timing is a requirement, I'd still be concerned about the application unless you know of a way to get around the need to stop the waveform for that 1ms.

0 Kudos
Message 4 of 7
(2,968 Views)

I know how to generate 38kHz continuously and to drive the infrared led. The problems is how to write a VI in labVIEW that will give a 38kHz for approximately 1mS and off for 1mS. The 1ms is not precise.

0 Kudos
Message 5 of 7
(2,953 Views)

Hi pat,

 

you generate a waveform using 38kHz as sample rate and a rectangular shape of 1ms HIGH level and 1ms LOW level. Using some simple math you will notice you need 38 samples at 38Khz to output a value for 1ms…

Then you just output that waveform on a AO channel.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(2,942 Views)

Never mind.

0 Kudos
Message 7 of 7
(2,925 Views)