How to combine Digital Output, a delay and Analog Input in a fast loop

I need to develop a process loop that runs at least at 250 Hz that performs a Digital output, than a delay of 50 microseconds and than an analog input of all the channels. All will be done using ATI MIO 64E3 card. Of course, the acquired data will be processed, displayed and saved. The loop will be running for several minutes until user stops it.

The fastest and most precise timing will occur if you use hardware timing. You can apply hardware timing to analog input on the E Series boards, but not the digital lines. Let's focus on the analog input first. Continuous waveform scanning uses a scan clock, which can be the board's internal one or an external one which you apply. If you want to scan all the channels 50 microseconds after a digital rising edge, then you need an external signal to signify that scan clock.
The E Series boards also have 2 counter/timers onboard that you can use for this purpose. You can set up a retriggerable pulse generation operation, where the counter receives a trigger and then on the user specifications, produces a pulse. You can have that route to the analog input scan clock.
The trigger signal for the counter is that digital pulse. As I mentioned earlier, there is no hardware timing for the digital lines on an E Series board. We do have other digital boards (653x family) that have hardware timed operations if precision is important. If you are satisfied with software's resolution (in the milliseconds), then you can call the E Series board digital function in a loop with a software timer. That digital line can route to the counter to act as the trigger.
So, on the programming side, you can have three separate and independent operations in parallel. One is for the digital function to output on that line every so often. Another is for the counter set at the retriggerable pulse generation. The last is for the analog input. I will describe this in terms of LabVIEW, but it can be done in a similar fashion with the NI-DAQ function calls or Measurement Studio.
The digital examples are in the LabVIEW >> Examples >> Daq >> Digital >> E-Series directory. The Generate Retriggerable Pulse example is in the LabVIEW >> Examples >> Daq >> Counters >> DAQ-STC directory. The E Series boards use the DAQ-STC timing chip.
Go to the LabVIEW >> Examples >> Daq >> anlogin >> strmdisk.llb directory and start with the Cont Acq to Spreadsheet File. This shows how to continuously acquire data and stream it to disk while displaying the data on a chart. Streaming to disk is the efficient way to save data while you are acquiring, as it eliminates the overhead of always opening and closing the file through the iterations of the loop. This saves to a file that can be opened by other applications (Excel, Word, etc.), but it is not as fast as writing to a binary file, which must be opened and read back through LabVIEW. However, for your ~250 Hz rate, it should be fine. Then, go to the LabVIEW >> Examples >> Daq >> anlogin >> anlogin.llb and look at the Acquire N Scans -ExtScanClk example. This shows how to apply the scan clock. Here, the AI Start that you saw in the previous example is replaced by 4 VIs (3 AI Clock Config's and the AI Control). Make those changes to the first example and then add a constant 0 to the AI Control parameter for total scans to acquire. That specifies the continuous operation. The File >> VI Properties >> Documentation menu item of the example describes the physical connections.
If you aren't using LabVIEW, use the NI-DAQ User Manual and the NI-DAQ Help file installed on your machine. You can look at your AT E Series User Manual at the http://www.ni.com/manuals pages for more information on the hardware. Also, if you want to route those signals internally on the board, you can find some entries in the KnowledgeBase at the http://www.ni.com/support pages.
Regards,
Geneva L.
Applications Engineering
National Instruments
http://www.ni.com/ask

Similar Messages

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

  • Time measurement between counter output my device and analog input

    Hello!
    I'm trying to measure the time to generate a digital pulse train on the counter output, that goes to a frequency converter that controls a motor.  So I think it'd be the best way to wire the output of the frequency converter with an analogue input and make a timestamp before I generate the pulse and a timestamp when I recognize the singal, but I think that wouldn't be a serious measurement ?
    What's the best way to measure the time?
    kind regards peter

    hi there
    well, there a several ways to do this. the problem with the software - timestamps is the minimal resolution of 1ms. i'd suggest:
    - wire a copy of the digital pulse train to an analog input channel
    - wire a copy of the frequency converter to another analog input channel
    - create an analog input task with the two channels (the sampling rate defines the timing resolution,make sure to acquire enough samples to see the response signal) 
    - start this task
    - send the digital pulse train
    to optimize your acquisition you can use another copy of the digital pulse train as a start trigger for your analog acquisition.
    -> then you'll see the digital pulse train on one of the analog channels and the frequency output on the other one. both channels have the same time axis with a resolution defined by your sampling rate (~us depending on your hardware). then you can analyze the data.
    search the example finder for examples of how to create tasks and triggers.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • NI DAQmx Digital Output Trigger To Start Analog Input Task

    Hi everyone.  I am using the NI DAQmx VIs to set a digital output line low (boolean '0').  I want to begin reading an Analog Input voltage (Start Analog Input Voltage reading task) right after the digital output line is set low.  I am using the DAQmx Start Trigger (Digital Edge).vi to try and do this.  I have the digital edge to trigger off a falling edge since the digital output line is being set low.  I am using "do/SampleClock" as the source into the DAQmx Start Trigger (Digital Edge).vi.  
    I don't have the DAQ card (PXI 6229) since someone else is using it but I wanted to write up the SW so that when it becomes available I can have SW to try out.
    I have attached the VI.  Am I setting up this VI correctly?
    Thanks!
    Attachments:
    Trigger AI Task Off DO Edge.vi ‏32 KB

    I think you are going to have to wire that Digital Output to a PFI line on the card with the Analog Input(s).  You then trigger on that PFI line.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can i synchronize analog output and analog input timings to generate and measure voltage at the same time.

    how can i synchronize analog output and analog input timings to generate and measure voltage at the same time.

    Read this Tutorial
    http://zone.ni.com/devzone/cda/tut/p/id/3615#toc3
    And also refer to this link where You have repeated this question.
    PS: Please stick to one thread. That way, its easier to keep track of your query and answers

  • Help ! SBLive5.1 and QUAD CD-P - how to swith digital output to PC

    For the moment, my QUAD CD-P seem to be getting the signal but doesn't recognize it. I thought that maybe like a DVD, the digital output had to be switched to ''PCM'' instead of ''bitstream'' but I'm not even sure if the SBLi've 5. has that possibility or if I am mistaken altogether. I would greatly appreciate any hints regarding how this could be possible and with what kind of connections (cables)I would need.

    The Quad CD-P is a CD player wich acts as a pre-amp for the QUAD 99 series. This device only has digital and optical inputs No right or left inputs. No video inputs/outputs whatsoever.
    For the moment, it is now connected to a Quad 99 - Stereo Power Amp with the usual connectors (like the one for composite video, big RCA connectors, also called 'Digital inputs')
    I experienced some problems listening to the sound of my DVD until I found on the internet that I had to switch in my DVD menu the output from Bitstream to PCM. Afterwards, I had no problem listening to my DVD on the QUAD. Of course, with this configuration, out DTS but no problem with regular DolbyDigital. Quad being such a good (and expensi've) system, It doesn't matter that much. But the SBLi've seems to be a problem. As for my DVD, the QUAD pre-amp seems to be receiving the info from my PC but does not 'render' it. No sound is coming from my QUAD from the MP3s that are playing on my PC altough I tried to connecti it with a mini stereo-jack to digital (red and white) that fit on my sound card. Having had a similar problem with my DVD (quite basic actually), I thought that could be the same thing here. I tried several configuration playing with the 'sound and audio device' options from Windows XP's control panel but to no avail.
    I'm not even sure if it is possible to listen to music coming from my computer on this system. That is why I thought I would ask here 'cause I'm getting confused with something I know so little.
    Thanks.

  • How to combine Digital Graphs

    Hi,
    how to combine or merge the 1D array of digital waveform with a simple digital waveform. As givien in the attached VI, I want to display the datalines graph & control lines graph in a single digital waveform graph. 
    Thanks in advance
    Solved!
    Go to Solution.
    Attachments:
    Combine Graph.vi ‏10 KB

    Hi gurum,
    Well, you can use 'Build Array' to merge the 2 1D arrays and connect the output to the Digital Waveform Graph as shown below:
    Hope it helps
    Warmest regards,
    Lennard.C
    Learning new things everyday...

  • How to use Digital output to turn on sensor for Analog Input?

    I am trying to use a digital output to turn on an array of sensors that I then wish to read on 16 analog input lines. I have a 6024E DAQ card. I am planning to take data at 10-20 hz, so not terribly fast, but I will be acquiring for long periods of time (days) so I will be streaming data to disk.
    I have a fair bit of experience in Labview basics, but can quickly get out of my depth when I try something new (like this). I have V6.01.
    It looks as though the best way might be to do the DO and then a single AI as individual events, then write to disk and continue through the loop. I am puzzled, however, how to keep this cycle on schedule given that I don't know how long it will take to sample 16 channels
    , write the data to disk and get back to the starting point... perhaps this is so fast that I don't need to worry about it? The actual timing of the samples (be it 10 or 20 hz) isn't too critical, as long as I can record at what time they were taken... it would be frustrating to find that I was several seconds off after days of data.

    Hello,
    Thank you for contacting National Instruments.
    If you are worried about the time of your acquisition being off, then you should associate each voltage measurement with a timestamp. This will allow you to know the exact time at which the sample was taken and you will never be off. You can use the Get Date/Time in Seconds.vi in our while loop with your AI code so that you can read a sample and read the time. You can than log the voltage value and the timestamp to your file.
    Regards,
    Bill B
    Applications Engineer
    National Instruments

  • How to archive smartform output as PDF and store in External server

    Hi,
    I have requirement on archiving smartform output.
    1.need to archive smartform output as PDF  and need to store the PDF  in FileNet server.
    2.These iPDF need to link to SAP transaction FEBA_LOCKBOX at service for object level.
    I know that it can possible through SAP ArchiveLink feature , also aware that i have to enable Archive and Archive print button in the smartform output.
    If any body can give me some solutions it will be a great help.
    Regards,
    Ratheesh BS

    Hi,
    DATA: T_SSFCTRLOP TYPE SSFCTRLOP.   "FOR SMART FORMS
    DATA: T_SSFCRESCL TYPE SSFCRESCL.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME                 = 'Smart Form Name'
       IMPORTING
         FM_NAME                  = FM_NAME
       EXCEPTIONS
         NO_FORM                  = 1
         NO_FUNCTION_MODULE       = 2
         OTHERS                   = 3
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      T_SSFCTRLOP-NO_DIALOG = 'X'.
      T_SSFCTRLOP-GETOTF = 'X'.
      T_SSFCTRLOP-LANGU = 'E'.
      CALL FUNCTION FM_NAME
        EXPORTING
          CONTROL_PARAMETERS = T_SSFCTRLOP
        IMPORTING
          JOB_OUTPUT_INFO    = T_SSFCRESCL
        TABLES
          G_T_PERNR          = G_T_PERNR.  "(Internal Table).
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'HR_EFI_SHOW_PDF_FORM'
        EXPORTING
          TOP_EDGE  = 10
          LEFT_EDGE = 15
        TABLES
          OTF_TABLE = T_SSFCRESCL-OTFDATA.

  • How to use both digital and analog input modules in the same worksheet - MCC USB1208LS

    Dear all,
    Hi, I am Imran. I am using MCC USB1208LS. I have created the worksheet using digital input module as below and able to execute (run).
    But when i add another analog input module in the same worksheet and executes, An error Message pops-up as in the below image
    I have connected temperature sensor sognal to the analog input of USB1208LS. When using analog input alone in the worksheet, it indiates the actual values. 
    is any black box solve? please guide me. I am attaching in images
    We already placed a purchase order for USB1208FS. Will it sort out my issues?.
    Thanking you,
    Imran Mohamed.
    Attachments:
    present worksheet digital input only.JPG ‏67 KB
    with analog input module.JPG ‏81 KB
    error menu.JPG ‏77 KB

    Hello Imran,
    the USB-1208LS is not capable of running concurrent operations such as an analog input scan and ANY digital Ins, Outs, counter reads, or analog outs.  In Dasylab, the 1208LS is scanning, and nothing else from that particular device can be requested of it while that is happening.
    Yes, using the 1208FS will resolve some of these issues.
    Please refer to the ULHELP.CHM file installed on your computer in c:\program files\measurement computing\daq for details on this issue, et al.
    also I recommend you send your MCC/DASYLab requests for support to [email protected] as MCC staff (that includes me) does not normally monitor NI's Developer Zone.

  • Newbie: 6020E (USB) slow performance with mixed digital and analog input

    Hi,
    I'm using a 6020E to do analog and digital input, and I'm getting very bad performance.
    Please note that doing IO in Labview is new to me!
    I have read the post about 6020E slow performance, and it says I should do buffered IO.
    Can anybody point me to some DOC or SAMPLE that actually shows or explains how one should do this. I need to read several digital IO lines (which I can combine in one port-read), and several analog inputs.
    Seeing how slow the reading on the 6020E is, I am amazed there is only one post that deals with this issue.
    I would be satisfied to get the 6020E into some sort of continuous read mode so that whenever I need data, I get the latest reading right away.
    thanks,
    Peter D'Hoye

    Hi Peter,
    Your cannot do buffered digital I/O with your daqpad. It doesn't have that capability. You can only make direct software calls with digital read/write from/to your port. So your digital IO is completely software clocked and not hardware clocked. The example you are trying is only for specific Simultanuous sampling boards or now also for M-series boards that are able to do correlated DIO.
    Use the Cont Acq&Graph Voltage-Int Clk.vi example for your analog measurements. (NI Example Finder) For your digital IO you can only use the examples like Read Dig Chan.vi, Read Dig Port,...
    There are indeed some slow performance issues with single point I/O Operations, that is correct.
    Check the explaination below:
    DAQPads are offered for the Universal Serial Bus (USB) and the IEEE 1394 (also known as FireWire). Both of these standards use a high-speed serial communication protocol between the computer and the device with a bandwidth up to 12 MB/s for USB and 400 MB/s for FireWire.
    During a single point operation, the DAQ device requires a complete set of configuration commands. This is done through serial communication (USB or FireWire), making the process slower than in a PCI-based board. The speed obtained for single point operation in a DAQPad is system dependent; this means that your computer processor, memory, bus speed, and other factors alter the speed at which you can do single-point operations with a DAQPad.
    For example, on the DAQPad-6020E, timed non-buffered analog input operations are limited to about 50 Hz. At higher rates, the software may become unresponsive. On a FireWire device, you can expect stable operation around 3,000 Hz. But again, these figures are system dependent.
    Regards.
    JV
    NI

  • How can I put a time delay between specific events in a while loop?

    How can I put a time delay between specific events within the same while loop? I'm already using the "wait" command to control the overall loop iteration speed. But I want to time the individual events as well.

    Hi Jesse,
    You can use a flat sequence. In each box you can put your individual events and attached wait.
    Don't forget to reduce your total loop time of the time you added in the individual sequences.
    Doc-Doc
    Doc-Doc
    http://www.machinevision.ch
    http://visionindustrielle.ch
    Please take time to rate this answer

  • How to send the output of one step as input to next step

    Hello All,
                   I have a question that how to send the output of the first step as the input to the next step.
     for e.g
                  consider a test sequence as below,
      1.battery ON.
      2. read Voltage
      3. Check battery voltage.
     as initially the battery gets ON when ever the test starts. in the second step it reads the voltage. let us assume that the voltage is 11.5V,
    in the third step we r checking/validating that battery voltage in the range 11V to 12 V. . I mean if the vloltage value is  less than 11V or greater than 12V te test has to FAIL.
     so in order to check that voltage we need to send the voltage read from the second step.
    so how can I send the voltage read from the second step to the third step so that I can check the battery voltage test.
    kindly suggest me this using LabVIEW/Test stand.

    Hi,
    Why do you need the third step, if the second step is a Numeric Limit Test step type, you can setup the limits of this step for your required limits of 11V and 12V. Your result is returned from your VI to Step.Results.Numeric which will be evaluated in the Status Expression giving you a Pass / Fail status.
    Look at the example TestStand\examples\demo\..\Computer Motherboard Test\computer.seq
    But to answer your reoriginal question, some additional information is required.
    What are your inputs and outputs assigned to in TestStand, do you use the Step properties, Locals, FileGlobals?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Simultaneous serial and analog input DAQ?

    Need to sample from the serial port and 4 channels
    of analog input at the same time. Figured I need
    to use an internal clock to sync the aquisition
    since the serial port response delays every so
    often. Does anyone know how to sample from an I/O
    port and a DAQ card at a consistent sampling
    frequency in LV? Any help would be greatly
    appreciated.
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    [email protected] wrote:
    >
    > Need to sample from the serial port and 4 channels
    > of analog input at the same time. Figured I need
    > to use an internal clock to sync the aquisition
    > since the serial port response delays every so
    > often. Does anyone know how to sample from an I/O
    > port and a DAQ card at a consistent sampling
    > frequency in LV? Any help would be greatly
    > appreciated.
    You don't mention what kind of data rates you are talking about. I have
    put together several systems that combine time-stamped serial and daq
    channels, but in all cases, the serial data was running at around 1 Hz.
    The daq channels were often running much faster (100Hz to 1KHz). If
    your channels fit this description, then it is possible to synchronize
    your data (more or less)
    . You can use software timing to set up the
    slow loop and acquire the serial data, and used buffered A/D to read in
    the appropriate daq channels. The synchronization isn't perfect, but
    may be "good enough".
    Best of luck,
    Dave Thomson
    David Thomson 303-499-1973 (voice and fax)
    Original Code Consulting [email protected]
    National Instruments Alliance Program Member
    Research Scientist 303-497-3470 (voice)
    NOAA Aeronomy Laboratory 303-497-5373 (fax)
    Boulder, Colorado [email protected]

  • ELVIS Scope and Analog input triggering

    Hi everyone,
    I'm trying to read two waveforms, one from the analog input and one from the scope. These waveforms are coming from two sides of a voltage divider and should always be in phase. But I think that there might be a triggering problem. When I change the frequency of the input waveform, my measured waveforms go out of phase.I have programmed each express VI to trigger off of the SYNC.
    I can't use analog inputs for both measurements because the sampling rate is too small. I can't use the scope for both inputs because one of the waveforms is a differential measurement.
    Any help would be appreciated, thanks.

    Hi, I looked at the ELVIS Hardware User Manual and noticed that you have 12 channels that can be used as differential, Reference single ended or non reference single ended. Unless you have them all busy I don't see why you can't use the analog inputs. About the sampling rate, it will be determine by the M Series DAQ device that you are using and the source of the signal. It is a good practice to sample, at least, 10 times faster than the frequency of the input signal. The documentation of the card should show what the maximum sampling rate is.
    Now, Open the example called "Multi-Device Synch-Analog Input-Cont Acquisition.vi" at the NI Example Finder under Hardware Input and Output»DAQmx»Synchronization»Multi-Device. If you get the same results shown in the picture then you need to analyze if the voltage divider is affecting the phase.
    For more information about synchronization check the article called "Synchronization Explained".
    Good luck!
    Alejandro | Academic Program Engineer | National Instruments

Maybe you are looking for

  • How to configure AnyConnect ACL's?

    I am a little new to Cisco ASA's but we bought two new 5540's to use as a new VPN solution for our company. We want to implement Cisco Anyconnect full client and Clientless based solutions for our end users. I am having problems working with setting

  • Hi I am looking for a way to have trace32 open multiple files on remote computers

    Simply put I am looking for someone who could afford to give me a basic script (vbs) that I could run from an elevated command prompt. It would need to be available for me to type in the name of a remote computer or (mulitple if possible) and also al

  • Error While creating a rule for trimming spaces

    Hi All, Please can you tell me the correct syntax for trimming the Spaces from the beginning of the word. I tried like this but it is giving error as below: BEGIN RETURN ltrim($SPACES_TRIM, ''); END ERROR:  The return statement is expected to return

  • My desktop doesn't detect my Ipod nano 6th nor does itunes, and other family computers... What is going on?

    I have an Ipod nano 6th gen, that originally worked when I got it, for like the first week or so. Now after transfering some 600 songs, it doesn't appear when I plug it into my desktop, or itunes. I even tried it on some family computers, and it stil

  • Font size chnage in Long text of PM Task list

    Hi PM gurus, I need to change the 'font size' of  the charecters in the 'long text ' of PM task list as complete task list print can come in one paper.I tried by reducing  the size of sheet from  100% to 75%. But once it saved and agian reopens it ap