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.

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
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • How do I use the NI 9481 to switch a load on for 30s and off for 30s?

    I am attempting to turn a load on and monitor voltages using Signal Express and a cDAQ. I have a NI 9481 Relay module but I am having a problem figuring out how to set it up. I need to have the relay close for 30 seconds and open for 30 seconds.

    Hi M.Fish and welcome to the NI Discussion Forums!
    Try looking at this forum post as it may lead you in the right direction. http://forums.ni.com/ni/board/message?board.id=70&message.id=7113&requireLogin=False
    PBear
    NI RF

  • High Noise on Analog Output PCI 6289

    Hi guys
    I am using  a PCI 6289 M series device for A/D characterization , I am using the device both for the analog output generation and also for data acquistion of the digital lines , The dynamic tests for the A/D were showing a very poor SNR ratio of the ADC, it is a  12 bit adc so technically in the ideal case i should atleast see  90 db but the resulting figure was way lower around 40 db .
    I connected the A0 from the PCI 6289 brought out to a scb-68 block to a RHODE and SCHWARZ spectrum analyzer , the above spectrum analyzer is a decent one with good analysis capability and I was surprised to see a SNR of 50 db , the data sheet says that PCI 628X devices have  a internal 16 bit DAC so technically the SNR should be atleast 90 db even if 6 db were removed for the harsh environment of the computer .
    please advise , have anybody else faced this problem , the data sheet does not give a figure for the SNR ratio of the card , since i need to test a 12 bit adc , thought that 6289 would be up to the task since it has a 16 bit DAC.I am using the Noise shielding cables and also SCB-68 block , the block is far removed from other power supplies .
    any ideas why the noise is occuring , one of my colleagues says maybe the harsh environment inside the pc enclosure causes it , is it necessary to use a separate PCI box for the card and then connect the card to the computer , is this standard procedure ?????.
    and also does the PCI -6289 have a filtering option for the analog output , all i could find was the filtering for input.

    Hi Tom
    Thanks a lot for responding to the thread , did not expect a response in the holiday season . The SNR for the 12 bit one was a typo , was referring to the 16 bit onboard dac in the M series card , which technically should ensure a clean input signal having atleast 90 db .
    The info you have given helps a lot , i suspect the conditions inside the pc might be causing it , also i am driving the analog output from the card at almost its limits of 2.5 MS/s , the sample rate specification for the card on the data sheet says 2.8 MS/s , also i notice the settling time requirement for the outputs is 3 us which i suspect will put the onboard DAC under quite a load.
    If the conditions inside the PC cannot be rectified , where can i find a external PCI box which can be connected to the computer or does such a box exist only for the PXI cards ? will that necessarily rectify the problem and also since filtering is not possible on the card itself , I remember reading the scb -68 connector block has  single RC output filter option , i would have to use discrete R,C components to make it but notice on the right hand corner some pcb holes are provided , would this help.
    Would appreciate your Response
    Thank you
    Chip learner

  • Problem with distortion with DAQ Generating Sine wave

    Hello,
    I have a little problem with my VI who is made for driving a biphased stepper motor:
    When I change dynamically the output frequency of my DAQ Generaor, I have some weird effect (see picture). It happend progressivelly like this :
    (the start frequency doesn't matter)
    95Hz - nothing
    95-100Hz progressivelly grow
    100Hz :
    100-105 Hz degressive
    105Hz - nothing
    So I generate 2 phases with a rate of 1M and 100k for sampling. All other stuff are set with the same settings.
    My device is an NI USB-6356 (1.25MS/s/chanel)
    I have tried to set all things at 100k but when I do that my motor won't turn.
    Does anyone know why it does this ?
    Thank you in advance
    Attachments:
    Sub_Mesure1.vi ‏238 KB

    Hello Mike,
    I use 2 simulate signal setting in sine : see Capture2.png
    and both DAQ Gen and Acq : Capture3.png / Capture4.png
    Attachments:
    Capture2.PNG ‏39 KB
    Capture3.PNG ‏70 KB
    Capture4.PNG ‏73 KB

  • Generating sawtooth in Analog Output

    Dear Mr.
    I am programinning in labview and I would like to generate from my DaqPad 6020E sawtooth signal. I have a problem becouse I can generate virtually but not in Analog Output. Please verify my program which is attached to the mail. If you can please write your simple program which generate sawtooth signal in analog Output. I was checked programs (examles) in ni.com but i can generate one. I know that AO works becouse i checked it sending sin (as trigonomethry sig) and there was no problem.
    Best regards
    Tomasz Olszewski
    PS. If You speak Polish we can talk in Polish language.
    Attachments:
    ct03.vi ‏124 KB

    Have you verified output in the Test Panels of the Measurement & Automation Explorer (MAX)? Simply wire analog output 0 to analog input 0. In the test panels, generate a sine wave on the analog output pin. If you can read in the signal on the Analog Input tab, then the board is operational and something is wrong in the code. Check the code to make sure you are referencing the correct device # and channels. Have a great day!

  • Analog output digital start trigger c api

    Hi, I am attempting to start analog output based off a digital trigger (either PFIO, or a PXI line)  I can do this easy in LabVIEW.  However with the C API (through Python wrappers), the problem isthat when I call DAQmxBaseWriteAnalogF64, the write will always timeout as the acquisition has not been triggered.   However, I cannot call this after the trigger occurs, as obviously that will be too late.
    I cannot find any C API examples where analog output is triggered off a digital trigger.  I can find them for analog input, but that is fundamentally different as you can performan read anytime after the trigger occurs.
    Python code as follows (the functions are equivalent ot C API, though you do not need ot pass the task handle as it maintained as part of the Task object)
    # create analog output task
    analog_output = Task()
    analog_output.CreateAOVoltageChan("Dev1/ao0","",-10.0,10.0, DAQmx_Val_Volts, None)
    analog_output.CfgSampClkTiming("",outputRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, numSamples)
    analog_output.CfgDigEdgeStartTrig("/Dev1/PFI0", DAQmx_Val_Rising)
    analog_output.StartTask()
    analog_output.WriteAnalogF64(numSampsPerChan=numSamples, autoStart=False,timeout=1.0, dataLayout=DAQmx_Val_GroupByChannel, writeArray=data, reserved=None, sampsPerChanWritten=byref(samplesWritten))
    print("Analog output: Wrote %d samples" % samplesWritten.value)
    # create digital trigger
    dig_out = Task()
    dig_out.CreateDOChan("Dev1/port0", "", DAQmx_Val_ChanForAllLines)
    # create digital trigger function
    highSamples = 1000
    numpts = 3 * highSamples
    doData = np.zeros((numpts,), dtype=np.uint32)
    doData[highSamples:2*highSamples] = 2**32 - 1
    # send digital trigger
    doSamplesWritten = c_int32()
    dig_out.WriteDigitalU32(numSampsPerChan=numpts, autoStart=True, timeout=1.0, dataLayout=DAQmx_Val_GroupByChannel, writeArray=doData, reserved=None, sampsPerChanWritten=byref(doSamplesWritten))
    print("Digital output: Wrote %d samples" % doSamplesWritten.value)
     

    Hi PatrickR,
    You can review some of the text based NI DAQmx (ANSI C) code examples on generating an analog output using a digital start trigger. If you included/checked text-based support dusing your NI DAQmx driver installation, you can navigate to Windows Start>All Programs>National Instruments>NI DAQ>Teaxt-Based Code Support>ANSI C Examples>Analog Out>Generate Voltage>Mult Volt Updates-Int Clk-Dig Start. If you have any questions/concerns regarding the NI hardware.

  • Four analog outputs

    I want to find a DAQ device which has four analog
    outputs and at least four analog inputs.
    Could you recommend one to me?

    Jaejeen,
    There is no daqboard with the exact specifications you request. However, I can suggest you some alternatives:
    1.- You can get a Signal Source board with at least four analog output channels; i.e., the NI 6711, and you can get an E Series board for the analog input channels. Finally, you can synchronize both of them.
    2.- You can get a regular E Series Board, and you can use the two regular analog output channels, and the counters are other two analog output channels, but with the restriction to generate square waves only.
    Hope this info is helpful.
    L Aguila
    Applications Engineer
    National Instruments

  • How do I configure 128 channels of DIO and 128 channels of Analog output with the availabili​ty of 3 pci slots

    I have only 3 slots of PCI or 4 slots of ISA bus, I want to configure with the minimum possible modules to attain 128 channels of DIO and 128 channels of analog output. This is inturn fed to the PCM (Pulse code Modulator). The cards will be placed in industrial PC.

    Associate Engineer-Marketing,
    Using just those 3 PCI slots you're not going to be able to get the 128 analog output channels. You will probably want to go either the MXI-3 (PCI bus extender) to a PXI chassis or E Series DAQ card to a SCXI chassis for such a high channel count system. Which analog output cards and which digital I/O cards you will want depends on your application. You will have to decide whether you will need static or dynamic analog output as well as whether you need clocked digital I/O or not. I highly recommend contacting our internal sales department at 1-800-433-3488. They are great at helping specify systems.
    Ames
    Applications Engineering
    National Instruments

  • How to building a multi-channels analog output task in visual c++ 6.0 (without Measurement Studio)?

    Hello!
     I have a PCI 6251 card, and using DAQmx C function to generate a wavwform. (single channel ).
    But, how to creating a multi-channels analog output task, and had a different frequence in each channels?
    Thanks.

    This is getting to be a common question!
    The answer is, you can't.
    If the rates have common factors, you can use a higher overall rate. The slower waveform will simply have extra points in it to make up for the higher update rate.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Synchronize a counter and Analog Output

    Hello all,
    I want my Analog Output generation and my Counter0 operations to start at the same time. Any ideas how to accomplish it.
    I have tried to feed the output of another counter1 to the gate of counter0 as well as to the clock source of Analog Output (GPCTR1).
    This however doesnt seem the solution.
    Will appreciate any suggestions.
    Thanks

    Mili,
    I think you'll have to experiment, but it might be possible to do both operations with the equipment you have. This would be relatively easy with an NI 660x counter/timer board.
    You can use the Route Signal VI to send your counter output to a RTSI line and then select the RTSI line as your counter 1 gate. (this is the generic solution for any number of counters)
    For getting an external update clock, check out the continuous external clock example programs that are included with LabVIEW or NI-DAQ.
    You can easily start your output with a digital trigger, but the STC counters do not allow for digital triggering of counter operations. You may be able to come up with some programming scheme that gets counter 1 started, but gated low so t
    hat it is not counting until the start trigger comes in for the acquisition (such as a start trigger that is forced low until the start trigger for the analog input comes in). This would be a design you would have to work out or see if anyone else has found a way to do it.
    You can also search for many example programs/discussions at http://www.ni.com/support by searching in Option 3 for keywords like external, analog, output, and trigger.
    Hope this helps.
    Regards,
    John Nieri
    Applications Engineer
    National Instruments

  • CFP-AO-200 Analog output module (Error -33180) !!

    Hello everyone
    I'm using the cFP 1808 Bank along with other input modules like AI-111 and AI-110 ,I recently bought a AO-200 Module to output currents in the range from 4-20 mA ,I connected the module to the bank and updated the device from the MAX Software ,then I opened the Getting Started/Analog Output.vi from the examples in the Labview 2011 in order to test the card ,the VI returns an error with the code -33180 to me ,I don't know what's wrong ,but i tested the card with the MAX and wrote values to it successfully.
    Can anybody tell me what's wrong with my VI
    Thanks
    Solved!
    Go to Solution.

    Post your VI so we can see what you are doing.
    Did you read the error description for that error code?

  • 6035E Analog Output problem

    I have a 6035E with two analog outputs ("0" and "1").  Output 0
    seems to work just fine, as do the analog inputs I've tried.  The
    problem is that output 1 does not.  It only seems to give
    -13V.  Any thoughts?  Thanks1

    Please see this thread.
    -Alan A.

  • Subtracting two waveforms, one aquired using DAQ analog voltage input, and the other one being internally generated

    Hello NI Community,
    I am new to LabView and was hoping someone might be able to help with a question I have. Right now, I am using a DAQ unit to sample an externally generated sinusoid and I would like to alter that signal by adding to it another signal that I could control using the front panel. Whenever I try to just connect the input with something like the sine waveform vi and put a subtraction sign between them it doesn't work (I get an empty waveform graph). To get around this, I have resorted to sending out a signal (through an analog output) and then reading the signal on the Daq, and then finally I add the two together. Doing it that way works, but it wastes two channels and I imagine there is a better way. I have attached my VI, and I labelled the location of interest  "Where the Signals Get Subtracted", which is currently shown using the two inputs.
    Thanks,
    Leo

    What a mess.  I have no idea where you are trying to do the subtraction.  Can you make a very small VI (one whose Block Diagram fits on a single screen) that shows what you are trying to do?  Include the Sine Wave Generator, and you can include a "Black Box" that says "From DAQ".  But thank you, at least, for posting code, not a picture.
    Here's a suggestion that may help make things less messy -- do you know about the Diagram Cleanup tool?  See the icons at the top?  The right-most one looks like a broom next to a VI.  Save your VI first (in case you don't like what it does), Select All (Ctrl-A), then click this button -- you may like the result.
    Bob Schor

  • I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel?

    I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel? In attach I send a example of my vi to control one chanel, but i need to control both but with diferent waveforms.
    Is the vi correctly programed to this propose?

    Yes you should be able to do that. look at the signal generation examples shipped with LabView
    You can create a 2 D array, with each row representing a wave form per channel. The number of points of the wave form (per row of the 2 D array) represent the number of points in the output buffer
    The wave forms can have different amplitudes/shapes, and therefore they are independent in this sense.
    However, you need to set the update rate,which is the same for both channels. The update rate together with number of points per buffer determines the frequency of the wave forms. This means the two wave forms will have the same frequency.
    To have different frequencies, you need to have say, on wave form with one cycle per buffer, and the other waveform have 2 cycles
    per buffer. in a case like that the frequency of the second channels is twice that of the first channel, and so on
    The two wave forms are then not truly independent, they may have different amplitudtes/shapes, but related in frequency.

  • Generating 0 and 1 signal using labview Daq card

    Hello,
    I’m working on a Project on the On/Off control of a pneumatic cylinder via a 5/2 solenoid valve.
    On State: Valve  O/P  1 pushes cylinder  İ/P 1
                     Value  O/P vents air.
    Off State: Valve O/P 2 pushes cylinder  İ/P 2
                       Value O/P 1 vents air.
    By this way we aim to move the clinder forward and back.
    We use Labview 9.0. I did not work on pneumatic system before,
    I will be happy if you could help me about  2 points.
    1)      How can we  enable the On/Off switching  between the 2  O/P’s  of the solenoid ?
    2)      How can we enable the timing between On and Off States. ( On: 0-5 seconds Off: 0-5 seconds )
    Do we need special code for Standard labview blocks will be OK ?     
    Thanks a lot.

    The digital out are a great place to start, however they are signal lines which means they don't drive a lot of current (~1mA). If your device isn't setup to accept digital signals you may have to use an external transistor to step up your amperage. See the link on here to get started 
    Labview can provide all the timing you need. I would search through the shipping examples (Help >> Find Examples) for digital output examples, there should be a bunch and one will probably work for you with just a little modification.
    Jesse Dennis
    Design Engineer
    Erdos Miller

Maybe you are looking for

  • CS6 Premiere Pro Workflow

    In the limited time I have, I am attempting to learn Premiere Pro and have working through the CS6 tutorials that creativecow.com have to offer. However, it would be a great help if I had a better idea on the workflow (in simple terms) such as: Set p

  • Lost ability to print PDF's

    I'm running a Window Vista machine with an HP7960 printer. I've had no problem in the past printing PDF's, but when I tried to the other day, I could no longer print them. The print progress box comes up, it starts with 0% and immediately jumps to 10

  • Does PID loop transfer values to new instance

    Greetings Everyone, I'm a new forum user, but I've been using Labview for about three years now.  I have an application that uses PID VIs in multiple cases of a case structure.  Each case structure passes a different set of setpoints, gain schedules,

  • My iPhone 5 restarts after 2-5 minutes all the time!

    My iPhone 5 restarts all the time. Worked fine for about a week, but after pressing use for development in Xcode, it started happening. Restore to new iPhone did not help. Anyone with the same problem? - Christian

  • Downloaded PSE 12, when I sign in, nothing happens

    Just bought PSE 12, downloaded and installed. When I launch it asks for a sign in. When I sign in, nothing happens, it just disapears.