How do I read an AI and DI channel simultaneously in Daqmx?

I'm trying to do something very simple: read a single AI channel and a single DI channel with Daqmx and display them on a waveform chart. It's not working. I'm doing something wrong and none of the sample codes available in the Knowledge base cover an analog input and a digital input. I'm trying to read continuously at 250 samples per second, align the timestamps and display the result on a waveform chart. The analog data shows up twenty seconds later than the digital data when I get anything at all. Please take a look at my diagram and tell me what is wrong. The device is a USB-6218 running on a laptop running Windows XP and LabVIEW 8.2.
Attachments:
Read Daqmx DI and AI channels.vi ‏24 KB
Align Timestamps.vi ‏15 KB
Daqmx Globals.vi ‏9 KB

Could you provide some actual values for sample rate and number of samples instead of those silly globals? Also, you have nothing to configure the digital timing.
I also don't understand your comment about not being able to find an example. There's one called Multi-Function-Synch AI-Read Dig Chan. It's under Hardware Input and Output>DAQmx>Synchronization>Multi-Function. Try that.

Similar Messages

  • How can I read a template and differentiate if it is a pattern matching template or a geometric matching template?

    Hey all,
    I would like to know how can I read a template´s information to know if it is a pattern macthing or a geometric matching template? 
    In my code, users provide templates and the algorithm must match them using pattern matching or geometric matching depending on the template.
    At the moment I am doing it by including a P or a G in the name of the file, but I would like to avoid this and read the information from the file.
    Any ideas?
    Thanks in advance,
    Esteban
    Solved!
    Go to Solution.

    Hey Esteban,
    you can use the VI "IMAQ Is Vision Info Present 2 VI" to reice the information:
    IMAQ Is Vision Info Present 2 VI - NI Vision 2011 for LabVIEW Help - National Instruments
    http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_is_vision_info_present_2/
    Take a look at the attached VI
    Stephan
    Attachments:
    Determine Pattern type.zip ‏13 KB

  • How do I read a character and advance the scanner to the next one?

    Hi,
    I'm writing a lexical and grammar analyzer and I don't usually program in Java. I have a method that reads one character and then parses it. The problem is that it keeps reading the same character over and over again, so my program gets stuck in an infinite loop.
    How do I make it so that BufferedReader advances to the next character in the string?
    Here is the code so far:
    public static void getChar()
                throws FileNotFoundException, UnsupportedEncodingException, IOException {
            BufferedReader reader = new BufferedReader(new InputStreamReader
                    (new FileInputStream(inputFileName), Charset.forName("UTF-8")));
            int c;
            if ((c = reader.read()) != -1){
                if (c != 32)
                    nextChar = (char) c;
                if (Character.isLetter(nextChar))
                    charClass = LETTER;
                else if (Character.isDigit(nextChar))
                    charClass = DIGIT;
                else
                    charClass = UNKNOWN;
            else{
                charClass = EOF;
                //System.out.println("Next Token is: RES_WORD. Next lexeme is: EOF.");
        } //end getChar.At first I just had a while loop, but I want this method to be called from another method and so I didn't think the while loop worked. Is there a better way?
    Help is much appreciated.
    EDIT: By the way, I don't want to read tokens. I need it to be characters. And it doesn't have to be BufferedReader. I'm open to suggestions.
    EDIT2: While I don't want to read tokens, if it's the simplest way then I'm open to it. The scanner class would work for that I guess, but then I would have to do a charAt stuff. I'm open to your insight.
    Edited by: RommelR on Feb 25, 2010 8:39 AM
    Edited by: RommelR on Feb 25, 2010 9:00 AM

    DrClap wrote:
    Every time you call that method, you open a new BufferedReader on the file and read the first character from it. So yes, you always get the same character. Solution: Don't open the BufferedReader in that method. Open it somewhere else, just once, and use it in that method.Thanks. That was stupid of me.

  • Need quick help, please!!! How do I scan the counter and analog channel in parallel, synchronized?

    Hi,
    I'm using LabView6.1 and a PCI6014 DAQ card.
    I have to scan simultaneously an analog channel and the counter on the card. My project requires me to measure in parallel a force (a voltage on an analog channel) in correspondence to a distance (measured with a counter) and I have to display a force-distance graph.
    So, can someone please tell me how can I program the counter and an analog channel to take 1000 measurements in parallel, and then, by reading the buffers to have two sets of corresponding measurements?
    I've tried some things and I've got only an error message, that says that there is no free DMA channel available (the error comes from configuring
    the analog channel). I attached one of these programs that gives this error, maybe somebody can tell me what I do wrong.
    If somebody could send me an example (in LabView6, I have no 7 :-( ), I would be grateful.
    Thank you,
    pixooxiq
    Attachments:
    Scan_Test_4.vi ‏177 KB

    Hi pixooxiq,
    unfortunately, your Card has only one DMA-Channel.
    If you want to use two Channels simutaneously, you have to tell one of them to use an Interrupt instead.
    This option can be set with the "Set DAQ Device Information.VI"
    Just see the Bitmap, I've attached.
    Perhaps, you now get Performance-problems, cause the IRQ does not directly write the Data but involves the CPU. In this case the only possibillity is to use an other card with more than 1 DMA-Channel...
    Regards
    Peter Weber
    NI Germany
    Attachments:
    Interrupt2.bmp ‏159 KB

  • How to divide audio in Left and Right Channel?

    Hi there,
    I want to divide audiofiles into the left and right channel, but I keep forgetting the shortcut.
    Can anyone give me the shortcut again?
    Thanks a lot

    If you have two audio clips of the same duration, you can select (highlight) both, then hit Option l (lowercase L) to make them a stereo pair. The pan will be set to -1 indicating that channel 1 will be routed to the left output channel and channel 2 will be routed to the right output channel.
    -DH

  • How do I read txt file and add items to dropdownlist or checkbox

    I want to add items to a dropdown or check box by reading from a text file(and select one of them). (I donot use any table or database). The list of items is sometimes upto 20MB and hence cannot populate using session bean.I want items to be added to either checkbox or listbox during a button action. I have done this for textarea but unable so far to acheive for checkbox or listbox. I use following code which does not work:
    public String button3_action() {       
    try{           
    FileReader fr = new FileReader "F:/CreatorProjects/checkboxtst.prs");
    BufferedReader br = new BufferedReader(fr);
    String s;
    while((s=br.readLine())!=null) {
    dropdown1.setValue(s);
    br.close();
    fr.close();
    }catch(Exception e) {
    e.printStackTrace();
    return null;
    I know I cant just transplant textarea code for dropdownlist or checkbox.
    Any help is greatly appreciated.
    Thanks.
    Dr.AM.Mohan Rao

    I am able to read from txt file to a listbox if i write in sessionsbean1:
    try{
    FileReader fr = new FileReader("F:/CreatorProjects/checkboxtst.prs");
    BufferedReader br = new BufferedReader(fr);
    String s1="";
    String s="";
    while((s=br.readLine())!=null) {
    s1 = s1+s;
    s1= s1+"\n";
    disOptions = new com.sun.rave.web.ui.model.Option[] {              
    new Option(s1,s1)};
    diseases = new String[] {};
    fr.close();
    br.close();
    catch(Exception e) {
    e.printStackTrace();
    But I get all data in one line!! if I click submit button text area gets all. How to display items in each line????Please help...
    Dr.AM. Mohan Rao

  • How can I read an audiobook and make it appear on iTunes?

    ?

    Record yourself reading a book, then put it into itunes
    Adding music and other content to iTunes - Apple Support

  • How can I use web-console and element inspector simultaneously in Firefox 20+ as I could in Firefox 19-?

    Yes, new web-developer all-in-one tools are total mess.
    I didn't find the answer to this question either https://support.mozilla.org/en-US/questions/955612 but downgrade to Firefox 19.
    But nor in Nightly, nor in Aurora, nor in Firefox Beta, nor in Firefox 20.0 I can use simultaneously web-console (where I test some style changing javascript code) and element inspector (where I instantly observe a reaction to my code). The only option I see is to switch every three seconds between them. How can I fix this except downgrading?

    You can consider to use the DOM Inspector extension instead of the built-in Inspector.
    *DOM Inspector: https://addons.mozilla.org/firefox/addon/dom-inspector-6622/

  • How to program both Polled IO and Explicit Messaging simultaneously V2.0.2

    There is an example of Polled IO V2.0.2, which I can connect to 6 devices and read.
    There is an example of Explicit Messaging V 2.0.2.
    How can I Open both connections to all devices to get polled data and explicit data and settings?

    Hello NetworkNocturnal,
    Can you please give a few more details on your application set-up? Are all 6 devices FieldPoint and on the same network? Are they all in the same project and are you currently using just one VI to execute the Polled IO? Have you tried just doing the Explicit Messaging VI on it's own as well?
    Regards,
    Deborah Y.
    LabVIEW Real-Time Product Marketing Manager
    Certified LabVIEW Architect
    National Instruments

  • How to temporally match/save Input and Output Channels's data?

    Hello, I have a voltage-input, voltage-output SISO system, and need to indentify its dynamic response (or transfer function) as a reference to a PID control. Without using the system identification toolbox, my goal is to generate/provide a sine sweep input (ranging 1Hz-5kHz for 10sec) to the system and to save the corresponding output response signal as well as the sweep input signal simultaneously.
    I got a sample program online and am trying to modify it as attached, but I really need your advices/comments concerning several problems I am facing with:
    1) With the below setting, the number of the acquired Input channel samples obtained is 5461, which is smaller than expected (i.e., 10000). What would I be missing in setting parameters?
    - H/W: NI-USB-6341 DAQ
    - AO: continuous samples with the waveform timing (1k sampling, 10000 samples => 10 sec, slower sampling just for testing purpose)
    - AI: continuous samples, samples to read: 30k, rate: 1k
    2) I am using flat sequence structure as a way to making the start point of saving AI and AO data same, but wonders if this is a right method or if there is other better approaches. (I had an idea of using an internal clock with "1-sample mode" for sync, but this may not work at the high speed sine sweep like 5kHz, right?)
    3) I just want to provide the sine sweep just once to the system and do not require the "reset" functionality implemented in the original sample program. I failed to remove this "reset" part as I did not fully understand the sample code. If I run the attahed, the generated AO signal is periodically provided to the system. Please give me any advice to modify the program as I want.
    Thanks for your help and valualble time.
    Attachments:
    siso.vi ‏230 KB

    Hi J. Kim,
    To begin, you say you want to synchronize your analog input and output so that they start at the exact same time, yes? To achieve tight synchronization, you need to use DAQmx VIs instead of the DAQ Assistant. There's a good overview of DAQmx VIs  here. There's also a document that deals specifically with synchronization in DAQmx here. Additionally, if you go to Help>>Find Examples in the LabVIEW example finder, you can see many other examples of acquiring data using DAQmx.
    As for your configuration, you have your analog input DAQ assistant wired far before your analog output DAQ assistant in your sequence strucutre, so the dataflow of the program will cause the analog input DAQ Assistant to execute before the output. They cannot be in different sequences if they are executing simoultaneously, and I would not use flat sequences here except to start the two tasks in DAQmx. Where did you find this example?
    Best,
    Dan N
    Applications Engineer
    National Instruments 

  • How do I display my music and my playlists simultaneously?

    With the new iTunes software, I can't figure out how to have a playlist open at the same time as my music library.

    The iphone is not a storage/backup device.  The sync is one way - computer to iphone. The only ex eption is itunes purchases: File>Deviecs>Transfer Purchases
    Copy everything from your old computer or your backup cop of your old computer.

  • How to transmit counter input data of different channels simultaneously?

    Hello.
    I'm using X-series PCIe-6361 DAQ board which have 8 DMA channels and Labview 8.2.1. I upgraded the version of DAQmx as 9.0 which supports the X-series devices and confirmed the board worked normally on my system.
    I'm trying to measure the pulse width continuously from 4 different pulse trains with CMOS level. The frequencies of signals are same but the pulse width and phase are varying with respect to time.
    http://zone.ni.com/devzone/cda/tut/p/id/9376
    From the tutorial page of NI X-series, I saw the following expression "X Series also includes eight DMA channels to stream data directly
    between the device and PC memory without CPU interaction or additional
    programming effort. These eight channels provide parallel data streams for the analog I/O, digital I/O, and all four counter/timers."
    But when I started the Labview programming, I realized that the counter functions of different channel cannot be put into a single task. So I couldn't help but separate the read functions into 4 individual tasks and there are timing differences in data transmission between channels up to 250 micro-sec because of the sequential running.
    How can I eliminate the timing difference and realize parallel data streams for the counter?

    Check out these links. I hope that they help!
    Fieldpoint and RT
    Logging Data with a FieldPoint FP-20xx to View in a Web Browser
    Transferring Files from a FieldPoint FP-20xx through an FTP Server
    Introduction to Using DataSocket Commands to Communicate with FieldPoint Etherne
    t Network Modules
    Good Luck!
    Mike
    NI

  • How can i messure temp on 2 diff channels simultaneous on a USB-9161 Carrier ?

    Hello, I was wondering if u can help me with a small problem, with my USB-9161 Carrier. I intend to messure temperature with two thermocouples on 2 physical channels of the device, in the same time. Do i need a special VI for this operation ? As far as I have seen the VI promps me to select a single phisical channel. Can I record data for both thermocouples? Thank you so much

    Hi Tzaca,
    Can you clarify which module you are using within your 9161 Carrier. The 9161 does not contain any data acquisition functionality by itself but enables certain C-Series modules to interface with your PC via USB. For Thermocouple measurements the ideal module would be the NI 9211 for your purpose, however other modules will work that contain the appropriate signal conditioning. I.e. Cold Junction Compensation (CJC).
    Assuming you have an appropriate module however you can record from both thermocouples using a LABview programming technique called synchronization. I have found an article on the NI Developer Zone website that explains this principle well using LabVIEW 2010. Take a look at this and see how you get on.
    Easily Synchronize Your Measurements in LabVIEW 2010
    http://zone.ni.com/devzone/cda/tut/p/id/11549
    If you need any more assistance with this let me know how you get on and I'll try and help you further.
    Matt T
    Matthew Trott
    Applications Engineer
    National Instruments UK
    www.ni.com/ask

  • How can I read two channels with fieldpoint and labview

    I'm trying to read two or more channels with the TC 120, and I follow the examples of sopport page, but doesn't work.
    What can I do?

    For more information about reading or writing to or from multiple channels in Fieldpoint, please refer to:
    How Do I Read or Write to Multiple Channels on a Fieldpoint Module in LabVIEW?
    This should enable you to read multiple channels. The only other option available is to use one fp open.vi, multiple Create Tag.vi's and multiple FP Tag Read.vi's.

  • How can I read a file with ASCII Special Character into a SQL table using SSIS 2008?

    I've tried everything to read this file and am getting no where.   Help how can I read this file and load a SQL table?
    RS - AscII - 30  (Record Separator)
    GS - AscII - 29 (Group Separator)
    Thank you for your assistance - Covi
    Mark Covian

    We can use script component as source/transformation to read the text file and assign the contains to a string. Split the string by chr(30)  i.e RS and finally stored into an array or write to the output buffer of the script component.
    For example on how to use script component refer this link
    http://social.technet.microsoft.com/Forums/en-US/6ff2007d-d246-4107-b77c-624781baab38/how-to-use-substring-in-derived-column-in-ssis?forum=sqlintegrationservices
    Regards, RSingh

Maybe you are looking for

  • [Solved] KDE desktop crashed when i close the flash music player

    My desktop is kde  4.7.3-1, and the kernel is linux-3.1.4-1. Just as the Title, those days everytime when I close the flash music player"http://player.mbox.sogou.com/player" in firefox, my desktop crashed, and my desktop panel disapeared for a while.

  • Safari 2.0.3 - Pages load with no images or some images

    Hi I just bought a new iMac Intel. It comes with safari 2.0.3 Any page on the web loads without the images. In place of the image is a ? icon. If I hit the reload button a few times, the images load up. Sometimes even after a dew reloads, some images

  • Invoice Block - Tolerance Key - Can currency can be changed??

    Hi Gurus, We can set the below in SPRO, Material Management->Logistic Invoice verification->Invoice Block->Set Tolerance Limit-> Here we can maintain for company code / Tolerance Key and details. While we maintaining the tolerance key, depending upon

  • Can i put images on a button

    Hi i have some omages which i need to put on a button can i do that in java. I cannot use swings cause i am using java 1.1.7. can i do something using awt. Is there ImageButton in jdk 1.1.7 ??? Please help me in this. Please post a sample code if any

  • Had to reset iPod.  Now it will not allow me to get my WIFI

    I had to restore my iPod and now it will not let allow my WIFI to update the iPod.  I do not know if it is because of other WIFI systems in my area. Someone uses NETGEAR, another uses ATT904.  When they are in use I cannot use my iPod.  I have called