Parse out global channels

I have cDAQ 9172. The users will enter different global channels and I want to parse out the digital channels and have them in a seperate array. The other channels should be in the same order as the user selects. I am reading in global channels that will always be in the same format but never in the same order. Example: 9401-DI-1:2 .... and 9205-VI-1:3 and 9237-PI-1:2 would end up in two tasks. The Analog In tasks will be 9205-VI-1:3, 9237-PI-1:2 and I would then have a different task for the Digital Input 9401-DI-1:2. The user should be able to enter tasks in any order.
Solved!
Go to Solution.
Attachments:
ParseGlobalChannels.vi ‏15 KB

Well I solved this myself. Didn't see the Match Regular Expression Function. That allows the use of the or function and makes things a whole lot earier.
Attachments:
ParseGlobalChannels.vi ‏21 KB

Similar Messages

  • How can I set the parameters of global channels and tasks previously created inside my applicatio​n?

    Hi everyone !
    Before proceeding to the description below I think it´s important to say that I´m using NI USB-6008 as DAQ device and the driver used is DAQmx 7.5.
    I´m currently developing an application into which I intend to be able to have complete control of the DAQ device being used, i.e, I´ll be able to create, delete and change the configuration of global channels and tasks previously created, among other things.
    To achieve the ends specified above I´ve already developed two vis, one to create global channels and the other to create tasks, and these two are doing a fine job. After this, I thought I came to the easy part ... I think I couldn´t be far for the truth! I thought that everything I should do was to specify which channel or task I´d like to configure and then use a property node to get the results I wanted, but it´s not working ...there are some DAQmx property nodes I thought I could use to do it  but I didn´t find a way to change the configuration of the global channels, and none of these property nodes seemed to work, i.e, although the simple vis used to test them ran the chosen parameters didn´t alter at all, after each execution I used MAX to see if they had changed, and to my chagrin they hadn´t.
    Can anybody lend me a hand with this problem? As always, any help would be deeply appreciated !    

    Hi Giovani,
    There is a developer zone tutorial that discussus some advanced data acquisition features including programmatic saves of NI-DAQmx tasks, global channels, and scales.  This tutorial also includes an example program.
    I wrote a short program that creates tasks in MAX. Whenever I wanted to change a part of the task, I would just change that feature in the example program. Take a look at the examples and please let me know if you have any further questions.
    Regards,
    Hal L.
    Attachments:
    create task example.vi ‏33 KB

  • Virtual Global channels created but not selectable

    I have recently updated all of my drivers to the latest version for Labview 7.1 in Windows XP.  As a result of this upgrade, I no longer have access to my virtual global channels, which all transferred and still exist.  Old vi's created with global channels continue to execute, and existing tasks, which reference virtual channels continue to work; however, I believe that this is a result of the NI drivers converting and storing these configurations as logical channels.  Anyway, when creating a new task from within MAX, or using the DAQmx express vi's from within Labview, I no longer have the tab that allows me to select which virtual channels to add to that task, eventhough all of the virtual channels are still defined correctly and available from within MAX.
    Any help would be appreciated.

    Hi Kike,
    After your harddisk crashed, did you reinstall everything?  Make sure that you installed LabVIEW first, then the DAQmx drivers and finally the hardware.  If you did not install in that order, then it's possible that issues might arise. 
    Are you saying that you have 10 Global Virtual Channels and 7 Tasks, but now you don't see them, or is the issue still when you try to create a new task you don't see the Global Virtual Channels avaliable? 
    As for the example finder, are you getting an error message like NI Service Locater is not Running or are you not able to find the NI Help Server?  You can click on the two links for some trouble shooting steps if that is the case.
    If my assumptions are not correct, please provide more information so that I can understand your situation.
    Message Edited by Nick F on 07-30-2007 07:11 PM
    Thank You,
    Nick F.
    Applications Engineer

  • Modification of Global channels In NIMax while Labview Program running, not updating in Labview

    Hello,
         Okay, here is my issue.  I have a program that reads data from a device using global channels in MAX.
    Step 1:  I open MAX with the systemExecute.vi with the parameters to wait till program finishes.
    Step 2:  I Modify a channel in Max, for example change the assigned daqMX Scale, or Min Max values.
    Step 3:  Save channel in Max.
    Step 4: Exit MAX with the file exit.
    Step 5: The Labview program continues, and I re-read the available global channels and global scales in the Labview vi but the properties have not changed to match what I change in MAX.
    If I stop the VI then start it again and read the global channels then the properties get updated.  How can I get the channel properties to update in Labview after changes are made in Max without stopping the labview vi and starting it again?

    Many properties of the channel can only be modified when the task is not running.  Have you tried stopping the task in LV before modifying the parameters, and then re-starting the task?
    Dan

  • Read CLOB and parse out records

    I have a table that features an XMLTYPE column containing CLOB data with XML and HTML content in it. I'm not quite sure how I can parse out the [CDATA] section and create a unique list of IDs contained within the javascript:openLink() string. Any ideas? I've tried searching the forums for how to read a CLOB and parse out each line, but didn't find the results I was looking for.
    I've provided a sample of some of the content in this column:
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1008)">2006 Newsletters</A>
    </P>
    ]]></html>
    I basically need to output a list of IDs:
    LinkID
    1010
    1009
    1008

    Sorry...I thought I could figure things out based on your example, but I 'm not sure if 10g supports noentityescaping clause. Do you happen to know what I would need to substitute it with? To my understanding the XMLELEMENT function takes a name for "identifier," although I'm not quite sure in this case what the identifier should be...an XML tag value?
    This is SQL I tried to run but not getting any results:
    SELECT t2.*
    FROM (SELECT pagecontent
    FROM tb_rh_page
    WHERE pageid = 1) T,
    XMLTABLE('a/@href' PASSING XMLELEMENT(noentityescaping, EXTRACTVALUE(T.pagecontent,'/p_PAGECONTENT/Controls/divTopLeft/html/text()')).EXTRACT('//a')
    COLUMNS linkid integer PATH 'ora:replace(.,"[^[:digit:]]","")') t2
    Also the HTML is a little deeper in the XML than I originally posted, so I'm not sure if I'm getting to the path correctly.
    Here's what the data looks like in the column:
    <p_PAGECONTENT>
    <PageName/>
    <Title/>
    <Roles/>
    <Controls>
    <PageTool>
    <visible>false</visible>
    </PageTool>
    <divTopLeft>
    <visible>true</visible>
    <style>font-size:larger;overflow:auto;FILTER: progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#3b6f9f, EndColorStr=#e6eff6);Height:560px;background-color:#003366;border-bottom-width: 1px;border-color: #c6ddf1;border-left-width: 1px;border-right-width: 1px;border-style: Solid;border-top-width: 1px;</style>
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(2008)">2006 Newsletters</A>
    </P>
    ]]></html>
    </divTopLeft>
    <divTopRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divTopRight>
    <divBottomLeft>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomLeft>
    <divBottomRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomRight>
    </Controls>
    </p_PAGECONTENT>

  • Can Max global channels be programmatically added to a created task?

    I can add Physical channels to a created task, but cannot seem to add global channels to a task that was previously created.  The problem here is that I want to create my task with the channels (both physical and global) in a specified order.
    Thanks,
    Mike Sachs

    Hi Mike-
    You can add global virtual channels to a programmatically-created task by using the DAQmx Create Task VI.  This allows you to create a task with existing global virtual channels and then add virtual channels at run-time in the usual manner.  Here's an example that shows a global channel (created for Dev5/ai0) and a virtual channel within the same task:
    Hopefully this helps-
    Message Edited by Tom W [DE] on 02-09-2006 11:06 AM
    Tom W
    National Instruments
    Attachments:
    global_virtual_task.JPG ‏52 KB

  • How to parse out primitives out of a stream?

    Hi there!
    I need to parse a lot primitives (chars, ints, longs, bytes) out of a stream.
    My Problem is, that the following way is very slow:
    BufferedReader.readline -> String.substring -> Integer.parseInt(String).
    This algoryth produces a lot of Garbage and most CPU-power is used to create new objects (Strings).
    To serilisize the wrapper-classes of primitives also isnt a solution, because it also produces much traffic and is slow.
    Does anybody know a Library which does allow to parse out a big amount of primitive Types very fast, like something which interacts with the stream directly. Could also be something which isnt included in the JDK...
    Thanks, Clemens
    lg Clemens

    if your input stream is created by ObjectOutputStream/DataOutputStream, then you can use ObjectInputStream/DataInputStream, otherwise, you will need to parse it yourself.

  • How to parse out curly quotes from a string

    Hi,
    I am writing a web application, where people will be copying from a Word Document into a text area. Then I get a String from the parameter passed.
    How can I parse out curly quotes and mdashes from this String? Are there specific character codes that I can parse out to replace them with regular quote characters or html quote characters?
    Thanks,
    Gabe

    Interesting problem and one that we had to deal with a couple of years ago. I think you might be talking about smart quotes and these are actually control characters used by MS products. They show up as squares in HTML unless properly dealt with. Try downloading some UNICODE charts to find out the values of these characters. I think they are something like 0044 and 0042 but I cannot remember off hand.

  • Parsing out numbers

    Trying to parse out the number strings into its own columns with this expression:
    WITH T as
    (SELECT  '53-2010-2-101' test_string FROM DUAL union all
    SELECT  '2219-2010-3-22' FROM DUAL union all
    SELECT  '236350-2010-4-3' FROM DUAL)
    SELECT SUBSTR(test_string,INSTR(test_string,'-')-2) stu_id,   --This is incorrect
    SUBSTR(test_string,INSTR(test_string,'-',1,1)+1,4) fiscal_yr, 
    SUBSTR(test_string,INSTR(test_string,'-',1,2)+1,1) sess,      
    SUBSTR(test_string,INSTR(test_string,'-',1,3)+1,5) sch_id     
    FROM THaving problems with stu_id. How to count backwards with substr and instr? The results should look like so:
    STU_ID                         FISCAL_YR                     SESS                                        SCH_ID
    53                             2010                           2                                           101
    2219                         2010                           3                                            22
    236350                         2010                           4                                             3Thanks

    Would it be something like this?
    WITH T as
    (SELECT  '53-2010-2-101' test_string FROM DUAL union all
    SELECT  '2219-2010-3-22' FROM DUAL union all
    SELECT  '236350-2010-4-3' FROM DUAL)
    -- end of sample data
    SELECT substr(test_string, 1, instr(test_string, '-') - 1) stu_id,
            substr(test_string, instr(test_string, '-', 1, 1) + 1, 4) fiscal_yr,
            substr(test_string,
                   instr(test_string, '-', 1, 2) + 1,
                   instr(test_string, '-', 1, 3) - instr(test_string, '-', 1, 2) - 1) sess,
            substr(test_string, instr(test_string, '-', 1, 3) + 1, 5) sch_id
       FROM tSample execution:
    SQL> WITH T as
      2  (SELECT  '53-2010-2-101' test_string FROM DUAL union all
      3   SELECT  '2219-2010-3-22' FROM DUAL union all
      4   SELECT  '236350-2010-4-3' FROM DUAL)
      5   -- end of sample data
      6   SELECT substr(test_string, 1, instr(test_string, '-') - 1) stu_id,
      7          substr(test_string, instr(test_string, '-', 1, 1) + 1, 4) fiscal_yr,
      8          substr(test_string,
      9                 instr(test_string, '-', 1, 2) + 1,
    10                 instr(test_string, '-', 1, 3) - instr(test_string, '-', 1, 2) - 1) sess,
    11          substr(test_string, instr(test_string, '-', 1, 3) + 1, 5) sch_id
    12     FROM t;
    STU_ID          FISCAL_YR SESS            SCH_ID
    53              2010      2               101
    2219            2010      3               22
    236350          2010      4               3
    SQL> With regular expressions would look something like this:
    WITH T as
    (SELECT  '53-2010-2-101' test_string FROM DUAL union all
    SELECT  '2219-2010-3-22' FROM DUAL union all
    SELECT  '236350-2010-4-3' FROM DUAL)
    SELECT regexp_substr(test_string, '\d+', 1, 1) stu_id,
            regexp_substr(test_string, '\d+', 1, 2) fiscal_yr,
            regexp_substr(test_string, '\d+', 1, 3) sess,
            regexp_substr(test_string, '\d+', 1, 4) sch_id
       FROM t;Edited by: fsitja on Jan 28, 2010 6:07 PM

  • Create global channels programmatically

    hello all,
    my question is related with daqmx.
    i want to know if theres any way to create global channels or tasks programmatically without using max or daqmx assistant
    the usual procedure is to create global  tasks or channels using max or daqmx assistant and then add them to ur tasks programmatically.
    i want to avoid the use of max here and create channels programmatically that can be used or called later.
    Solved!
    Go to Solution.

    You can use the DAQmx Save Task or DAQmx Save Global Channel VIs to save them programmatically.
    http://zone.ni.com/reference/en-XX/help/370469AA-01/lvdaqmx/mxsavetask/
    I agree with Dennis though, almost all DAQ tasks can be accomplished using the standard functions.  You might want to take a look at some DAQ examples by going to Help > Find Examples > Hardware Input and Output > DAQmx.  I always start with these examples and modify them as needed.
    Matt J
    Professional Googler and Kudo Addict
    National Instruments

  • Porperty "Descritpion" of a global channel

    Hello all,
    I have have to update a piece of software (written in LabVIEW 6.1) which read the description of a DAQ-Channels and dsiplays this information.
    It uses the traditional DAQ functions (the channel descriptions can be set through the M&A Explorer).
    After switching to LabVIEW 7.1 for the software and DAQmx for the hardware, I found, that the description of a channel could not be set through M&A.
    With the property "Description" of a global channel used in LabVIEW, I can assign a description to a global channel. But this description is only available as long as the software is alive.
    Two questions:
    1. Where can I assign a description to a global channel
    permanently (like to traditional DAQ channels)?
    2. Is this the right place for my question?
    Regards
    Heinrich

    Hi - you can programatically update and write to a global channel in DAQmx 7.4 and higher, however you cannot do this through MAX directly, so you have to make your own utility to do this.
    Have a look at http://www.ni.com/info
    and type in daqmxpro in the box.
    Hopefully that will give you enough information for the future.
    Thanks
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • Change global channel programmatically????

    hi..
    is it possible to change a physical channel in global channel programmatically?????????
    i am using labview 8.2......

    Duplicate post (by browser's mistake ?!) .
    - Partha
    LabVIEW - Wires that catch bugs!

  • Parsing out HTTP headers

    I'm writing a simple HTTP client and server. I'm looking for an efficent way to parse out the HTTP headers that the server sends. The code below is working for me at the moment but i don't think it's the correct way of going about it.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public final class RequestTEST {
        public static void main(String args[]) throws Exception
               final String CRLF ="\r\n";
               try {
                   Socket mySocket = new Socket ("127.0.0.1", 5306 );
                   DataOutputStream out = new DataOutputStream(mySocket.getOutputStream());
                   InputStream in = mySocket.getInputStream();
                   System.out.println("Enter a file name to request");
                   String filename = Console.readString();
                   String request = "GET /"+filename;
                   System.out.println("Sending "+request);
                   out.writeUTF( request );
                   int bytes = 0;
                   boolean header = true;
                   while((bytes = in.read()) != -1 && header)
                        if(bytes==10) //Line Feed LF
                             bytes = in.read();
                             if (bytes==13) //Carriage return CR
                             header=false;
                   System.out.println(bytes);
                   in = mySocket.getInputStream();
                   byte[] buffer = new byte[1024];
                   FileOutputStream oStream = new FileOutputStream(filename);
                   while((bytes = in.read(buffer)) != -1 )
                   System.out.println(bytes);
                oStream.write(buffer, 0, bytes);
                oStream.close();
                   mySocket.close ();
               catch (Exception exp ){
                   exp.printStackTrace();
    }I know the code is a little rough but i'm just developing the idea. Only started it today.
    Any suggestions or tips on the overall approach to this would be much appreciated.

    Maybe use the HttpURLConnection and then getHeaderFields().
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.HttpURLConnection;
    public class URLTester
         private final static String PROTOCOL = "http://";
         public static void main(String args[])
              if ( args.length != 1 )
                   System.out.println("Usage: java URLTester <url>");
                   System.exit(-1);
              String urlString = args[0];
              try
                   //  Create URL object from the URL string
                   URL url = new URL(PROTOCOL + urlString);
                   //  The connection object has information that may be
                   //  retrieved without parsing the data returned
                   HttpURLConnection conn = (HttpURLConnection)url.openConnection();
                   conn.connect();
                   //  Get an input stream from the URLConnection object
                   InputStreamReader isr = new InputStreamReader( conn.getInputStream() );
                   BufferedReader in = new BufferedReader( isr );
                   System.out.println( conn.getHeaderField(0) );
                   int headers = conn.getHeaderFields().size();
                   for (int i = 1; i < headers; i++)
                        System.out.println(conn.getHeaderFieldKey(i)
                             + " : " + conn.getHeaderField(i));
                   String line;
                   while ( (line = in.readLine() ) != null )
                        System.out.println( line );
                   in.close();
              catch(IOException e)
                   System.out.println( e );
    }

  • Mutiple global channels

    In LV 7.1 how do I create a DAQmax task from multiple global max channels. The global channels are all analog but different types in a PXI\SCXI chassis

    Hi Larry,
    Please refer to the following link that discusses your issue:
    http://digital.ni.com/public.nsf/websearch/3296BA2AEF586B7386256D6D00528E3D?OpenDocument
    Regards,
    Ankita A.
    National Instruments

  • XML PL/SQL Parser Out of memory

    Im parsing a 20M file and recieving the following result.
    I have tried to cut the file size down and have found a small
    version that will parse successfully.
    We have tried adjusting
    the ulimit -d 2097152
    ulimit -s 32768
    and also set java_pool_size = 41943040 in init.ora
    none of these seemed to be enough to enable parsing of the file.
    The following are 2 executions of the parser using 2 different
    file sizes.
    Thanks,
    Steve
    BEGIN
    domsample('/u01/app/oracle/xmlparser/samp','dan55.xml','errors.tx
    t'); END;
    ERROR at line 1:
    ORA-29554: unhandled Java out of memory condition
    BEGIN
    domsample('/u01/app/oracle/xmlparser/samp','dan60.xml','errors.tx
    t'); END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.OutOfMemoryError
    ORA-06512: at "PHASE2.XMLPARSERCOVER", line 0
    ORA-06512: at "PHASE2.XMLPARSER", line 118
    ORA-06512: at "PHASE2.DOMSAMPLE", line 84
    ORA-06512: at line 1
    null

    Steve (guest) wrote:
    : Oracle XML Team wrote:
    : : Steve Coffman (guest) wrote:
    : : : Im parsing a 20M file and recieving the following result.
    : : : I have tried to cut the file size down and have found a
    small
    : : : version that will parse successfully.
    : : : We have tried adjusting
    : : : the ulimit -d 2097152
    : : : ulimit -s 32768
    : : : and also set java_pool_size = 41943040 in init.ora
    : : : none of these seemed to be enough to enable parsing of the
    : : file.
    : : : The following are 2 executions of the parser using 2
    : different
    : : : file sizes.
    : : : Thanks,
    : : : Steve
    : : : BEGIN
    : : : domsample
    : : ('/u01/app/oracle/xmlparser/samp','dan55.xml','errors.tx
    : : : t'); END;
    : : : ERROR at line 1:
    : : : ORA-29554: unhandled Java out of memory condition
    : : : BEGIN
    : : : domsample
    : : ('/u01/app/oracle/xmlparser/samp','dan60.xml','errors.tx
    : : : t'); END;
    : : : ERROR at line 1:
    : : : ORA-29532: Java call terminated by uncaught Java exception:
    : : : java.lang.OutOfMemoryError
    : : : ORA-06512: at "PHASE2.XMLPARSERCOVER", line 0
    : : : ORA-06512: at "PHASE2.XMLPARSER", line 118
    : : : ORA-06512: at "PHASE2.DOMSAMPLE", line 84
    : : : ORA-06512: at line 1
    : : On what OS and with how much installed memory are you
    running?
    : : Oracle XML Team
    : : http://technet.oracle.com
    : : Oracle Technology Network
    : The server is a
    : Digital UNIX V4.0E (Rev. 1091)
    : with 2Gig Ram
    Oracle version 8.1.5
    null

Maybe you are looking for