I write digital port by 'DAQmx Configure Logging.vi​' and receive TDMS file with 8 boolean channels. How can I write to 1 integer channel?

Hello!
I want to write 1 digital port from PXI-6536 with streaming to TDMS file.
I'm writing by 'DAQmx Configure Logging.vi' and become TDMS file with 8 boolean channels.
How can I write to 1integer channel?
Attachments:
1.JPG ‏27 KB

Hey Atrina,
The actual data stored on disk is just the raw data (that is, a byte per sample in your case).  It's really just a matter of how that data is being represented in LabVIEW whenever you read back the TDMS file.
I'm not sure if there is a better way to do this, but here is a way to accomplish what you're wanting:
Read back the TDMS file as a digital waveform.  Then there's a conversion function in LabVIEW called DWDT Digital to Binary.  This function will convert that set of digital channels into the "port format" that you're wanting.  I've attached an example of what I mean.
Note: When looking at this VI, there are a few things that the downgrade process did to the VI that I would not recommend for these TDMS files.  It added a 1.0 constant on the TDMS Open function, and it set "disable buffering" on the TDMS Open function to false; you can get rid of both of those constants.
Message Edited by AndrewMc on 01-27-2010 11:21 AM
Thanks,
Andy McRorie
NI R&D
Attachments:
digitalconvert.vi ‏13 KB

Similar Messages

  • How can I write the name of data into Excel?

    Now, I write T1 T2 T3 and so on into an excel file and each is in one column. How can I insert the data name such as " T1 T2 T3" on the top row by programming? 
    I am using "write to spreadsheet file. vi" now and wire the data with "build array".

    How can you creat the "red box" (linked to append report text.vi)  with name as Pressure, temperature, operator ?  
    Actually, I use much simpler way. Could you please have a look at it?
    I attach an vi file to express my meaning.
    附件:
    save try.vi ‏40 KB

  • How can I write new objects to the existing file with already written objec

    Hi,
    I've got a problem in my app.
    Namely, my app stores data as objects written to the files. Everything is OK, when I write some data (objects of a class defined by me) to the file (by using writeObject method from ObjectOutputStream) and then I'm reading it sequencially by the corresponding readObject method (from ObjectInputStream).
    Problems start when I add new objects to the already existing file (to the end of this file). Then, when I'm trying to read newly written data, I get an exception:
    java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    Is there any method to avoid corrupting the stream? Maybe it is a silly problem, but I really can't cope with it! How can I write new objects to the existing file with already written objects?
    If anyone of you know something about this issue, please help!
    Jai

    Here is a piece of sample codes. You can save the bytes read from the object by invoking save(byte[] b), and load the last inserted object by invoking load.
    * Created on 2004-12-23
    package com.cpic.msgbus.monitor.util.cachequeue;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    * @author elgs This is a very high performance implemention of Cache.
    public class StackCache implements Cache
        protected long             seed    = 0;
        protected RandomAccessFile raf;
        protected int              count;
        protected String           cacheDeviceName;
        protected Adapter          adapter;
        protected long             pointer = 0;
        protected File             f;
        public StackCache(String name) throws IOException
            cacheDeviceName = name;
            f = new File(Const.cacheHome + name);
            raf = new RandomAccessFile(f, "rw");
            if (raf.length() == 0)
                raf.writeLong(0L);
         * Whne the cache file is getting large in size and may there be fragments,
         * we should do a shrink.
        public synchronized void shrink() throws IOException
            int BUF = 8192;
            long pointer = getPointer();
            long size = pointer + 4;
            File temp = new File(Const.cacheHome + getCacheDeviceName() + ".shrink");
            FileInputStream in = new FileInputStream(f);
            FileOutputStream out = new FileOutputStream(temp);
            byte[] buf = new byte[BUF];
            long runs = size / BUF;
            int mode = (int) size % BUF;
            for (long l = 0; l < runs; ++l)
                in.read(buf);
                out.write(buf);
            in.read(buf, 0, mode);
            out.write(buf, 0, mode);
            out.flush();
            out.close();
            in.close();
            raf.close();
            f.delete();
            temp.renameTo(f);
            raf = new RandomAccessFile(f, "rw");
        private synchronized long getPointer() throws IOException
            long l = raf.getFilePointer();
            raf.seek(0);
            long pointer = raf.readLong();
            raf.seek(l);
            return pointer < 8 ? 4 : pointer;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#load()
        public synchronized byte[] load() throws IOException
            pointer = getPointer();
            if (pointer < 8)
                return null;
            raf.seek(pointer);
            int length = raf.readInt();
            pointer = pointer - length - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            byte[] b = new byte[length];
            raf.seek(pointer + 4);
            raf.read(b);
            --count;
            return b;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#save(byte[])
        public synchronized void save(byte[] b) throws IOException
            pointer = getPointer();
            int length = b.length;
            pointer += 4;
            raf.seek(pointer);
            raf.write(b);
            raf.writeInt(length);
            pointer = raf.getFilePointer() - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            ++count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCachedObjectsCount()
        public synchronized int getCachedObjectsCount()
            return count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCacheDeviceName()
        public String getCacheDeviceName()
            return cacheDeviceName;
    }

  • Daqmx Configure Logging with Time Stamp

     Hi All,
    I was wondering if it is possible to use Daqmx Configure Logging to log both data, and a row of the exact time (not a relative one), or at least add the FIRST time and date to the information?
    Thanks,
    Lester

    Hi,
    I got it to work, I just forgot to put in the "Group Name" and "Channel Name" which is necessary to get the properties, I wasn't aware of that.  The info can be seen at http://zone.ni.com/devzone/cda/tut/p/id/3539 . 
    I got the time stamp now, but the resolution is only to seconds.  I tried using the "Format Date/Time String" vi to format the resolution to milliseconds, but that doesn't seem to work because all the decimals after the seconds is just ".000000".  Does TDMS always start at .000 seconds, or does it just not go down to that resolution of timing?
    Thanks for your help,
    Lester

  • DAQmx configure logging (TDMS) and counter

    Hi,
    I'm trying to stream analog data jointly with counter data to one TDMS file with use of DAQmx configure logging vi. This is quite new but powerful function but I can't manage with it successfully. I'm able to acquire analog data only and display no. of counts simultaneously (attached diagram). I have no idea how attach counter data to TDMS stream as separate channel group.
    It is important for me to stream data with this VI bacause I'm sampling analog data with 95kHz per channel (PCI-6143 board).
     Could you post any ideas how to resolve this problem?
    Best regards
    Mark
    Attachments:
    acq_analog_and_contr.PNG ‏44 KB

    Eric, hear is short info about DAQmx configure logging http://zone.ni.com/devzone/cda/tut/p/id/9574.
    Yes I thought about producer/consumer structure, It is first alternative way.
    There is also another very simple way -  connecting encoder to analog input and acquire together with analog signals. Of course It will be neccasary to process sigal from encoder after recording. I'm also concerning such solution
    Ok I have to sleep with this problem  
    Best regards
    Mark

  • How can I write bits through the COM1 serial port?

    I'm trying to write bits through the serial port COM1.
    Labview "Write VI" only writes everything in string. It seems. How can I write bit by bit through COM1?
    Thank you,
    Van

    Serial transmission (COM port) protocol requires sending a group of bits at one time. You cannot just send one bit. Standard COM port settings must be either 7 or 8 data bits, 1 or 2 stop bits, etc... You have to group your bits 7 or 8 at a time. You could probably send a 0 byte or a 1 byte. This would be like sending 0000 0000 for a low bit and 0000 0001 for a high bit. Your receiving end would have to know how to interpret what you are sending if you choose this method. Of course you have to convert your byte into a string before sending to COM port. Wire a U8 data type to a Build Array input. Then wire the array output to a Byte Array to String input. The output of this function will be the character representation of your byte suitable for sending acr
    oss a serial port.
    - tbob
    Inventor of the WORM Global

  • I configurated mi ipad in spanish and I can't write a semi-colon, because instead of a semi-colon, it writes our letter ñ. How can I write a semi-colon?

    I configurated mi ipad in spanish and I can't write a semi-colon, because instead of a semi-colon, it writes our letter ñ. How can I write a semi-colon?

    Let's synchronize...
    I'm using an iPad 2 running iOS 4.3.2.
    Use Settings > General > Keyboard > International Keyboards > Add New Keyboard > Spanish.
    Touch Spanish > QWERTY-Spanish (Software Keyboard Layout) > Spanish (Hardware Keyboard Layout).
    Are you still with me?
    Go to your application where you want to use the new keyboard and select the keyboard "Español" by touching and holding the key with the globe on it.
    Now, touch and hold the comma.
    What do you see?

  • How can I write my Adobe AIR application tracing lines into a log file

    I Have a question about log files for AIR application
    How can I make my application writing all tracing and exceptions into a log file?

    I think if you pubish a -debug SWF it will log to flashlog.txt

  • How can i write a sign string in VISA Write?

    Hello everybody.
    I would like someone to help me. I have an
    array, which is transformed (by Byte Array to String) in a string that
    reaches the VISA Write Serial Port. My problem is that when making the
    transformation with Byte Array to String, i  lose all the bytes with sign
    (negative).
    What can I do? I don't want to  lose the sign bytes and be able to send them to VISA Write Serial Port.
    Thank you very much.

    It sounds like you have a typecasting problem.  First, why do some of your bytes have a sign?  I assume they are I8.  Strings are based on U8 because they are just a series of ASCII characters vs. values.  The ASCII character table goes from 0 to 255.
    What happens on the other end of the VISA communication string?
    One thing you could do is to typecast your bytes to a U8.  Though I think the coercion dot of an I8 byte array going into the byte array to string is doing this automatically.

  • How can I write "@" in safari?

    How can I write "@" in safari for pc? ctrl, alt 2 brings up the log page...Safri

    Sorry..  thought it was Mac.
    No @  for number 2 on your keyboard? I can't remember Windows anymore...  

  • How can i write info in text filefrom servlet

    hello
    can u give me exmaple how can i write data into text file from servlet ?
    Edited by: bla123456789654 on May 17, 2010 2:05 PM

    javax.servlet.GenericServlet
    public void log(java.lang.String msg)
    Writes the specified message to a servlet log file, prepended by the servlet's name.
    See ServletContext.log(String).
    Parameters:
            msg - a String specifying the message to be written to the log file
    */

  • How to configure a shell and tube heat exchanger with Lab VIew to get data

    HiI
    In our undergraduate chemical engineering labboratory we want to configure our shell and tube heat exchanger  with a DAq and Lab VIEW to get information about the temperaure (of the cold fluid stream being heated), the pressure (of the steam on the shell side of the heat exchanger) and the flowrate (of the water being heated).
    Can anyone suggest thermocouples, pressure transducers and flowmeters to fit between the heat exchanger and the DAq?
    P.S. the heat exchanger is already fitted with thermometers, a pressure gauge and a rotameter but we don't know how to connect these hardware to the DAq
    Solved!
    Go to Solution.

    It sounds like you have enough information to pick out appropriate sensors, you just need to do the research. I would start looking through the Omega catalog, or give them a call - they're usually helpful. I can't take the time to spec out parts for you - that would be a lot of time spent on someone else's project. Most pressure sensors put out either a 4-20mA or 0-5V signal, either of which you can read through an analog input on a DAQ; measuring a 4-20mA signal requires a resistor to convert to voltage. Most of the NI DAQ boards can read a thermocouple on an analog input, but make sure that your hardware does support reading thermocouples. For accurate readings, use a device that has built-in cold junction compensation - for example, the SCB-68 connector block - and for the most accurate readings, get a board specifically designed for temperature measurement.
    For the flow measurement, a standard, simple solution is an orifice plate. You put a differential pressure transducer across it, look up the appropriate equations, and use them to calculate the flow rate given the density of the fluid (which you'll be able to calculate from the pressure and temperature, since steam tables are widely available). There are other differential pressure devices available as well - at a previous job we used a V-Cone from McCrometer. If you call them they'll spec one for you - but get an approximate cost first to make sure it's within your budget.

  • How can I write a program that compiles without warnings?

    I tried the following with the 1.5 beta-compiler (build 28; I think):
    class Y {
         public static final class Pair<X,Y> {
           private X fst;
           private Y snd;
           public Pair(X fst, Y snd) {this.fst=fst; this.snd=snd;}
           public X getFirst() { return fst; }
           public Y getSecond() { return snd; }
           public String toString() { return "("+fst+","+snd+")"; }
      public static void main(String... args) {
         Pair[] pairArr = new Pair[10];              // supposed to be an array of Pair<Integer,Integer>
         for (int i=0; i<pairArr.length; i++)
             pairArr[i] = new Pair<Integer,Integer>(i,i);
         for (int i=0; i<pairArr.length; i++) {
             Pair<Integer,Integer> p = pairArr; // unchecked warning
         System.out.println(p);
         Integer first = p.getFirst();
         Integer second = p.getSecond();
    // ... more stuff ...
    It turns out that I get an unchecked warning when I extract an element from the array of pairs. Okay, that's fine. How can I avoid the warning? I had expected that an explicit cast would help.
      Pair<Integer,Integer> p = (Pair<Integer,Integer> )pairArr;
    With a cast I'm telling the compiler: "I _know_ what I'm doing; please trust me." But the compiler still issues a warning.
    How can I write a warning-free program in this case? The only thing I can think of, is not using the parameterized type Pair in its parameterized form. But it's not the idea of Java Generics that I refrain from using parameterized types. What am I missing?

    It turns out that I get an unchecked warning when I
    extract an element from the array of pairs. Okay,
    that's fine. How can I avoid the warning? I had
    expected that an explicit cast would help.
    Pair<Integer,Integer> p = (Pair<Integer,Integer>
    )pairArr;
    With a cast I'm telling the compiler: "I _know_ what
    I'm doing; please trust me."  But the compiler still
    issues a warning.  Yes, but at least you were able to change the warning from "unchecked assignment" to "unchecked cast" which is a little shorter ;-)
    Seriously , since arrays of generic types are disallowed, there is probably no way to get rid of these warnings - which makes a strong point for eliminating "unchecked" warnings altogether (see the other thread "selectively suppressing compiler warnings")
    Cheerio,
    Gernot

  • How can I Write a sine wave in an Access-fil​e?

    I measure a sine wave in LabView 6i. How can I write the datas automatically to an Acces-file, at the same time?
    In my program, I managed it with Execute SQL.vi, I change a number in a SQL statement(String) -> after this I push start and then it writes the statement in the Access-file.
    The problem is, it writes only one data per measurement in the file. How can I write all datas in the Access-file and measure the wave at the same time?
    Thanks for help!
    Attachments:
    getwave.vi ‏49 KB

    On the waveform palette, you will find a "to components" vi that you can break out the array of the waveform. You can then, using a for loop write all of the values from the waveform.
    Better yet, there are examples in the database toolkit manual on pages 3-13 to 3-15 that deal with reading arrays (and even has a waveform example).
    Good luck!

  • How can i write the below code using "For all entries"

    Hi
    How can we write the below code using "for all entries" and need to avoid joins...
    Please help
    SELECT aaufnr aobjnr aauart atxjcd a~pspel
    agstrp awerks carbpl cwerks
    INTO TABLE t_caufv
    FROM caufv AS a
    INNER JOIN afih AS b
    ON aaufnr = baufnr
    INNER JOIN crhd AS c
    ON bgewrk = cobjid
    AND c~objty = 'D'
    WHERE ( a~pspel = space
    OR a~txjcd = space
    OR NOT a~objnr IN
    ( select OBJNR from COBRB AS e
    WHERE objnr = a~objnr ) )
    AND a~werks IN s_plant
    AND a~auart IN s_wtype
    AND NOT a~objnr IN
    ( select OBJNR from JEST AS d
    WHERE objnr = a~objnr
    AND ( dstat = 'A0081'OR dstat = 'A0018' )
    AND d~inact 'X' ).
    Reward points for all helpfull answers
    Thanks
    Ammi.

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

Maybe you are looking for

  • Year wise GL account retained earnings

    Hi Friends, My client has ECC5 version.  This is 2nd year of closing (march 09).   Now he wants 2008 year profit to be posted to Retained Earnings 2008 GL account.Like wise he is asking me to maintain year wise retained accounts. Last year ie 2007, i

  • Adoby Acrobat 7.0 opens some times when I close firefox or fire fox will not shut down.

    I have recently updated to firefox 4.0.1 and things are running slower and I have noticed that fire fox does not want to shutdown when I close it. Also every so often when I close fire fox my adobe acrobat professional will open randomly.

  • Lumia 920 suddenly switching apps

    2 weeks ago I had my 3 month old lumia 920 replaced because it locked on the widows boot manager screen.  As soon as I got the new phone it was already having problems.  It will suddenly vibrate and jump from screen to screen.  Almost as if the back

  • File size reported reported differently

    Can someone help me explain why this file size is reported differently depending whether you list file or folder properties: This is an Azure Basic_A1 VM. Drive E: is standard VHD attached to the VM (Page Block Storage). This is an active/open file t

  • Probelm in Visual Composer config in developer studio (NWCE7.2) for R3/BI

    Hello, I have installed the NWCE7.2 for pilot and having problem in configuring the Visual composer in developer studio to connect to Backend R3/BI I have followed the  steps mentioend in the page but consistently getting the eerror http://help.sap.c