DAQ write DAQ read synchronisation

Hi,
I want to create the Low Pass Filter Tester with TestStand. I want to generate sine wave with frequency form 1 to 1k Hz and read amplitude before and after the filter. First of all I have to ensure synchronisation between DAQ read and DAQ write[ http://i79.photobucket.com/albums/j122/thor_tory/1_zpsab4a4c00.png~original ]. I already used a bit modified examplary sine wave generator to analog output VI and read from analog input VI. I put them as subVIs into one VI and then called it in TestStand although the read apmlitude was in many cases not even close to the generated amplitude (like the read was performed too soon). I put all subvis one by one, I also tried flat sequence structure but it was not ok because it stopped in first stage while generating sine wave.
Have you any idea how to make synchronisation between generating signal and acquiring amplitude? And what to match it to given frequency (value of frequency is increased in TestStand)?
Michał
Solved!
Go to Solution.

Thanks for showing me that example, I have somehow problems finding it myself What is the difference in using that built in clock?like in this example:https://decibel.ni.com/content/docs/DOC-26326
Having set the acquisition finite I get an error:
Possible reason(s):
Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.
Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.
Attempted to Read Sample: 50
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0
Task Name: _unnamedTask<4F>
 I've been changing all the values but I keep on getting that error. Is there any way to make everything dependent on the frequency of generated signal(I know it is )? I mean like sine wave f = 100Hz
 so the f_sampling = f * 2.5 (to prevent aliasing), same thing with samples to read, does the amount of them have to be the same for every channel?
Michał

Similar Messages

  • How to combine both DAQ AI signal, write and read file in single VI

    Hi
     I am the new user of LabVIEW version 7.1 for testing automation application. I have to measure 33 signals ( mostly analog like temp, pressure, etc...) from NI USB 6210 DAQ system and write in master file for future verfication.From real data or from master file back up have to write  one more file if only the signal reaches steady state , which will used for analysis and same signals to be read from this file parallely & make a waveform and/or table display format.
    Pl. help me to shortout this problem 
    note: I have plan to ugrade labVIEW version 2011 shortly, so let me know doing parrel acquistion write and read file for data analysis in same VI in version 7.1...... 

    Parallel operations in LabVIEW are very simple.  Just code it in parallel and it will work.
    Try taking a look at some of the examples in the NI Example Finder (Help > Find Examples).  There you will find example for writing to and reading from files, as well as data acquistion in parallel with other operations.
    You might need a producer/consumer architecture is you are acquiring data very quickly.
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file

    Hi
    DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file
    Two main
    sections:
    1)     
    Perform
    write and read operations to and fro different spread sheet files, such that
    each file have a single row of 32bits different binary data (analogous to 1D
    array) where the left most bit is the MSB. I don’t want to manually enter the
    32 bits binary data, I want the data written or read just by opening a file
    name saves with the intended data.
          2)     
    And
    by using test patterns implemented using the digital pattern generator or  build digital data functions or otherwise, I need to
    ensure that the     
                binary data written to a spreadsheet file or any supported file type
    then through the NI-USB 6509 is same as the data read.
    I’m aware I can’t use the simulated
    device to read data written to any port but if the write part of the vi works I
    ‘m sure the read part will work on the physical device which I’ll buy later.
    My Plan
    of action
    I’ve
    created a basic write/read file task and a write/read DAQ task for NI USB 6509
    and both combine in a while loop to form a progress VI which I’m confuse of how
    to proceed with the implementation.
    My
    greatest problem is to link both together with the correct functions or operators
    such that there are no syntax/execution errors and thus achieve my intended
    result.
    This
    project is one of my many assignments for my master thesis, so please i’ll
    appreciate every help as I’m not really efficient with LabVIEW programming but
    I prefer it because is fun and interesting if I get to know it.
    Currently I’m
    practicing with LabVIEW 8.6/NI DAQmx 8.8 Demo versions and NI USB 6509
    simulated device.
    Please see
    the attached file for my novice progress, thanks in
    advance for the support
    Rgds
    Paul
    Attachments:
    DIO_write_read DAQ from file.vi ‏17 KB

    What does your file look like?  The DAQmx write is expecting a single U32 value, not an array of I64. 
    Message Edited by vt92 on 09-16-2009 02:42 PM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • DAQMx Write und read function

    Hello,
    I want to use DAQMx functions for my projekt.. but I do not understand one thing. Wenn I have a differnet Input should I use DAQmx write  and for the Output DAQMX Read? or better said what is the different betwen DAQmx write and Read, When I can used write and read? 

    Hi nichts,
    use the DAQmx read function, if you want to acquire a signal from your card. If you use a differential input, you also use the same vi (DAQmx read) and change the "input terminal configuration" on the DAQmx Create virtual channel vi to differential mode.
    If you want to generate data from your PC and output those data over your DAQ-Card, use the DAQmx write VI.
    If you use the DAQmx driver the first time, I would recommend you the following internet page:
    Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications - Developer Zone - National Instruments
    http://www.ni.com/white-paper/2835/en
    You will find all necessary information about the important part of the DAQmx driver on this page.

  • My first gen ipod mini does no longer sync with itunes 11.0. It says "cannot write or read". Ist this the end?

    My first gen ipod mini (that I use in my car) does no longer sync with itunes 11.0. It basically says "cannot write or read". Is this the "end of life" of that ipod?

    You mean you can't get to the Summary pane?
    If you  have iTunes 11 turn on the Sidebar. Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar. The sidebar is where Devices appears. and Control+B to show the Menu bar

  • Cannot Write or Read to disk Error during iPhone 3g 3.1 sync

    Searched the forum with no luck. Just upgraded to 3.1 on my 3G and I cannot sync without it stopping with the error - Cannot write or read disk. It seems like its almost random on what file it picks to stop on - the file plays fine in iTunes 9. Any suggestions?

    Hi,
    Restore the Touch. There is no easy way to remove files from an iPod as it classes media on the iPod as "read-only" - There are software products that can be used to remove media from an iPod, but it is not an official method and you risk causing more damage.
    If you really need the files on the Touch then use Google to find a program to remove files, there are a few, but do so at your own risk!
    Kind regards,
    Peter.

  • Gpib write or read sometimes hogs cpu

    I have written a simple vi to communicate and
    control a Stanford Research SR640 programmable filter.  It does a
    series of gpib writes and reads to get and set various controls on the
    instrument, and it works very well.  The problem comes when I try to
    call it from a more complex vi that controls the entire experiment. 
    Once the sr640 vi is linked into the big vi, it takes 10-20 seconds for
    the sr640 vi to return and it hogs the cpu, making even the mouse
    unresponsive, Windows task manager stops updating, etc.  This happens
    even when running the simple sr640 vi directly from its front panel
    with no other vi's executing.  In "lightbulb" mode, I can see that
    occassionally, the gpib write or read icons (from traditional gpib
    pallette) take a long time to return, and the cpu goes to 100%.
    If
    I remove the complex calling vi from memory, the problem goes away, ie
    the sr640 vi runs fine.  If I load the big vi back into memory, I
    reproducibly get the bad behavior when running the sr640 vi. Note that the big vi does not need to be running to cause trouble, only be loaded in memory.   If I
    delete the sr640 vi from the big vi, i.e. it is no longer called from
    the big vi, the sr640 vi again runs fine.
    Any idea what might be happening and how to go about debugging this?
    Thanks,
    Bob Shelby

    Thanks for the reply. 
    Attached is the SR640 vi and a calling vi that works just fine.
    Bob 
    Attachments:
    srs_filter_setparms.vi ‏42 KB
    test_sr640.vi ‏17 KB

  • Closing a serial port after executing a for loop of write and reads.

    Hello,
    Labview is opening and then closing each write to the port. I have tried to leave the close outside of the for loop, but labview wont allow it. What do I need to change to make all the writes and reads execute on 1 open and close of the serial port.?
    Thanks.
    Attachments:
    Controller.vi ‏27 KB

    J_es--
         The program that you posted looks to be ok for the most part, you might consider putting an open after your configure (but that's trivial). The other thing that is a minor issue is the loop tunnel coming out of your for loop is currently being auto-indexed.  This function is used to index data for each interation of the loop.  You are using a static address (not an array) and so you don't need this.  If you right-click and remove the auto-index the broken wire will go away. Other than that it should be ok.
         I would suggest looking at one of the shipping examples that come with LabVIEW.  "Basic Serial Read and Write" is essentially the same thing that you are doing and is tested here and might save you a bit of time.  Anyway, take a look if you have a second. Best of luck with your application!
    John H.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How can i write and read the same data

    hi,
             i have attached my program to this mail. i have some problems in this program.
    problems:
    1. I want to select the threshold for the rms,varience and s.d.
    But what i used is not doing that. i want to fix the upper threshold value and lower threshold value.
     when ever the input crosses upper threshold value i want the output and it will remains uptill the value above the lower threshold value.
    Once it come down the lower threshold value the output should be stopped.
    2. I want to write this in to a  file and i want to read this file. is this possible or not. 
                please try to help me i am very new with lab view6i
           REGARDS
    CHAMARTHY KOMAL DILEEP.
       [email protected]
    Attachments:
    dileep.vi ‏93 KB

    The easiest way to perform a certain action (such as file I/O) based on a certain condition (such as whether a value has passed a certain threshold) is to use a comparison VI in combination with a case structure. Then you can specify that if your rms, standard deviation and variance are above a threshold then perform a certain action.
    Also consider using shift registers to keep track of data from the last loop. If I understand you correctly, you want to start logging data when an upper threshold has been passed. Then you want to continue logging data until a lower threshold is passed. I have attached a non-functional but explanatory VI that will help explain how to implement logic to that effect. It also demonstrates that you can indeed write and read from the same file in a loop. The best way to do this is to open the file before the loop, do all the necessary writing and reading in the loop, and then close the file after the loop.
    Hope this helps!
    Jarrod S.
    National Instruments
    Attachments:
    dileep_example.vi ‏61 KB

  • How to Write BUFFER & Read TEXT with Encrypt file ?

    I'm using Windows Phone 8.1 RT.
    I have a issue :
    - I write a BUFFER encrypted to file. After, I read file with TEXT. It's throw exception : No mapping for the Unicode character exists in the target multi-byte code page. (//ERROR 2)
    - I write a TEXT encrypted to file. After, I read file with BUFFER. It's throw exception : The supplied user buffer is not valid for the requested operation. (//ERROR 1)
    Code Write Buffer & Read Text.
    //Write Textstring msg = EncryptText.Text;
    //ERROR 1 - Use 1 or 2
    await WriteTextAsync(this.file, msg);
    //ERROR 1
    //Read Buffer
    string msg;
    //ERROR 1 - Use 1 or 2
    IBuffer buffer = await ReadBufferAsync(this.file);
    StreamReader stream = new StreamReader(buffer.AsStream());
    msg = stream.ReadToEnd();
    //ERROR 1
    Code Encrypt-Decypt.
    public static string EncryptString(string msg)
                var bufferMsg = CryptographicBuffer.ConvertStringToBinary(msg, BinaryStringEncoding.Utf8);
                var bufferMsgEncrypted = Encrypt(bufferMsg);
                var msgEncrypted = CryptographicBuffer.EncodeToBase64String(bufferMsgEncrypted);
                return msgEncrypted;
            }public static IAsyncAction WriteTextAsync(IStorageFile file, string msg)
                return FileIO.WriteTextAsync(file, EncryptString(msg));
    public static IBuffer Decrypt(IBuffer bufferMsg)
                var key = CreateKey(KEY);
                var aes = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7);
                var symetricKey = aes.CreateSymmetricKey(key);
                var bufferMsgDecrypted = CryptographicEngine.Decrypt(symetricKey, bufferMsg, null);
                return bufferMsgDecrypted;
            }public static IAsyncOperation<IBuffer> ReadBufferAsync(IStorageFile file)
                var buffer = FileIO.ReadBufferAsync(file);
                Task<IBuffer> result = Task.Run<IBuffer>(async () =>
                    var Buffer = await buffer;
                    return Decrypt(Buffer);
                return result.AsAsyncOperation();
    Link demo code :
    https://drive.google.com/file/d/0B_cS3IYO936_akE0cmI4bExJMjh0RU9qR3RvWDBWWElZWC1z/view?usp=sharing

    Please provide a working app so this can be tested. You can upload to OneDrive and share a link here.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • NI 6602 Write and Read Frequency

    Hi all ,
    I Have NI 6602 timing card and i'm trying to use it in order to write and read using the
    DAQmxWriteCtrFreq (taskHandle1, 0, 1, 10.0, DAQmx_Val_GroupByChannel, &freq, &duty, &writtenVal, 0);
    and
    DAQmxReadCounterScalarF64(taskHandle2,10.0,&dataVal,0);
    what i'm trying to do is to write to ctt0 and to read from ctr7 ( they are crossed in the card )
    i'm having a bit problems with that can some one give me a tip on how to do it properly ?
    just write freq to ctr0 and read freq from ctr7.....
    Kobi Kalif
    Software Engineer
    Solved!
    Go to Solution.

    You should have the following sample installed on your PC that may help you in this task: DigPulseTrain-Cont.prj (it could be located in \program files\National Instruments\CVIx\samples\daqmx\counter\generate pulse folder)
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How can I write a read a data on a SmartCArd

    Hi everyone...
    I would like to know. how I can write and read a data on a SmartCard maybe through a file(IO)
    could you helpme please??
    Thanks a lot...
    Marcos

    Try this mate
    package com.reader;
    import java.util.List;
    import javax.smartcardio.Card;
    import javax.smartcardio.CardChannel;
    import javax.smartcardio.CardException;
    import javax.smartcardio.CardTerminal;
    import javax.smartcardio.CardTerminals;
    import javax.smartcardio.CommandAPDU;
    import javax.smartcardio.ResponseAPDU;
    import javax.smartcardio.TerminalFactory;
    import com.sun.javacard.apduio.Apdu;
    * @author ic008391
    public class Connector extends Thread
         * @param args
         * @param args
         public static void main(String[] args)
              List<CardTerminal> lct = null;
              Card crd = null;
              TerminalFactory tf = TerminalFactory.getDefault();
              CardTerminals cts = tf.terminals();
              CardChannel cch = null;
              try
                   //create APDU Command
                   Apdu apdu = new Apdu();
                   apdu.command[Apdu.CLA] = (byte) 0X00;
                   apdu.command[Apdu.INS] = (byte) 0XA4;
                   apdu.command[Apdu.P1] = (byte) 0X04;
                   apdu.command[Apdu.P2] = (byte) 0X00;
                   //apdu.command[Apdu.P3] = (byte) 0X0a;
                   byte[] data = {(byte)0xa0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x62, (byte)0x3, (byte)0x1, (byte)0xc, (byte)0x6, (byte)0x1, (byte)0x7F};
    //wallet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xC:0x6
    // select 0x00 0xA4 0x04 0x00 0x0a 0xa0 0x0 0x0 0x0 0x62 0x3 0x1 0xc 0x6 0x1 0x7F
                   lct = cts.list();
                   System.out.println(lct);
                   CardTerminal ct = lct.get(0);
                   crd = ct.connect("T=0"); //Or "T=1"
                   javax.smartcardio.ATR atr = crd.getATR();
                   byte i[] =atr.getBytes();
                   for (int n = 0; n < i.length; n++) {
              int x = (int) (0x000000FF & i[n]); // byte to int conversion
              String s = Integer.toHexString(x).toUpperCase();
              if (s.length() == 1) s = "0" + s;
              System.out.print(s + " ");
                   System.out.println("");
                   System.out.println("ATR"+(atr.getHistoricalBytes()).toString());
                   System.out.println("ATR"+atr.toString());
                   cch = crd.getBasicChannel();
                   sleep(1000);
                   ResponseAPDU r;
                   //r = cch.transmit(new CommandAPDU(apdu.getCommand()));
                   r = cch.transmit(new CommandAPDU(0,164,4,0,data));
                   System.out.println(apdu);
                   System.out.println(r);
                   //Get Balance
                   //0xB0 0x50 0x00 0x00 0x00 0x02;
                   r = cch.transmit(new CommandAPDU(176,80,0,0));
                   System.out.println(r);
                   //cch.close();
              catch (CardException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              catch (InterruptedException e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              finally
                   try
                        crd.disconnect(true);
                   catch (CardException e)
                        // TODO Auto-generated catch block
                        e.printStackTrace();
    }

  • Options for having cFP write and read file

    I have a cFP VI that runs on a cFP 2110 controller for doing process automation on a custom piece of equipment.  It seems that each month we use the same equipment for a slightly different automated process routine.  What I have done in the past is to make a copy of my VI's and real-time project and then make the changes in the code for the new process.  Most of the changes to the code between processes are just changes to numeric controllers to change ramp and slope times or the number of times the code repeats a set of steps.  I have been playing around with writing a sort of configurations page to my VI to allow the user to change some numeric controls, save them to a file using the Read Key.VI and Write Key.VI.  In the simple tests I have done, this works If I have a target VI on the cFP 2110 and a host VI where I can have the configurations page and save the file to my computer's hard drive. 
    The configurations file I would create would probably have 15-30 numeric controls and maybe some string commands.  I have a couple of questions about doing this.  Do I need to go back and create both Target and Host VI and communicate between the two using shared variables, or can I just keep my current VI and write a subVI that would save my files to the cFP controller?  If I save the files to the cFP controller, can user set the numeric controller and save the file and/or  likewise call-up any of say one of say 10 differnet files to populate the various sub-VI and run? 
    Finally, provided that I can write and read these small configuration numeric controller files to the controller, is there any advantage to writing the files to one method or the other: writing to the controller vs, creating a target and host VI to load the data?
    Thank you for the help. 
    Danny
    Attachments:
    Test read write key.vi ‏58 KB

    StepanieO,
    I finally had a change to play around with the cFP file write and read again.  I was able to write a the cFP and read the file back using write to spreadsheet and read from spreadsheet.  The one problem I can't seem to figure out is how you browse the cFP to select a file.  If I enter the file name and path into the string command it works.  But If I try to browse the cFP, the browse button only shows the computer hard drives.  Is there a way to browse the cFP controller for a specific file?
    Thank you for the help.
    Danny
    Danny
    Attachments:
    Write to spreadsheet.vi ‏18 KB

  • How to write and read Japanese on my Nokia E5

    I am trying to find out how I can write and read Japanese on my Nokia E5.
    I even don't knwo if it's possible...
    Does anyone have the answer???

    Hello ikokitakun,
    I believe you have to load a version of software on your phone that has the Japanese language pack in it because the version of software on the phone only has the languages for the region that you bought the phone in. for example if i bought my phone in NZ it would have English, Malaysian and maybe Philippino. There are "dodgey" places you can go to get the software changed but if you do this you void your warranty so be careful. Nokia doesn't condone the changing of regional software.
    Hope this helps
    -Cheers
    "Freedom is the only way, yeah!"

  • How to write and read data in a specific memory location ??

    Hi Everyone:
    Does anyone know how to write and read data in a specific memory location by using Java ?
    I need pointers, but I don't know how to do it ??
    Thanks for answering
    Rodger

    Hi Everyone:
    Does anyone know how to write and read data in a
    specific memory location by using Java ?
    I need pointers, but I don't know how to do it ??
    Thanks for answering
    RodgerWith Java you cannot write to a specific memory location. Java does not have pointers. If you really want to do it, you need to use JNI, i.e write the required functions in C (or other languages that support pointers) and make those functions available to Java (through JNI). This approach is not portable. You can have a look at http://java.sun.com/docs/books/tutorial/native1.1/index.html
    Regards.

Maybe you are looking for