VISA Find resource function regular expression

Hi guys,
I've been trying to get which Serial port is a GPS receiver connected to using the VISA Find Resource Function with no luck. The idea is to use a regular expression similar to
ASRL?*INSTR{VI_ATTR_ASRL_BAUD == 9600}
but instead of looking for baud rate, I want to search the value
ASRL3 (COM3 - GNSS Receiver)
as seen in MAX/VISA Test Panel. The attribute name is VI_ATTR_INTF_INST_NAME.
Something like ASRL?*INSTR{VI_ATTR_INTF_INST_NAME == ASRL? (COM? - GNSS Receiver)} should work, but it's not.
How should I write the expression?
Thanks!
Best regards,
Néstor
LabVIEW 2011 + Windows 7 32bits SP1

Hi Dennis,
thanks for answering.
I haven't assigned the name, MAX did it. I just opened MAX and there it was, COM3 (In Devices and interfaces/ASRL3/settings/name). I suppose it gets directly the Windows serial port name, what name do you mean exactly?
Anyway, what I'm interested in getting is the Port description, that would tell me the connected device in that port. I could build a small loop and look for the interface description of each serial device, but I found the VISA Find Resourde function and it seems a more simple and direct way to get what I want.
If I can list all serial devices with 9600 baud rate as in the previous example, why not do the same with the instrument name? I clearly see it when I open the VISA Test Panel. I am maybe missing something?
Best regards,
Néstor
LabVIEW 2011 + Windows 7 32bits SP1

Similar Messages

  • Built application can't find DaqMX devices with VISA Find Resource VI

    My application programmatically finds all of my PXI devices using the VISA Find Resources VI with the following regular expression:
    (PXI[0-9]*::?*INSTR){VI_ATTR_S:LOT >= 0}
    This works with my built application on a PXI-8186 controller with LabVIEW installed, but when I created an installer to put it on another PXI-8186 controller without the LabVIEW development system, none of my DaqMX devices show up in my list of VISA resources.  They all show up in MAX, however.  I even tried creating a simple app that just has the routine which gets the resource list.  Ironically, the only PXI device that shows up in the list is a ZT1000PXI made by ZTEC Corp.  I also have a number of PXI-4437s and PXI-6120s in the chassis.  I tried setting the PXI option in MAX to report all PXI devices, not just registered ones, but that had no effect.
    This is a Windows 2000 OS running on a PXI-8186, with DaqMX 8.5.0f3 and NI_VISA Runtime V4.1, and LabVIEW Runtime V8.2.1.
    Does anyone have a clue why this isn't working? I've tried uninstallng and reinstalling NI-VISA Runtime, but it didn't matter.

    Hi wired,
    As I understand it, you built an application in LabVIEW 8.2.1 on a PXI-8186 controller. When you moved to a new controller, one without LabVIEW 8.2.1, the program to find your PXI cards returns only a third party device and not your DAQ cards, despite the devices being visible in Measurement and Automation Explorer (MAX). You have an Installer for your application that installs the runtime engines for VISA and LabVIEW and the DAQmx driver.  Is my understanding correct?
    You mentioned that you had tried setting the PXI option in MAX to report all PXI devices, not just the registered ones. By this, did you mean that you set the VISA option to Show all devices accessible to VISA? If you did not mean this, then I would suggest doing so. In MAX, you can expand the Software tab in the Configuration Tree to the left. By selecting NI-VISA, the VISA options become visible. You should select show all devices accessible to VISA as seen in the attached screenshot.
    If you did in fact select this option already, can I ask if you also enabled the NI-VISA tulip Passport? In order to do this, on the VISA Options page, under General Settings, if you select the Passports option a list of checked boxes appear. Select the Tulips option as seen in the second screenshot and then click the Save button at the top of the MAX window. You will then need to close LabVIEW or your application and restart it.
    I built a simple program to test this post, and until I followed the above steps, the only devices that appeared were my com ports. After doing this I was able to all of my DAQ cards.
    Could you clarify some things for me? When you said that the application works on a PXI-8186 controller with LabVIEW, was this the development machine or just a controller you tried the executable on and it worked? What is in your installer? Is the VISA version on the test controller the same as that on the development machine? And lastly, in MAX, do the DAQ cards appear under DAQmx devices or under PXI systems and can you communicate with them using a test panel?
    Good Luck, Mallori M.
    Mallori M
    National Instruments
    Global Customer Education Program Mananger
    Calculate the time you will save with NI Training
    Attachments:
    Show VISA Accessible.PNG ‏84 KB
    Tulip Passport.PNG ‏15 KB

  • How to make "visa find resource" working with Agilent device

    I am trying to use Agilent 82357B GPIB device with LabVIEW for instrument control.
    I have checked:
    1.       NI-VISA (ver 5.1.1) is the primary visa by checking visa.dll properties under windows\system32 folder
    2.       Enable NIVISATulip.dll in NI Max Explorer
    3.       Enable the Agilent libraries to work with NI 488.2 in Agilent IO library (ver 16).
    I am able to communicate with the instrument in Max Explorer and talk to the instrument in LabVIEW with VISA write for almost all commands.
    But I can NOT make one particular visa function (Visa find resource) working with Agilent 82357B GPIB.
    With NI USB GPIB device, the same code above can find attached instruments as below, where GPIB1 is the Agilent device and GPIB0 is the NI device.
    I have no clue on how to make “visa find resource” working with Agilent device.
    Please help.
    Solved!
    Go to Solution.

    Quick question.  Did you also enable 488 support in Agilent? 
    If that does'not work try this.  and well see if you found a bug
    Jeff

  • VISA Find Resource primitive runs much slower on OS X compared to Windows

    Hello Everyone,
    We have a large application that is built with LabVIEW 2014 64-bit that calls the "VISA Find Resource" primitive in a While Loop as the basis for automatic hardware discovery.
    On Windows, everything works fine. However, we just started using LabVIEW for OS X to build our application for Mac and I noticed that the "VISA Find Resource" primitive executes about 10 times slower. This causes a handful of issues in our application since things were coded around this assumption that this primitive would execute very quickly.
    I wrote a VI in LabVIEW 2014 64-bit that I've run on both a Windows 7 64-bit machine and several Mac computers running Yosemite. The VI runs this primitive in a while loop which stops after the user-defined number of iterations have been performed and gathers timing statistics. I've attached this VI for reference. Below are the screenshots of the VI after running them on OS X Yosemite vs Windows 7 with the VISA Find Resources running 10,000 times.
    As you can see, the front panel displays the current iteration number (Loops), the current millisecond measurement during a loop, the mean millisecond measurement for the number of loops so far, the standard deviation, and variance. What I can see is that the standard deviation and variance are very similar across both platforms. It's just that for some reason the VISA Find Resources primitive runs slower on OS X Yosemite at about 6.5ms per execution vs Windows at 0.73ms per execution. I've also run this VI on a Mac Mini running Mavericks with nearly identical results (mean time of 6.5ms). As I mentioned before, this primitive taking about 10 times longer to execute really hinders the performance of our application.
    Is this a known issue for LabVIEW or VISA for OS X? Is there any way to get performance comparable to Windows on OS X?
    Thanks!
    Attachments:
    VISA Timings.vi ‏14 KB

    There is one serious difference between these two examples that could at least partially cause some of that difference. On the Mac you have 6 or so resources that satisfy the request, on Windows none. It's not exactly a fair comparison that way.
    VISA Find Resource on Windows can be slow too, if there are quite some VISA resources to scan. In fact I consider 6 ms runtime for VISA Find Resource a damn fast execution time. I had in the past easily execution times of several seconds when searching for ASRL (serial) resources. And that was on Windows.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Find text using regular expression and add highlight annotation

    Hi Friends
                       Is it possible to find text using regular expression and add highlight annotation using plugin

    A plugin can use the PDWordFinder to get a list of the words on a page, and their location. That's all that the API offers for searching. Of course, you can use a regular expression library to work with that word list.

  • Visa Find resource vi does not find GPIB0 board

    The GPIB0 board is appering in MAX device and interface. I can communicate properly with my GPIB0::3::INSTR. While I run Visa Find resource vi it finds all resources like serial and parallel ports, GPIB0::3::INSTR instrument but it does not find GPIB0 board.
    I running my application under WIN-98, Labview 6.0 and NI-VISA 2.6 and NI-VISA 2.6 Run Time are installed.

    Not exactly the same question as not being able to find the GPIB0 board.
    In any case, open MAX, expand Devices and Interfaces, expand the listing under your GPIB board, select your instrument. In the window on the right side, you should see a box labeled VISA Alias. Enter your alias and click the save button on top.

  • Finding URLs using regular expression.

    I have an requirement where user will type some text containing URLs like "Please visit this site http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747. Thank you". This text has to be modified as below before saving it to the database.
    "Please visit this site <a href='http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747'>http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747</a>. Thank you"
    I am using regular expression (http|https)://.+?\\s which marks the end of the url with a white space character.This pattern doesn't work if the URL is located at the end of the string since there will be no space at the end.
    For example if the string is "Please visit this site http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747" the regex will fail.
    My acutal problem is to find the URL irrespective its position within the string.
    Pattern urlPattern = Pattern.compile("(http|https)://.+?\\s", Pattern.CASE_INSENSITIVE);
    Matcher matcher = urlPattern.matcher(plainText);
    Map stringIndexMap = new HashMap();
    //Searching the input string for urlPattern...
    while(matcher.find()) {
    String urlString = matcher.group();
    //Storing the urls in a hashmap with their indices as keys....
    stringIndexMap.put(new Integer(matcher.start()), urlString.trim());
    Set keySet = stringIndexMap.keySet();
    Iterator it = keySet.iterator();
    //Iterating over the hashmap containing urls...
    while(it.hasNext()) {
    String urlString = (String) stringIndexMap.get(it.next());
    * Replacing the url string in the input text with <a href="#" onclick="window.open('<urlString>')"
    * using String index
    clickableURLString.replace(clickableURLString.indexOf(urlString),
    clickableURLString.indexOf(urlString) + urlString.length(),
    "<a href=\"#\" onclick=\"window.open('" + urlString
    + "')\">" + urlString + "</a>");
    return clickableURLString.toString();

    The end of the input is '$' as a regex.
    import java.util.regex.*;
    public class Prasanna{
      public static void main(String[] args){
        String text
    = "Please visit this site http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747";
    //    String regex = "(http|https)://.+?(?:\\s|$)"; // this works
        String regex = "(http|https)://[^ ]+";          // this also works
        Pattern pat = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
        Matcher mat = pat.matcher(text);
        while (mat.find()){
          System.out.println(mat.group());
    }

  • How to find sunstring with regular expression?

    How can I find a substring in a string with a regular expression?
    Example:
    I have a original string "<tr><th>RecordId: </th><td valign=middle>A4711</td></tr>"
    Now i want to extract the value "A4711" from this string with a regular expression. Everything except "A4711" is fixed, the id "A4711" itself is dynamic. How is it possible to get the substring "A4711" of the original string with a regular expression?

    i wrote a little method with the infos above to get such results:
         * Get all substrings of a string that matches a regular expression.
         * @param original String to inspect.
         * @param regExp Regular expression as search criteria.
         * @return All matches of <i>regExp</i> or null if one input parameter is null.
        public static String[] getSubstrings(String original, String regExp) {
            String[] result = null;
            if (original != null && regExp != null) {
                Pattern pattern = Pattern.compile(regExp);
                Matcher matcher = pattern.matcher(original);
                boolean matchFound = matcher.find();
                Vector matches = new Vector();
                while (matchFound) {
                    String match = matcher.group();        
                    matches.addElement(match);
                    matchFound = matcher.find();
                }//next match
                int count = matches.size();
                result = new String[count];
                for (int i = 0; i < count; i++) {
                    result[i] = (String) matches.elementAt(i);
                }//next match
            }//else: input unavailable
            return result;
        }//getSubstrings()

  • Find/Replace Using Regular Expressions

    Can someone help me with this...I am using Regular expressions to
    FIND:
    http.*lid=([^&"]*)[^"]*
    REPLACE:
    $set(\1,ID_id,code)$
    So that in the following it will change this:
    a href="http://www.test.com/shc/s/home_10153_12605?lid=Search" rilt="Search"
    To this:
    a href="$set(Search,ID_id,code)$" rilt="Search
    Those expressions  work in Notepad++ but when i use dreamweaver it just replaces the http... with "$set(\1,ID_id,code)$" and doesnt reference the "search"
    Any help?
    Thanks

    Let me begin by saying I'm a complete idiot with DW's Reg Ex.   I use Search Specific Tag whenever possible.  See screenshot below.
    Try this on your Current Document to see if it works. Then make a back-up copy of site before attempting it on Entire Local Site as you cannot "Undo" this process.
    Good luck,
    Nancy O.

  • Find/replace and regular expression problem

    Hello, i'm using find and replace with a regular expression
    for the first time. I have it checkmarked and it's finding my text
    but it's missing (not highlighting) the ')' at the end of the line.
    Here's my code:
    [($[0-9]+<font size="-2">US</font>)]
    it's supposed to find everything inside the square brackets -
    but it misses the closing parenthesis after </font>. I need
    to find this string and replace with nothing to remove the string
    from any/all pages. Is there a reason why it's missing the closing
    parenthesis? I was actually able to add a few more parenthesis
    (e.g. "))))") before OR after the closing square bracket and it
    still found the original text minus the closing bracket and the
    extra parenthesis didn't prevent the text from being found.
    Any help is appreciated!
    James...

    WyattEA wrote:
    > Hello, i'm using find and replace with a regular express
    for the first time. I
    > have it checkmarked and it's finding my text but it's
    missing (not
    > highlighting) the ')' at the end of the line. Here's my
    code:
    >
    > [($[0-9]+<font size="-2">US</font>)]
    That's not how square brackets work
    Try:
    \(\$\d+<font size="-2">US</font>\)
    A left parens, followed by the dollar sign, followed by at
    least one
    digit, followed by <font size="-2">US</font>,
    followed by a right parens.
    Mick
    >
    > it's supposed to find everything inside the square
    brackets - but it misses
    > the closing parenthesis after </font>. I need to
    find this string and replace
    > with nothing to remove the string from any/all pages. Is
    there a reason why
    > it's missing the closing parenthesis? I was actually
    able to add a few more
    > parenthesis (e.g. "))))") before OR after the closing
    square bracket and it
    > still found the original text minus the closing bracket
    and the extra
    > parenthesis didn't prevent the text from being found.
    >
    > Any help is appreciated!
    >
    > James...
    >

  • Input for expression in VISA find resource to detect RS-232 and RS-422 separately

    Hi
    I am able to find all the COM ports available in the system but how to separate RS-232 port and RS-422 from the find list. Is there a expression to find only RS-232 port and only RS-422 port.

    Depends on what you exactly want.
    Maybe on of the serial property nodes can help
    Or you can name each port with an alias  in MAX.
    Kees

  • What does VISA Find Resource use as source data?

    When a Serial Resource (e.g. COM1) is busy with another application, I want to tell the operator this, specifying the COM number in question. It appears the Port Binding (e.g. COM1) is not known until a successful VISA open has exececuted.  Although I could indicate the alias (e.g. ASRL1::INSTR) that is busy, its not very meaningful.  Visaconf.ini has this information. Is it the right place to go for it?

    Yes, this file contains the mapping between the VISA names and the System names. It is the section ALIASES you need.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Find text by regular expression

    I'm struggling with a problem. I have some files that contain a string like:
    "name": "someName"
    I can find these using egrep like so:
    egrep -r '"name": "[^"]*"' /some/folder/path/
    This works admirably, except that it returns more than I really want. It gives me something like this:
    /path/to/Chrome/extension/manifest.json:   "name": "Extension Name"
    What I really want is just the name itself, eg:
    Extension Name
    I don't care about anything else. I'm running these searches from an AppleScript, which already knows what folder it's looking in, and just needs to know 1) if a match was found, and if so, 2) what the name was.
    How can I do this? Is there a way to do a search that only returns a particular portion of the results, or would I need to run the results through something else to filter it further?
    Thanks in advance!

    MrHoffman wrote:
    If I've guessed correctly at what you're doing
    Heh... I imagine you have. I wasn't sure who might frequent this forum, so didn't want to make any assumptions.
    You may or may not know that I have an EtreCheck-like script that I use in conjunction with my Adware Removal Tool. It has proven to be extremely helpful in locating new adware, but it still somewhat limited in getting information on Firefox and Chrome extensions. It has proven difficult to get names, especially for Chrome extensions. I'm working hard on trying to improve it.
    An excerpt from a sample manifest.json file in a Chrome extension - modified slightly for clarity - looks like this:
       "manifest_version": 2,
       "name": "Some extension name",
       "offline_enabled": true,
       "version": "6.3"
    I'm using egrep to search for this "name" key so that I don't have to make too many assumptions about the internal structure of the extension folder. I know the manifest.json file is in there somewhere, and will have this key in it, so this is an easy way to find that name. To just display the name, the simple egrep I'm using is adequate, but in some cases there's special data in that name string that indicates where to find a localized name, so I need to be able to do something special in those cases, and need just the name string and nothing else.
    The solution turns out to be a combination of several responses. The addition of the -o and -h flags gets me close to what I want, and passing it through cut with a double-quote as the delimiter works to trim it down perfectly. So now I can do:
    egrep -roh '"name": "([^"]*)"' /path/to/folder/ | cut -d \" -f 4
    The egrep will return:
    "name": "Some extension name"
    Passing it through cut with the above parameters gives exactly what I need... just:
    Some extension name
    Thanks to all for the advice!

  • VISA Find function to VISA Resource Name

    Hi,
    Can anyone help me with this VISA question. I'm kind of new to
    instrument control, but have been using LV for quite a long time. I'm
    using version 6.02. I discovered the VISA Find Resource function, and
    thought it would be really neat to find the instruments that are sitting
    on my GPIB bus, and then make sure they are the ones I need for my
    testing. The Find resource works great, and returns an array of strings
    that are the resource names of the instruments. i.e. GPIB0::5::INSTR.
    However, the VISA Open (and all the other VISA functions) require a VISA
    resource name control (One of those pruple doohickies with I/O in it).
    I haven't been able to figure out how to get that string from the find
    function into the VISA resou
    rce name control (It looks like a pulldown
    on the front panel) so that I can do a *IDN? query to find out what
    instrument is actually at this address. I've tried property nodes, even
    looked at the invoke node, but to no avail. By the way, the property
    node DID have the VISA resource name, but it was read only.
    Thanks in advance for any help you folks might be able to provide.
    David Dupont
    Airvana Inc. http://www.airvananet.com

    Hello, David!
    I'll do my best to answer your question.
    In LabVIEW 6, you have to assign VISA aliases in Measurement and Automation Explorer. You can assign meaningful VISA Aliases to your instruments that you control using VISA in the Devices and Interfaces section in Measurement & Automation Explorer. The aliases can be used in your LabVIEW application development to refer to your instrument.
    Once you have assigned aliases in MAX, you simply place a VISA Resource Name Constant in your block diagram. Type the alias name into the resource name constant and wire the name constant to the VISA Resuorce Name input of the VISA Write and VISA Read functions to control your instrument.
    I hope this helps.
    Mark Ridgley

  • Regular Expression ambiguous

    I know the purpose of that code , but I don't understand it Sad
    SQL> SELECT REGEXP_SUBSTR(
    'The final test is is the implementation',
    '([[:alnum:]]+)([[:space:]]+)\1') AS substr
    FROM dual;
    SUBST
    is is
    I study Regular Expression nowadays , from that link :-
    http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.html
    but I'm still need more good resources for ( Regular Expression white paper ) until I can understand all benefits , hence I can take Full Control of it.

    just one thing to be aware of unrelated to backreferencing:
    that Regex is less than perfect for the purposes of matching multiple words together:
    SELECT REGEXP_SUBSTR(
    'The diagram is isometric',
    '([[:alnum:]]+)([[:space:]]+)\1') AS substr
    FROM dual;so perhaps something like this:
    SELECT REGEXP_SUBSTR(
    'The diagram is isometric and and in pencil',
    '([[:alnum:]]+)([[:space:]]+)\1\2') AS substr
    FROM dual;using the backreference again to find the same space after the second word
    but then again, this doesn't work perfectly because what if there's only one space after the second word but two after the first... and what if the duplicate word is at the end of the string without any other characters after it at all!!!!
    find someone who can write a perfect regex and you'll have found someone who has too much time on their hands... :-P

Maybe you are looking for

  • Delay time data at Daily Production Report

    Hi all We hereby crated the Daily Production report which has the delay deatils of all depts. The delay details we are using with notifications. The problem is users required the shift wise delay according to the production. SAP std we couldnt keep t

  • ITunes unable to load data class information from sync services- try again later

    I am unable to connect my device to the computer, and this message appears after the device fails to connect.

  • Updating a table in a single screen without changing the table vie

    Hi, I have a master - detail table base on 2 VOs attached to 2 EO. This 2 Vos are linked via ViewLink by ID; What I want to achieve is to place a messageTextInput field in detailTable->tableActions region. After the button in this region is pressed t

  • Deploy EAR to weblogic 10.3.4

    I get a war file which works fine on Tomcat. I create a jdev project based on this war and deploy it as an EAR. I create weblogic-application.xml for an EAR file and deploy it to weblogic 10.3.4 with EM extension. But I get errors as follow. If I dep

  • Preserve data from one instance of a workflow to another

    Hi all, I have a quite general question which has been bothering me for a while. It has to do with preserving data between instances of a workflow. What I need is to preserve some data from one instance of a workflow (as a task in the WF) and then st