How to convert a string to visa resource name

I have a string , like "visa://192.168.123.212/RIO0::INSTR", how can I convert it to a Labview visa resource name? The resource name is going to be used for "Open VI reference" control.
Also, a related question is , is there a special vi control for ip address input?  How do I check whether the input ip address is in valid format or not? 

Just wire it up. A string will coerce to a resource name.
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

Similar Messages

  • How to convert a string into an objects name?

    Hi
    I have the following problem;
    I have a string
    String a = "e1"
    and a method
    call(Event e1) that calls the "Event" class with object the name of the string a.
    How can I convert the strings name into an object so as to use it in the "call" method?
    Any ideas?
    Thanks in advance

    I don't know if this helps you, but you can do things like this.
    String a = "com.example.SomeEvent";
    //Instantiate com.example.SomeEvent
    Object o = Class.forName(a).newInstance();SomeEvent must have a non-argument constructor for this to work.
    Class that will be instantiated depens on runtime value of String a, and can be different across different executions of the program.

  • How to convert a String variable as class name and method name?

    i have two classes
    class Student
    public String insertStudent(String sname)
    { return("Student has been inserted ");     }
    class Teacher
    public String execute(String methodName, String className)
    {  //return statement of the method 'insertStudent' in the class 'Student'; }
    }Now, i have a class with the main method. Here, i would like to call the method *'insertStudent'* of class *'Student'*
    using the method *'execute'* of class *'Teacher',* passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Can anyone please help me out. Thanks
    regards,
    chinglai

    You should have just added that as a comment on your [initial posting|http://forums.sun.com/thread.jspa?threadID=5334953] instead of starting a new thread.
    Now, i have a class with the main method. Here, i would like to call the method 'insertStudent' of class 'Student'using the method 'execute' of class 'Teacher', passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Why oh why? What do you want to achieve?
    Let me tell you: there is a way to do what you try to do, but it's not recommended and should be used only very sparingly. Especially not in anything like your code, that resembles normal business logic (as opposed to an application framework such as Spring, for example).
    Can you explain what exactly you want to do with that? Why should a Teacher be able to call any random method ony any other class. And what good would that do?

  • How do I convert visa resource name into string?

    Could please anybody help? I have an ergent need. How do I convert visa resource name into string?
    Thank you in advance.

    Most times you do not need to convert it. Just wire it stright into what ever string input.
    See "Format Into Srting" or "Type Cast" functions
    Omar

  • How to convert a VISA Resource Name to String?

    I would like to convert a VISA Resource Name (invalid reference) to string so I can open a session to a GPIB instrument.

    You can typcast the VISA Resource Name, but I usually just treat it like a string. You can connect it directly to string indicators or to any VI that takes a string input. You can even search, concatenate and split it like a string. You can also feed strings into the VISA Resource Name inputs of the VISA functions.
    Rob

  • How is VISA resource name & COMport name mapping done?

    I want to give names like COM1 etc. on front panel. On diagram how to convert it to VISA resource name, in order to be able to give it as I/P to open VISA session vi.

    You may want to use the friendlier names that NI-VISA can give you. I'm attaching a VI that gets those names for you in both LabVIEW 6i and 6.1, since you don't mention your version.
    Starting with NI-VISA 3.0 (coming soon), you'll also be able to use names like "COM1" even if MAX is not on the system. However, that is a feature for only Win32 and LabVIEW RT, since those names do not exist on Unix systems. So a VI making use of that feature will not be completely platform independent.
    Dan Mondrik
    Senior Software Engineer, NI-VISA
    National Instruments
    Attachments:
    FindSerial60.vi ‏29 KB
    FindSerial61.vi ‏29 KB

  • How to convert a string value to date

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    In your post you ask how to convert a string value to a date.  The value returned from the Get-AdUser is already a date.  It does not need to be converted.
    Bill has sshown one way to convert a date to a string and there are other methods.  You need to clarify your question.
    If you are really trying ot convert strings to dates then you can start with this:
    [datetime]'01/21/1965 13:33:23'
    Most date strings aer autodetected by the class.
    ¯\_(ツ)_/¯

  • How to convert a String("yyyy-mm-dd") to the same but in Date format ?

    Hi,
    can anyone plz tell me how to convert a String to a date format.I'm using MSACCESS database.I want to store this string in the database.So i need to convert it to a date format since the table is designed such a way with date/time type for date field.I used SimpleDateFormat ,but i can't able to convert.The code is given below:
    coding:
    public String dateconvertion(String strDate)
    try
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd");
    Date date = sdfSource.parse(strDate);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd ");
    strDate = sdfDestination.format(date);
    catch(ParseException pe)
    System.out.println("Parse Exception : " + pe);
    return(strDate);
    }

    i used prepared statement even now i am getting error like this.....
    i have included the prepared statement package also...
    my coding:
    ResultSet rsdatetemp = null;
    PreparedStatement ps = null;
    String query ="select distinct itemcode from sales where bill date between ? and ?";
    ps = precon.prepareStatement(query);
    ps.setDate(1,d1);//d1 and d2 are in date format
    ps.setDate(2,d2);
    rsdatetemp = ps.executeQuery();
    error :
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(1,d1);
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(2,d2);

  • How I can saving visa resource name in windows registery and load it again?

    I use visa functions in my program for serial communication , I want to save selected resource name in windows registery and next time that i run my program, i want to read it from registery and assign it to my visa resource name control.
    example:         My visa resource name control value = COM2
                            I close my program with this value (how i can easily save COM2 to windows registry key ?)
                            I open my program again (how i can load COM2 in my resource name control from registry Key?)
                            How i can access to visa resource name list? example: COM1     COM2      LPT1     COM56     COM255
    Thanks.
    Solved!
    Go to Solution.

    I guess I don't understand your problem. All you have to do is ready the key containing the desired resource name and wire the resulting value to the appropriate terminal on the open VI. That's as hard as it gets...
    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 convert a String to an Icon

    Hello,
    I'm trying to figure out how to convert a String (specifically one letter) to an Icon for a JTree. The program I am working on uses .png files for the icons at the moment, with each .png being a single uppercase letter. However, recent discussion has us wanting to change to something more dynamic, since we anticipate needing new letters in the near future.
    My task is to modify the current codebase so that the Icons used to identify nodes in the tree are created from a Font within code, rather than reading in .png files. I have done some experimenting with creating a Label with just that String, setting the font and trying to extract the image using calls like createImage(int width, int height) and so on, but so far to no avail.
    If I could figure out how to at least convert the String to an image, I could probably make it work (since I can play around with creating an ImageIcon with that image). Thanks in advance for any help.
    Allan

    Here is some quick and dirty code:
    import java.awt.*;
    import javax.swing.*;
    public class BasicIcon implements Icon {
        private String text;
        public BasicIcon(String text) {
            this.text = text;
        public int getIconWidth() {
            return 16;
        public int getIconHeight() {
            return 16;
        public void paintIcon(Component c, Graphics g,  int x, int y) {
            Color old = g.getColor();
            g.setColor(c.getForeground());
            g.drawString(text, x, y+13);
            g.setColor(old);
        public static void main(String[] args) {
            JPanel cp = new JPanel();
            for (char ch = 'A'; ch < 'F'; ++ch) {
                cp.add(new JButton("letter " + ch, new BasicIcon(String.valueOf(ch))));
            JFrame f = new JFrame("BasicIcon");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(cp);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }One thing that could be improved is the vertical positioning of the letter in the Icon.
    The x,y values passed into paintIcon are the upper-left hand corner of the icon,
    but the y value needed by drawString is the position of the String's baseline.
    To do it right, use one of Font's getLineMetrics methods and play around with ascent.

  • How to convert a string from upper case to lower case in FOX formula

    Hi Experts,
    How to convert a string from upper case to lower case in FOX formula?
    Thanks,
    Cheers!!!
    PANKAJ

    The last result.append( c ) should be:
    result.append( Character.toLowerCase(c) );

  • How to convert a string from lower case to upper case withour using transla

    Hi all,
    how to convert a string from lower case to upper case withour using translate,
    Thanks in Advance,
    Reddy

    Refer to this related thread
    Re: hi guys this very urgent please help

  • How to convert a String to an array

    Can somebody tell me how to convert a String to an array

    ronisto wrote:
    Can somebody tell me how to convert a String to an arrayI assume you mean to convert it into an array of the individual characters that comprise the String.
    Can you not simply look at the API documentation? Nothing in the String API jumps out at you?
    http://java.sun.com/javase/6/docs/api/index.html

  • How use USB with VISA resource name?

    Hi, 
    I'm new at LabVIEW and I'm working on a code that has to acquire data from a measurement device.This device only has a USB output so I have to work with it. As far as know the block that is used to refer a external port is VISA resource name. I have installed a driver that recognizes the serial ports, and they appear in the list of VISA resource file at front panel. So I figured that installing the product's USB driver so the USB's ports would appear. I installed and nothing of USB ports. I don't know it is that simple or working with USB ports is a little bit harder. I've tried a lot of things and nothing worked so here I am.
    PS: I have noticed that the driver's version is 64 bits (my pc is 64 bits)  and my LabVIEW version is 32 bits, so could that be the problem?
    The device by the way is Digital Analyzer WT500, Yokogawa.
    Thank you.
    Solved!
    Go to Solution.

    Victor,
    the suggestion of Instrument Driver is to make more easy using the instrument. 
    Normally, you should install a windows drive from manufacturer (if it isn't installed, the instrument will appear like a pendrive in device manager) and the NI VISA. But for some instruments, the manufacturers have API's that uses NI VISA to communicate with your equipments.
    So check if your instrument appear correctly in device manager (as indicated by Yokogawa). If not, check if Yokogawa has an appropriated driver for this instrument and install it. 
    Is it clear?
    If you prefer, contact NI Brazil Support by website or by phone (11)3149-3149 Ext 3.
    Ricardo Ramos
    Engenheiro de Vendas - Sul
    National Instruments Brasil

  • How to get GPIB address from VISA resource

    Hi All,
    Is there a way (CVI API) to get the GPIB address of a GPIB instrument from an alias or a VISA resource name defined in MAX?
    Thanks,
    Rick.

    Thanks mkossmann, I was actually looking for an api that would get the gpib address from the visa resource name defined in MAX which has already scanned in the gpib instruments.
    I guess it may not be good that way even if there's such an api because instrument gpib address might get changed and if MAX has not been asked to rescan then the address will be out of sync.

Maybe you are looking for

  • My apple tv is not streaming video without stopping

    When streaming films from my mac air to apple TV  the internet steaming is non stop But the apple TV stopped while it is buffering. So although the film runs without stopping on the Mac Air screen it keeps stopping when being mirrord on the HD Tv via

  • Display Modes and Aspect Ratio

    I have a project that contains 4:3 and 16:9 footage. It is being prepared for 4:3 VHS release as well as 16:9 DVD release. For the DVD, I have exported all footage out of FCP from a 16:9 timeline. The VHS master is being sent to get captioned and the

  • Gifs not displaying in web

    We have our application specific gif file in a jar file, and have placed this jar file in the virtual directory specified in our registry.dat file. The JInitiator console claims it finds the jar file and appears to be using other classes contained in

  • Lightroom 4 on Mac issue

    Tonight I did a shoot and,downloaded card to Mac from Image Capture,opened folder in LR 4. I pixel peeped and found random HUGELY out of focus images and it looked like they were all cut with zig zag pinking shears.I closed LR4 and opened them up in

  • How to get filename with MMDDHHSS

    Hi How can I get file name with extension MMDDHHMM...I know time stamp is availabe but in the target system can only accept 10 characters. Example EL10020120 It there any way I can acheive the same. Regards