Write multiple waveforms in TDMS

Hi everyone,
Here is my problem, I have 5 waveforms with 3 y values each and I would like to write these 5 waveforms in a TDMS file.
But when I connect a simple waveform to the "TDMS write" function it's work, but when I connect mulitple waveforms, the wire is broken:"Polymorphic terminal cannot accept this data type".
Thank you for your help!

Can you post some code?  When I try to wire an array of waveforms, the TDMS Write takes it just fine.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Display multiple Waveform-Graphs on a separate Frontpanel

    Hi there,
    I'm looking for a solution to display multiple waveform-graphs on a separate frontpanel.
    In my application I measure a number of channels (number is a user-input). The signals I want to display each in a separate waveform-graph, because they have different scales. They shall be arranged that way, that the user can switch them on and off or arranges them on the screen, while the application is running (measuring). He shall also be able to maximize all graphs or a graph window to have a closer look at the signals.
    I already tried several things.
    1. I placed the maximum number of graphs in a separate vi, which I start in my application and then switch the frontpanel on and off via a property-node. The values I also write via the references of the waveform-array, which I place in an array. This way I can also change the propertys of each plot (scale, xmin xmax, etc), but I always have all graphs on the screen (also the unused).
    2. I then tried to change the visible-property of the unused graphs, but I cannot scale and rearrange the remaining graphs to the full frontpanel-size, because this property is read-only.
    3. I placed just one waveform-graph in the vi and then start as many vis, as I need. This is cool, because I also can program the position and size of each frontpanel, so that they are arranged in a grid on the display, but all the graphs are separate and it is uncomfortable if the user had to arrange them separate. The windows need to be docked ore something like that.
    4. I tried to place the graph-vis in subpanels, but then I cannot change the position and size of the vis programmatically.
    Has anyone an idea, how to solve this?
    I am using LabView2009Sp1 Professional Development System
    Thanks Norman

    Thanks so far,
    I attached some examples of what I tried already.
    1. MaximumNumberOf Graphs - I show 6 graphs although only two are needed. I cannot rescale the used ones to the full screen size, because the property is read-only
    2. RescaledFrontpanel - I switch the unused graphs to invisible, resize the frontpanel to hide the unused graphs, but now the window is not zoomable
    3. GridOfWindows displays the desired grid of graphs in separate windows, but they don't stick together
    I hope this explains the situation better.
    Norman
    Attachments:
    multigraph.llb ‏136 KB

  • Write named waveform to 6551

    I am trying to write 4 name waveforms to onboard memory on five PXI-6551's and call them in my program as i need them. I have tried make a very simple VI to write a few bits to one board but it gives me this error: "niHSDIO Write Named Waveform (1D U32).viDriver Status: (Hex 0xBFFA0011) Function or method not supported." anyone know why I cant seem to figure it out?
    Thanks,
    Brian

    Hey Brian,
    I don't know off of the top of my head, but try to run the example "Dynamic Generation of Multiple Waveforms.vi from the NI Example Finder and see if it works with your board. Tell me what you find when you run that example.
    Sincerely,
    Gavin Goodrich
    Applications Engineer
    National Instruments

  • Legend for multiple waveform chart

    I have a Waveform Chart (and legend) with multiple waveforms.  I can control the visibility of a given waveform on the chart programmatically using the "ActPlot" and "Plot.Visible?" properties.
    Is it possible to programmatically make the legend only contain the plot names that are visible at any given time?
    Cheers,
    Dan
    Dan
    CLD

    Hello DanB,
    Following along the lines of what smercurio_fc suggested, you can use the Legend>Number Of Rows property (LegNumRows) to change the number of rows of your legend to the number of plots you are viewing, and then use the Plot>Plot Name property (Plot.Name) to edit the names of the plots yourself. I cannot see a property to extract these names dynamically, so this is probably your best bet.
    I hope this helps, otherwise please do let us know if there is anything further,
    Kind Regards,
    Michael S.
    Applications Engineer
    NI UK & Ireland

  • In thei recipient tab  Email address-shall i write multiple users id?

    in the  information broadcaster ->setting screen-> recipient tab  Email address-shall i write multiple users id?

    it depends on your requirement.
    If you want to send it to multiple users than yes

  • RandomAccessFile: How do I Clear the txt file and write multiple lines of..

    Hello all,
    I am a 6th grade teacher and am taking a not so "Advanced Java Programming" class. Could someone please help me with the following problem.
    I am having trouble with RandomAccessFile.
    What I want to do is:
    1. Write multiple lines of text to a file
    2. Be able to delete previous entries in the file
    3. It would also be nice to be able to go to a certian line of text but not manditory.
    import java.io.*;
    public class Logger
    RandomAccessFile raf;
    public Logger()
         try
              raf=new RandomAccessFile("default.txt","rw");
              raf.seek(0);
              raf.writeBytes("");
         catch(Exception e)
              e.printStackTrace();
    public Logger(String fileName)
         try
              raf=new RandomAccessFile(fileName,"rw");
              raf.seek(0);
              raf.writeBytes("");
         catch(Exception e)
              e.printStackTrace();
    public void writeLine(String line)
         try
              long index=0;
              raf.seek(raf.length());          
              raf.writeBytes(index+" "+line);
         catch(Exception e)
              e.printStackTrace();
    public void closeFile()
         try
              raf.close();
         catch(Exception e)
              e.printStackTrace();
         }

    Enjoy! The length of the code is highly attributable to the test harness/shell thingy at the end. But anyway seems to work nicely.
    import java.io.*;
    /** File structure is as follows. 1st four bytes (int) with number of live records. Followed by records.
    <p>Records are structured as follows<ul>
    <li>Alive or dead - int
    <li>Length of data - int
    <li>Data
    </ul>*/
    public class SequentialAccessStringFile{
      private static int ALIVE = 1;
      private static int DEAD = 0;
      private int numRecords, currentRecord;
      private RandomAccessFile raf;
      /** Creates a SequentialAccessStringFile from a previously created file. */
      public SequentialAccessStringFile(String filename)throws IOException{
        this(filename,false);
      /** Creates a SequentialAccessStringFile. If createnew is true then a new file is created or if it
          already exists the old one is blown away. You must call this constructor with true if you do
          not have an existing file. */
      public SequentialAccessStringFile(String filename, boolean createnew)throws IOException{
        this.raf = new RandomAccessFile(filename,"rw");
        if(createnew){
          truncate();
        this.currentRecord = 0;
        this.raf.seek(0);
        this.numRecords = raf.readInt();
      /** Truncates the file deleting all existing records. */
      public void truncate()throws IOException{
        this.numRecords = 0;
        this.currentRecord = 0;
        this.raf.setLength(0);
        this.raf.writeInt(this.numRecords);
      /** Adds the given String to the end of this file.*/
      public void addRecord(String toAdd)throws IOException{
        this.raf.seek(this.raf.length());//jump to end of file
        byte[] buff = toAdd.getBytes();// uses default encoding you may want to change this
        this.raf.writeInt(ALIVE);
        this.raf.writeInt(buff.length);
        this.raf.write(buff);
        numRecords++;
        this.raf.seek(0);
        this.raf.writeInt(this.numRecords);
        this.currentRecord = 0;   
      /** Returns the record at given index. Indexing starts at zero. */
      public String getRecord(int index)throws IOException{
        seekToRecord(index);
        int buffLength = this.raf.readInt();
        byte[] buff = new byte[buffLength];
        this.raf.readFully(buff);
        this.currentRecord++;
        return new String(buff); // again with the default charset
      /** Returns the number of records in this file. */
      public int recordCount(){
        return this.numRecords;
      /** Deletes the record at given index. This does not physically delete the file but simply marks the record as "dead" */
      public void deleteRecord(int index)throws IOException{
        seekToRecord(index);
        this.raf.seek(this.raf.getFilePointer()-4);
        this.raf.writeInt(DEAD);
        this.numRecords--;
        this.raf.seek(0);
        this.raf.writeInt(this.numRecords);
        this.currentRecord = 0;
      /** Removes dead space from file.*/
      public void optimizeFile()throws IOException{
        // excercise left for reader
      public void close()throws IOException{
        this.raf.close();
      /** Positions the file pointer just before the size attribute for the record we want to read*/
      private void seekToRecord(int index)throws IOException{
        if(index>=this.numRecords){
          throw new IOException("Record "+index+" out of range.");           
        if(index<this.currentRecord){
          this.raf.seek(4);
          currentRecord = 0;     
        int isAlive, toSkip;
        while(this.currentRecord<index){
          //skip a record
          isAlive = this.raf.readInt();
          toSkip = this.raf.readInt();
          this.raf.skipBytes(toSkip);
          if(isAlive==ALIVE){
               this.currentRecord++;
        // the next live record is the record we want
        isAlive = this.raf.readInt();
        while(isAlive==DEAD){
          toSkip = this.raf.readInt();
          this.raf.skipBytes(toSkip);
          isAlive = this.raf.readInt();     
      public static void main(String args[])throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Create a new file? y/n");
        System.out.println("(No assumes file exists)");
        System.out.print("> ");
        String command = br.readLine();
        SequentialAccessStringFile test = null;
        if(command.equalsIgnoreCase("y")){
          System.out.println("Name of file");
          System.out.print("> ");
          command = br.readLine();
          test = new SequentialAccessStringFile(command,true);     
        }else{
          System.out.println("Name of file");
          System.out.print("> ");
          command = br.readLine();
          test = new SequentialAccessStringFile(command);     
        System.out.println("File loaded. Type ? for help");
        boolean alive = true;
        while(alive){
          System.out.print("> ");
          command = br.readLine();
          boolean understood = false;
          String[] commandArgs = command.split("\\s");
          if(commandArgs.length<1){
               continue;
          if(commandArgs[0].equalsIgnoreCase("quit")){
               test.close();           
               alive = false;
               understood = true;           
          if(commandArgs[0].equalsIgnoreCase("list")){
               System.out.println("#\tValue");
               for(int i=0;i<test.recordCount();i++){
                 System.out.println(i+"\t"+test.getRecord(i));
               understood = true;
          if(commandArgs[0].equalsIgnoreCase("truncate")){
               test.truncate();
               understood = true;
               System.out.println("File truncated");
          if(commandArgs[0].equalsIgnoreCase("add")){
                test.addRecord(commandArgs[1]);
                understood = true;
                System.out.println("Record added");
          if(commandArgs[0].equalsIgnoreCase("delete")){
                int toDelete = Integer.parseInt(commandArgs[1]);
                if((toDelete<0)||(toDelete>=test.recordCount())){
                  System.out.println("Record "+toDelete+" does not exist");
                }else{
                  test.deleteRecord(toDelete);
                  System.out.println("Record deleted");
                understood = true;
          if(commandArgs[0].equals("?")){
               understood = true;
          if(!understood){
               System.out.println("'"+command+"' unrecognized");
               commandArgs[0] = "?";
          if(commandArgs[0].equals("?")){
               System.out.println("list - prints current file contents");
               System.out.println("add [data] - adds data to file");
               System.out.println("delete [record index] - deletes record from file");
               System.out.println("truncate - truncates file (deletes all record)");
               System.out.println("quit - quit this program");
               System.out.println("? - displays this help");
        System.out.println("Bye!");
    }Sample output with test program
    C:\>java SequentialAccessStringFile
    Create a new file? y/n
    (No assumes file exists)
    yName of file
    mystringsFile loaded. Type ? for help
    add appleRecord added
    add orangeRecord added
    add cherryRecord added
    add pineappleRecord added
    list#       Value
    0       apple
    1       orange
    2       cherry
    3       pineapple
    delete 5Record 5 does not exist
    delete 1Record deleted
    list#       Value
    0       apple
    1       cherry
    2       pineapple
    add kiwiRecord added
    list#       Value
    0       apple
    1       cherry
    2       pineapple
    3       kiwi
    quitBye

  • Display multiple waveforms on chart

    I need help.  I try to display multiple waveforms on a single chart.  Two waveforms (Ideal PWM and Target Pressure) are made up of a single point instead of waveform or array; thus I have to build them into array.  The problem is that I can display all the waveforms, but once awhile the chart shows a missing point on the waveform.  I have attach a screen shot of my diagram.  I'm using LV 8.6.  Can anyone help?  Thank you very much.
    BC  
    Message Edited by DSI on 04-14-2008 11:46 AM
    Attachments:
    Display Waveforms.doc ‏163 KB

    I would suggest creating an array based on the size of the other waveforms that are being graphed. Presumably you have a certain number of points for all the other waveforms, and they all have the same number of points for that iteration. Thus, create a Y array for the 2 values that you want to graph to be of the same size, rather than a single point. If you run the attached VI in highlight mode you can see what I mean.
    Attachments:
    chart with lines.vi ‏18 KB

  • I am trying to write multiple lines high

    I have LV 5.0, PCDIO-24 card & WinME
    I am trying to write multiple lines high, but when I write one high
    the others reset. I read about the 8255 chip problem & found an
    example vi on NI's website that maybe a work-around, but it won't run
    with 5.0. I am somewhat new to Labview and request help! How can I
    open "Write to Multiple Digital Lines.vi" with 5.0,
    or does someone have an similar example vi?
    My vi has 3 different delay timers that try to write data high when
    they countdown to zero. They work fine one at a time but not when I
    put them into a single vi and run them all at once.
    Thanks,
    MikeB

    Dennis Knutson wrote in message news:<[email protected]>...
    > I think your problem is that you're using something like Write to
    > Digital Port.vi which writes to all lines. Use the lower level
    > function DIO Port Write.vi and set the line mask. The line mask is
    > used to determine which lines to write to and which lines to leave
    > alone. For example, if at one point you just want to write to bits
    > 5,6,7, set the line mask to 1110000 (assuming 8 bit port). If at
    > another point, you just want to write to bits 0,1,2, you would set the
    > line mask to 00000111.
    When I try to set the line mask of "DIO Port Write.vi", it won't allow
    me to have a 0 as the first digit. If I enter 00001111 for example,
    the zeros dis
    sappear as soon as I click the check-box. (the line mask
    box will reset to 1111). What am I doing wrong?
    Thanks for the help!
    MikeB

  • Modbus write multiple registers wrong version

    I'm using NI Modbus.llb, found on the NI site somewhere...
    Now I found broken wires in calling vi because of MB Serial Master Query Write Multiple Registers (poly).vi has one output to less (probably the written content, read afterwards... to check...)
    Where can I find the proper MB Serial Master Query Write Multiple Registers (poly).vi ?
    thanks 
    Solved!
    Go to Solution.

    it seems that i will need an older version than 1.2.1
    Attachments:
    MB Serial Master Query Write Multiple Registers (poly) causes broken wire.docx ‏65 KB

  • Log an arbitrary waveform to TDMS

    I'm trying to log an arbitrary waveform (one that is not time-based, e.g. x0 = -180, dx = 0.25) to a TDMS file.  For some reason I can't figure out how to do this.  It appears that I am only able to log time-based waveforms to a TDMS file. I tried to cast my x0 to a timestamp but it coerces negative values to a zero timestamp.  I have all my data being displayed on waveform graphs perfectly fine with a x0, dx, Y cluster.
    So, is there a way to log my waveform to TDMS without requiring any post-processing?

    If you cast a negative to timestamp, LabVIEW doesn't coerce negative values to a zero timestamp. By default, 0 means timestamp '0:00:00 AM 1/1/1904', so -180 will be casted to timestamp as '11:57:00 PM 12/31/1903'. The number is treated as seconds.
    TDMS only accepts time-based waveforms. If you want to give different meanings to the t0 and dt of the waveform, you should need some post-processing. In TDMS files, t0 will be mapped to 'wf_start_time' property, dt will be mapped to 'wf_increment' property. At the same time, TDMS file will add another property 'wf_start_offset'. So, if you treat t0 as 0, then you can set  'wf_start_offset' property as -180 to meat your requirement.

  • Continuously measure and write waveform using tdms

    Hello everyone,
    I am doing my thesis using Labview 2010(since it is only version avaliable in University currently ). I need to read and record data from microphone(currently using simulate signal since i need to make program work first) then save and analise it(didn't reach that point yet). I tried to use event structure so i can record and then read tdms file. But unfortunatly it records only small piece, then i inserted while loop so it will record continuosly but program doesnt respond after i push record and i can only close it manualy from toolbar. Please could anyone help me or suggest something since i am not very good at Labview and any feedback is welcome. Here is what i have done till now. I tried to search forums for some similar solution but could not find anything usefull(some had much newer version so i could not open). Thank you.
    Solved!
    Go to Solution.
    Attachments:
    test2.vi ‏45 KB

    Hi and welcome to the forums,
    The reason you cannot stop the recording of the waveform or exit the application is because you have the event case configured to "lock panel until the case for this event completes" (in edit events). This means that LabVIEW will not respond to user interaction until that event structure completes but because you rely on being able to press the while loop stop button to finish the event structure means you have a deadlock and have to abort the VI.
    The architecture of your application is not ideal - I would strong advise against having anything that takes a long time to execute inside your event structure for the very reason above (obviously you can untick lock panel as a quick solution). I would suggest having a look at the producer/consumer design pattern (events) (new... > from template > frameworks) as this would be more appropriate for your application. You can handle your button presses in the top event structure and have a state machine in the bottom loop for starting, running and stopping your data acquisition.
    The idea is that you only do very little inside the event structure so it frees up the front panel but the messages (e.g. start/stop acquiring data, exit application) are handled by another loop.
    I don't know if it ships in LabVIEW 2010, but in 2012/2013 there are sample projects that include a "continuous measurement and logging" project which might be suited to your application. There are also examples for state machines and queued message handlers.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Saving FFT PSD waveform to TDMS file maintaining x-axis scale

    Hi all,
    I'm having trouble saving a Power Spectral Density waveform to a TDMS file because the method I'm using is losing the x-axis (frequency) scaling. The only way I can get it to save is extracting the magnitude from the waveform and saving that in the TDMS file. This loses all the frequency information.
    Does anyone know how I can save the PSD information in a TDMS file or failing that, any type of file?
    Thank you,
    Donners
    Solved!
    Go to Solution.
    Attachments:
    PSDs Frequency 2.JPG ‏89 KB
    Data Calculations TDMS 4.zip ‏120 KB
    Filtered Data.zip ‏240 KB

    Hi,
    As my understanding, you are trying to log the PSD to "Power Spectral Density" channel, but you do it wrong with double array. TDMS write don't accept cluster as input, but accept waveform.  I have updated the VI and the PSD in TDMS file viewed as
    Attachments:
    Data Calculations TDMS 4.vi ‏177 KB

  • Export Multiple Waveforms to Spreadsheet

    Hey guys, I'm new to this forum--first post--so if I accidentally leave anything out please do your best to whip me into shape.
    I just started with labview this week and am trying to collect data from Advantech's USB-4718. It has 8 thermocouple inputs with which I am attempting to simultaneously collect temperature readings and export them all to a .csv. The VI I've come up with so far is my best attempt at getting the formatting of the .csv to come out correctly. In that respect it does exactly what I want it to, however, it will only give me a single reading from each of the channels. So basically I am looking for some advice on how to append the array of waveforms anew with each iteration of the for loop, or if I should be building the array of data a bit differently.
    I'm hoping this is a simple matter of looping the appropriate VIs, or simply putting a shift register in the right place. I realize I may have to simply use brute force to index and collect waveform components and just feed them into the write to spreadsheet VI, but I'd like to explore some cleaner alternatives before I get into all of that.
    In addition, after reviewing this forum I realize I am surely prone to some mistakes that simply scream noob. So feel free to scream it at me. I'm pretty sure I made a nice CPU burner out of my VI, but I'm not entirely sure so if anyone could give some advice on avoiding those. Also if anyone has any advice for a new LabVIEW user in general--what to watch out for, goals to work towards--I'm all ears. I have a very demanding summer job that requires I learn and use all this stuff and I'd very much like to rise to the challenge.
    Cheers,
    Travis.
    Attachments:
    Multiple Channel Export (rev3).vi ‏72 KB

    The problem apears to be with your array appendixing, and as you correctly guessed your shift registers. If you simply rearrange the components to look like:
    then it should do exactly what you want it to do.

  • Multiple waveforms to spreadsheet

    I am aquiring episodic data, say 2seconds at 20kHz then a 30 second interval and more data. I am saving this in a tdms file and all is fine. 
    I would now like to export these waveforms to a tab delimited spreadsheet, and I like the header etc that the cannede vi's offer. However when I set the append option to false, there is a new file for each waveform. When I set it to true, the next waveform gets appended at the bottom (same columns, new rows) instead of as new columns same rows. With the write array to spreadsheet, there is a transpose option. Is there something analogous for waveforms, or will I just have to use the write to spreadsheet and make my own headers etc?
    thanks a ton!
    (Using LabView2013 on Win7)

    No offense was intended, the point is that if you focus on building the program all you will get is the program. However if you focus on building all the reusable bits you will get the program you need but you will also get a bunch of reusable code the will make your next program faster and easier.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to save multiple waveforms to excell spreadsheet

    Hi Everyone,
    So I just got a new project in lab which is to use our new DAQ board(NI USB 6341) to read a voltage from 5 PMTs.  I'm new to labview, and am struggling quite a bit but here's what I've done and would like to accomplish:
    My example today uses two channels sampled at 1K.
    1.Interface with the deivice and create a Task to measure from more than one channel. -Complete
    -In my example code I have the sampling rate at 1k and N samples at 100.  Eventually I would like to sample at 100Khz. What is an appropriate N samples?
    2. Generate Labview code that will continuously take data untill I tell it to stop and bring each channel to its own tab delimited column on the write out file.
    I cannot get step two work correctly.  My understanding was that the DAQ assistant in my example outputs a 1D array of waveforms and that "Export Waveforms to Spreadsheet file" VI would read each element as its own array but I cannot get it to do that.
    3. Graph in real time the two channels 10 seconds at a time. I.E I want it to continuously have a 10 second window([1,10],[2,11]...[101,111]) etc. so that way I know the current run time for sampling and I can see the current events.   This is a tricky situation because I want each to have their own plot and I haven't found a good way to use the register to append new data without eventually running out of memory.  The other issue is that when I append the data it shows from 0 seconds to my current time, I would like it to show me the waveform in time as discussed above.
    If I could get some help on either of these two fronts, I would be immensely greatful.  Thank you so much for your help, and for reading this
    Best,
    -Joe
    PS- Attached is my code.  Give it a run and see what it does to understand things a little better please.
    Attachments:
    Read Voltage.vi ‏60 KB

    Okay so the charts ended up working out nicely if I wanted to sample at 1kHz and have samples to read=100
    But If I now up my sampling rate to 100kHz and 25k samples to read for 5 channels I immediately receive the error message:
    "Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
    Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem."
    I guess my first question, would be what is happening that is making the VI crash right away, the DAQ board can handle 500KHz across all channels so that is not the issue, how can I create my VI to handle this amount of data?
    Attachments:
    Read Voltage.vi ‏94 KB

Maybe you are looking for

  • Can anyone help with intermitent blurring on videos.

    My video is done.  Many parts are good and many are now intermitingly blurry.  Can anyone help?  Am using a good camera.  Have done one video before and it turned out good.  The video from the camera is not blurry at all.  Just now.  I need help. Usi

  • Issue with script design

    HI expert can we design a box in sap-script where the vertical lines inside the box are not continious i.e discrete .

  • Strange Behavior in modifying the values in VO

    I have a VO based on EO from a custom table. The query is something like: select EO.x, EO.y, (EO.x*EO.y) xy from EO I have displayed the values from this VO on to a table in OAF page. All the columns are messageTextInput but the third column (xy) is

  • Cannot change PO's in SRM due to system copy/ logical system error

    Hi All- We are running SRM extended classic scenario.  We would like to change PO's that have been created in our production system, but copied to another environment.  We are trying to change these PO's in the copied system but are getting error mes

  • HDV: best export format for client viewing?

    I am working on a project in HDV 1080i (1440). What is the best export format to create a sample for a client to view- one that will give the proper aspect ratio. I've tried everything I can think of, and the export is still squashed 1440 and not ful