MyDAQ - Generating a digital signal and displaying it on an analog waveform graph

Hi,
I am using the NI MyDAQ to generate a digital waveform with an adjustable frequnecy. This is being implemented into a program I have already written which generates a TTL "like" pulse out of the sound card. I am displaying the output on an analog waveform graph, and I'd like to be able to display the digital waveform generated by the myDAQ on the same graph. (Not at the same time, either one or the other, toggled by a button). I've been messing with arrays and conversions but I cant seem to really get anywhere with it all.
This is the vi I have made to generate the adjustable frequency digital signal with MyDAQ. Any suggestions on the proper way to do this if the following is wrong would be great too as I just got the MyDAQ a few days ago. I would think there must be a better way but this is the best I could come up with so far.
Solved!
Go to Solution.

Hi Jonny,
The general logic you are using to create a digital pulse train is fine. This VI you've written should work and will create the pulse train based on software timing (which is fine because you don't have hardware-timed DIO on the myDAQ anyway). However, it is usually good practice to start the DAQmx task just before your while loop and then clear the task after the while loop when you press stop.
For reference, there are some pretty good LV examples that I recommend looking at for this application too. If you are just trying to create a digital pulse train, the example Gen Dig Pulse Train-Continuous.vi is a good example that uses a counter to create a digital pulse train of your desired frequency. This is generally the prefered method to create a pulse train if you have the hardware available to do so (the myDAQ does have a counter). Alternatively, there are some DIO examples that continuously write to a digital line/port.
If you're not familiar, you can find the examples by going to Help >> Find Examples... in LV. Then, navigate to Hardware Input and Output >> DAQmx >> Generating Digital Pulses or Digital Generation.
Also, here is some additional information about the myDAQ and its counters:
myDAQ Counters 
myDAQ Manual 
Hopefully this helps.
Chris G
Applications Engineer
National Instruments

Similar Messages

  • Whether could I generate one AC signal and acquire one DC signal and one AC signal together using NI myDAQ?

    Dear Sir:
    I would like to know whether I can generate one AC signal and acquire one DC signal and one AC signal together using NI myDAQ? If I can, could you please tell me the easiest way to achieve the goal? If I cannot, please tell me whether I can use both white box to do this because I have got another white box USB-6008. Cheers
    Kind Regards
    Jeff 

    duplicate post
    Don't create a new thread. In the thread above, you asked for someone to review your code but you did not post a modified VI. Your original one is obviously wrong as I noted.

  • Generating a digital signal

    Hello,
    I am trying to  generate a digital signal which can be controlled in terms time i.e. Switching ON for 10 minis off for 5 minutes. I tried to generate a digital signal which is going high but unable to control it. As I am the beginner in labview any kind of help is appreciated.
    Please see the attachment for the developed block diagram
    Attachments:
    digital signal generation.vi ‏17 KB

    It appears that all you posted is one of the shipping examples. Is that all you've tried? You can't control it because you're not actually doing anything inside the loop. You're simply setting the value high before the loop starts, and not changing it in the loop. What kind of device do you have? Is it software controlled? If so, you will need to keep track of the time inside the loop. You can use the Elapsed Time VI to do this. Attached is a simple example to get you started to see how this can be done. I'm sure you can figure out how to integrate what you did and what I've shown you.
    To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
    Attachments:
    Switching signal.vi ‏29 KB

  • How to input/output a digital signal and acquire an analog signal at the same time?

    Dasylab, version: 8.0.04
    Acquirement Card: PCI1002L
    When I use DasyLab to acquire the analog signals is no problem without digital inputs and outputs,
    and when I use DasyLab to input or output a digital signal is no problem also, but when I do that at the
     same time, DasyLab tell me the rate is too high and stop.
    so, I searched the manual book1 (user guide) for that, it showed me :
    To internally equalize measurement time and system time in the analog input, digital input and counter
    hardware modules, use the following settings:
       Synchronization: PC Clock
       Sampling rate: <= 5Hz
       Block size: =1
    the problem is, if I set the Sampling rate to 5Hz, the speed of the acquirement datas is not enough for my
    application.
    so, how to improve it? who can give me a example programm for me. thanks!
    by the way, I come from China, my English isn't good, I'm sorry.
    Allen, China.

    Hi,
    Have things changed over the years?
    I need to syncronise a digital output (Modul NI9474) and an analoge input (AI-Modul NI9203) module. I need to measure time intervals from a flank in signal A to a flank in signal B. I would like accuracies of the order of 1 ms. Currently, the signals are not synchronised, with errors of the order of 2 times the block length (block size x sample rate), sometimes much higher. The best I got so far was a block size of around 20 with a sample rate of 1 kHz.
    If I use the master and slave settings on the RTSL settings, my program doesn't run properly.
    If I use digital signals for input and output, I can syncronise them with RTSL settings and everything is good, but I can't always do that.
    Also, if I do anything in the GUI (such as scrollowing something or going to another window), my output gets screwed up properly.
    1. What can be done to synchronise AI with DO?
    2. Is there something that can be done to avoid messing up the output when something happens in the user interface? (I know that I am messing up the outputs as they make some valves switch and that is loud).
    Thanks in advance!

  • Saving portion of data acquired from FPGA and visualize it on HOST RT Waveform Graph

    Hi all,
    i'm using FPGA to acquire data @1 Mhz from a Custom module in a SCTL an place it in a block memory Target Scoped FIFO1 Block memory of 1023 elements.
    What i want to do is acquire a known waveform and and visualize acquired data just to check if data is corrupted or if samples are correctly representing waveform.
    I'm reading data from FIFO1 and placing in a MEMORY in another SCTL to not affect 1st SCTL.
    My intention in this is to create a one shot reading operation to place 1023 elements from FIFO1 to MEMORY (attached pic).
    After this i have another while loop that perform communication with the HOST to read data from MEMORY.
    data type is FXP signed 24 bits word with 24 bit integer part. 
    I cannot visualize anything on the host waveform graph.. Can you tell me why?
    I've attached FPGA vi and HOST vi.
    Thanks in advance.
    Attachments:
    1.png ‏60 KB
    TEST acquired waveform.vi ‏170 KB
    Host Testing Acquired Data.vi ‏112 KB

    Hi Mariano,
    I need your complete project in order to review your application. Anywhere, you could try to run this example, that shows you the best practice in order to achieve data integrity ensuring no underflow/overflow events in data transfer.
    In RT VI you can try to use Type Cast function in order to obtain DBL values from FXP ones.
    Look @ this white paper that allows you to use floating point in FPGA side.
    I hope that the above informations will help you in solve your issue.
    Best Regards.
    CLA_CUP

  • Most efficient way to extract the amplitude of a signal and display on an intensity graph

    Hi All,
    I am having difficulty to display the amplitude of an voltage signal (voltage picked up by NI DAQ card).
    what I am trying: Voltage signal (Dynamic data type)--> 2D array of dynamic data type (using 2 nested for loops) --> normal 2D array with scalar values --> intensity graph
    I have difficulty to convert the dynamic 2D array to scalar 2D arry.
    I only want to extract the amplitude of the imcoming signal.. any body can give some advice? thanks in advance..
    Charlie

    Hi Hillary,
    Thanks for your reply.
    Yes, I did tried to use Amplitude and Levels Express vi, it should be the one I am looking for, but I found it not work in my case, I need to put the value of amplitudes into a 2D array.
    If I use Amplitude and Levels Express vi, it will give me a 3D array, I have found the solution, just convert the dynamic data to single scalar. (see pic attached)
    Anybody can help me to solve the following 2 problems:
    1. The speed of this program is too low, i think ii due to the DAQ assistant in the 2 for loops (for creating 2D array), it should be able to re-write using DAQmx (as "centerbolt" told me), I am working on this now, if anybody can help, I will appreciate that.
    2. Is there any other way to creat the 2D array (for purpose of increasing speed also).
    Thanks,
    Charlie

  • How do i add array element after acquiring 8 samples from pulsatile signals and display it?

    Hello, LabVIEW Experts,
    I'd like to do the following with the attached VI:
    1)enter raw data(sampling frequency 333K/sec and 333K samples) into array1
    2)the rising edge of the pusatile input triggers/starts the analog input(the first 8 points)
    3)the 8 data points are appended/inserted into array2
    4)front panel displays array and waveform of both array1 and array2
    I know what to do in other langauges but i am having a hard time doing it with LabVIEW.
    Please advise.
    Thank you.
    CK
    Attachments:
    tim continuation 020206.vi ‏90 KB

    Hi CK-
    The easiest method I can think of to perform this function is to sort through the array of data as it comes in and pull the necessary points.  I have attached a short example that shows how to graph the raw data and also to check two conditions:
    Checking through the array, always check to see if one element in the array is greater than the previous (using shift register to store data)
    Checking each point, always check to see if it exceeds the "Trigger Lvl" value
    If both of these conditions are met (hence the AND "gate"), we break the While loop and save the iteration value.  We then grab values from the original array starting at this index and take "Length" number of elements.  Finally we present the array subset similarly to the original data.  This example uses a simulated square wave with noise, but reading an array from your DAQ operation should allow you to achieve the same results.
    Hopefully this helps-
    Tom W
    National Instruments
    Attachments:
    Subset Suggestion.vi ‏79 KB

  • Generate digital signal for 6722 or 6221

     Hi,
    first thanks for the help I already got on this board.
    Now I've got the following problem:
    I like to generate a digital signal: high for 300µs, low 300 µs, high 300µs, low 300µs, high for about 2ms.
    I am looking for a solution how to generate this digital sequence. At the same time I will read the information back via an analog input (hopefully I have now a solution for this problem).
    I tried to find examples but I wasn't successful. At the moment I was not able to produce any digital sequence which worked.
    My hardware is either 6722 or 6221 - which should be OK regarding the timing.
    Thanks
    Solved!
    Go to Solution.

    Find attached example.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Digital Waveform [LV 2009].vi ‏14 KB

  • How to convert a analog signal to digital signal

    Hello,
    How to convert an analog signal into digital signal such that every sample of analog signal corresponding to 1.2V will be represented as '1' in digital signal and other samples of analog signal(that are not 1.2v) will be represented(converted) as '0' in digital signal.
    And how to display both wavefroms or signals in graph indicators.
    Thanks.
    Solved!
    Go to Solution.

    If you have 1000 samples, and you want to convert to digital, you are going to get 1000 digital values.  Attached is what I mean.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Analog_to_Digital Hooovahh Edit.vi ‏52 KB

  • DIGITAL SIGNAL GENERATION

    Hi!
    I want to generate a digital signal (0-5V) in order to turn on and off an hydraulic pump. The time on (high) and time off (low) are specified by a MatLab code, so that once the pulse has finished one cycle, the program should be go again to MatLab code and take two times again. Then it should generate the signal again.
    Thank you for the help.
    Miguel

    Thanks for the reply.
    I have a system with an hydraulic pump, power supply, transistor and computer. I would like to send a digital pulse from my computer (0-5V) to the transistor. The transistor then closes a circuit (power supply and pump), and the pump starts running.
    Then, I would like that each sample (each pulse) has specific width (time on), and also specific time off before it starts with other sample. These times (time on and time off) are computed by a MatLab code.
    I'm working with DAQmx drivers and I also have a BNC 2110.
    I also attach my code in Labview that I am trying to modify.
    Thanks a lot.
    Regards,
    Miguel
    Attachments:
    Gen Dig Pulse Train-Finite_original.vi ‏22 KB

  • How to output a digital signal on negative slope of the clock?

    Hi
    I need to output a finite length of the digital pulse which will start on demand at the negative slope of the imported (or exported) clock.
    I am trying to get the clock exported or imported, but in no case I can trigger outputting the signal on the negative slope. 
    What is the trick?
    thanks
    Pawel
    Solved!
    Go to Solution.

    Which device are you using to generate your digital signal.  What is the clock source?  Can you attach your vi?  Normally, there is a DAQ function to configure the trigger where you choose the trigger source and the trigger slope (rising or falling), which would be falling for a negative slope.
    - tbob
    Inventor of the WORM Global

  • Way to "downgrade" from digital signal on graphics cards?

    Hello all,
    I recently purchased an 8-core mac pro with the intention of using it for a lot of video installations for theatrical productions. I bought it with 4 of the Nvidia graphics cards, which are dvi and mini-displayport. These are both sending a digital signal, and it doesn't make it possible for me to use my DVI-composite adapter so I can plug into older TVs. I also have TONS of BNC cable that I can use to run cable paths, and this BNC has to have composite. This severely limits me, since my work involves grabbing whatever output monitor I can find. I've seen some posts on altering the signal with a EZ pc-tv converter box, but this is one more adapter/converter/whatever that can break during a performance. I'd like to just send it out from the source.
    So my question is, is it possible to find a graphics card that still sends this analog signal, thereby allowing me to use my composite adapter? I just purchased the Mac Pro about a month ago, (just before they updated) and I wasn't sure if I could find anything like this. I've used the ez pc-tv box, but these don't appear to be too reliable, so if there isn't a way to install a graphics card, then is it possible to find a beefier conversion from the digital signal to analog so I can run long lengths of BNC cable?

    The standard DVI connector also produces the five signals required for VGA signal on the same connector.
    The DVI connector should have a solid bar toward one end of the connector. This is the ground for the four VGA pins (Red, Green, Blue, Horizontal Sync) that surround it. The fifth signal, Vertical Sync, is shared with the digital signal. A simple VGA-extractor has been available through the Apple store and other outlets.
    A DVI to composite Video and S-Video adapter, which may have a few active components inside, has also been available. The one on the Apple Store lists only the X1900 for the Mac Pro, but it is not clear to me whether they have simply been lazy about updating the description.
    The mini Display port adapters they list are
    1) DVI-Digital-only (you can tell because the bar at the end lacks the four pins surrounding it) OR
    2) VGA adapter (which you could convert to Composite with a component available in Europe they call a SKART chip).
    Conversion of the digital signal is out of the question. You would need a screen buffer and as much logic as is already on the display card. Adapting the VGA signals is the way to go.

  • How to calculate the time between triggering the signal and receiving back

    i want the time elapsed between triggering the signal and receiving it back through a ultrasonic sensor in compactrio labview fpga.

    thank you sir for your reply, but im working on fpga target cRIO-9082 chassis it wont support those palletes , yah if i dont work on fpga target then i can use those palletes ....in attaching the vi for generating a digital pulse and acquiring it back but yrt dint got any idea hot to determine the time...if the vi is wrong please make the neccessary changes. i used this vi to determine the total time between trigger and receving signal of ultrasonic sensor.
    Thank you 
    Attachments:
    pulse generation.vi ‏51 KB

  • How to check 6 digital signals change value at the same time with PCI-6229??

    I am using DAQ card PCI-6229.
    Channel 1 generate a digital signal.
    Channel 2,3,4,5,6,7 acquire digital signals.
    I want to check:
    1. Whether the rising edge of Channel 2,3,4,5,6,7 occures at the same time;
    2. The time delay from the rising edge of Channel 1 to the rising edge of Channel 2,3,4,5,6,7 is within a certain range.
    I know I can use counter to get the two edge seperation time delay. But I only have two counter, it is two time-consuming if I check one by one.
    I don't know how to check the rising edge of 6 different channels occure at the same time.
    Does anyone has any suggestions?
    Thanks

    Hello,
    You can use the DAQ card's digital input change detection circuitry to detect changes in the input, you can then use a counter to measure the relative time between samples. Please read Page 6-9 DI Change Detection Applications for more information. Let me know if this helps
    Christian A
    National Instruments
    Applications Engineer

  • How can i detect digital signal transitions?

    Hi,
    I have to monitor several digital signals and i'm not interested in the signals themeseves,but in their transitions because those represents important events in my problem.
    I have an E series daq card, so i think that the only way i can do this using digital inputs, is by polling.
    My problem is that i cannot loose any transition and i need an accuracy of about 10-20 ms to accomplish this.
    Do you think that's possible using polling?
    Can i use my daq analog inputs(because in this case my daq card support buffering) instead and try to detect transitions?
    Thank you in advance,
    Luca Tascedda

    I believe the state detection is event-driven. You might take a closer look at the manual for the 6533 (available on-line) and at the example in our developer zone. You can query for
    "Change Detection with Time Stamping" or follow this link.
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DC7956A4E034080020E74861&p_node=DZ52327&p_submitted=N&p_rank=&p_answer=&p_source=External
    Alternatively, you can use the analog trigger, though I think this works with just one analog channel at a time.
    Good Luck.
    Preston Johnson
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

Maybe you are looking for