TCP/IP Instrument & Socket Classes in VISA

I have been trying to use the new Labview 6i VISA classes for TCP/IP
communications and NI has not been much help so far. I tried
specifying IP address strings as shown in help section for the "VISA
Open" command. Every time I attempt to open a session with either of
the specified TCPIP syntax:
TCPIP INSTR TCPIP[board]::host address[::LAN device name][::INSTR]
TCPIP SOCKET TCPIP[board]::host address:ort:OCKET
I get an invalid resource parsing error. I have tried every possible
permutation of the allowed syntax that I can think of with no luck. The
tech support at NI seems never to have attempted to use this feature.
Are these classes even supported yet?!? Can't find any documentation
or examples other than the "VISA Open" help section. Thanks for any
help.
Max
Sent via Deja.com
http://www.deja.com/

Max:
These certainly should have worked with LabVIEW 6i; I know we did even more testing in the latest releases (LabVIEW 6.1 and NI-VISA 2.6) and the TCPIP stuff in VISA certainly works. Here are a couple of example resource strings that will parse correctly (and should have with NI-VISA 2.5 as well).
For SOCKET, this is just like the traditional TCP functionality in LabVIEW. An example string that connects with the NI FTP site is:
"TCPIP::ftp.ni.com::21:OCKET"
For INSTR, this requires a device that supports the T&M standard LAN instrument protocol. An example of this (that we have tested with) is the Tektronix 3054 Scope. A string that connects with this scope is:
"TCPIP::HostnameOrIP::gpib0,1::INSTR"
Dan Mondrik
Senior Software Engineer,
NI-VISA
National Instruments

Similar Messages

  • I need a reliable (auto reconnect, no data loss, etc) TCP/CP Socket class

    I have been searching for a third party (free or pay) socket class that will do things that all of us programmers must do:
    reconnect when socket is disconnected
    reconnect and re-send data (so no data loss)
    and implementing all of these other features that we all require for "reliable" network communications over public networks.
    I would like to use this socket class on both my client and server applications. Does one exist somewhere? It certainly must. I want something that is tried and proven. free is great with open source but paying money is okay too. thanks !

    I am surprised at these responses. Using JMS or creating my own ARQ seems to not meet my requirement (lots of overhead in the case of JMS you usually need a middle "server" and the overhead is huge in high bandwidth situations -- lots of cpu and extra bandwidth -- and the ARQ is a nice idea but i really dont want to create anything myself)
    The fact is TCP/IP is unreliable over the internet. anyone who tries to use sockets over the internet recognizes this. It is not an issue of my application but the fact of the internet. the internet is designed with the assumption that the internet is unreliable (hence why the government created ARPA and the internet)
    so what if i loosened the requirement and said it was okay to lose some packets, but i just need something that knows the other side is alive and will reconnect/discnonect appropriately? doesnt this exist already? i mean every tcp/ip programmer is doing this and anyone who implements tcp/ip with the assumption that the "network is reliable" is going to be in big trouble. It doesnt need to be TCP, it can be a reliable UDP (i dont care what transport is used) but i just need something where i can take my existing code, drop in this new class instead of "Socket" and get my project done. it would be nice if it had features like reconnecting, dropping data if it is too old or if there are too many messages. i will be using it in high bandwidth applications (20-50mbps over the internet) and dont need 100% packet reliability, if we drop some packets due to a hiccup that is ok, but i do need it to be intelligent in reconnecting and such.

  • Variable port in Socket class

    How does the variable "port" in the socket class point to the Network interface?

    How does the variable "port" in the socket class when
    given a value point to the specified port?I don't understand this at all, sorry.
    Also is there any way a port can be binded to and
    controlled when in use by an application like
    NetBios? ie opening or closing therby stopping the
    applications usage over a LAN.If a port number is already in use you can't do anything with it except try to connect to it.
    May I suggest Stevens TCP/IP Illustrated volume I.

  • The connect function in the socket class has problems

    when i call this function connect(SocketAddress endpoint, int timeout)
    the timeout variable doesnt wait for the specific time that i tell it
    example
    connect(endpoint, 10000);
    this call should wait for this amount of time but it doesnt wait that amount
    any body has a answer ???

    yes that is exactly what I am saying
    I specify 10 sec, as 10000 milli sec's in the connect function but I get an exception almost imediately when i run my java program...
    run this code
    import java.net.*;
    public class Test
    public static void main(String [] args)
    { Socket s = null;
    int port = 2000;
    try
    s = new Socket();
    InetSocketAddress i = new InetSocketAddress("localhost",port);
    //this next line should wait 10 sec's then throw and exception
    //but it throws and exception upon running the this code
    s.connect(i,10000);
    catch(Exception e){ System.out.println(e.toString()); }
    }//main
    }//Test
    I have also tried setting the setSoTimeout(10000) in the Socket class but
    still with no success...
    I dont know why this doesnt wait 10 sec's then through an exception on it
    and when i try it with a java server it connects instantly...
    any help anyone???

  • Stupid question - method missing from Socket class

    I'm sure I am just missing something here. I am using getInputStream from Socket class successfully - now want to add setKeepAlive method - I am getting an error:
    Method setKeepAlive(boolean) not found in class java.net.Socket.
    client.setKeepAlive(true);
    client is defined as a Socket
    Socket client = origSocket.accept();
    What am I screwing up here?? I know the classpath is correct since I am and have been using getInputStream with this socket for months!!
    Thanks for any responses!
    Beth

    javac is the compiler, not the run-time. That would have nothing to do with what the classpath is at run-time, which would either be the system environment variable CLASSPATH, or the -cp command-line parameter to java, not javac.

  • Listening socket class freezes my program

    i originaly created a listening socket in my main gui class but everytime i execute it, my gui appears with no visible components inside and freezes. i am not able to close the gui window by clicking on the x button at teh top right hand corner.
    i then removed my listening socket and made a new class altogether that listens to socket connection. i get the same problem when i execute both my gui and listening socket class. any suggestions?
    heres my socket listening class
    package icomm;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class listening {
        /** Creates a new instance of listening */
        public listening() {
         public void listeningSocket()
                ServerSocket server = null;
                boolean listening = true;
                try
                    //listen in port 4444;
                    server = new ServerSocket(14);
                catch(IOException x)
                    JOptionPane.showMessageDialog(null, "cannot listen to port 4444", null, JOptionPane.ERROR_MESSAGE);
                while(true)
                     ChatDialog w;
                    try
                      w = new ChatDialog(server.accept());
                      Thread t = new Thread(w);
                      w.setVisible(true);
                      t.start();
                     // server.close();
                    catch(IOException x)
                        JOptionPane.showMessageDialog(null, "could not open chat window", null, JOptionPane.ERROR_MESSAGE);
    }and here is the code that launches the gui and the listening class from my login button..
    //laod main gui
                        show_main_gui(text_username.getText());
                        //run listening socket
                        listening listen = new listening();
                        listen.listeningSocket();

    you do not need any thread for this - the socket will not block your frame. here is an example which works:
    import java.net.ServerSocket;
    import javax.swing.JFrame;
    public class Sockframe extends JFrame{
         public Sockframe(){
           super("Socket using Application");
           setDefaultCloseOperation(EXIT_ON_CLOSE);
           setSize(100,100);
          * @param args
         public static void main(String[] args) {
              // show new Frame
              Sockframe f = new Sockframe();
              f.setVisible(true);
              try{
                   // do socket stuff
                   ServerSocket s = new ServerSocket(4567);
                   s.accept();
              } catch(Exception exc){
                   exc.printStackTrace();
    }Did you provide some default close operation for the frame? The frame needs this to know how to behave when the X-button os pressed.

  • Extending the Socket class...

    I need some help. The class below, SimpleSocket, extends the built-in
    Socket class and adds two methods to it. These methods are meant to
    make the class a bit more user-frienly but simplifying the reading-from
    and writing-to a Socket object. Here it is:
    bq. import java.net.*; \\ import java.io.*; \\ public class SimpleSocket extends Socket { \\ BufferedReader in; \\ PrintWriter out; \\ public void println(String line) throws IOException \\ { \\ if (out == null) { out = new PrintWriter(this.getOutputStream(), true); } \\ out.println(line); \\ } \\ public String readLine() throws IOException \\ { \\ if (in == null) { in = new BufferedReader( new InputStreamReader(this.getInputStream())); } \\ return in.readLine(); \\ } \\ }
    If I want to create a new SimpleSocket, it's easy - I can instantiate it like a normal Socket:
    bq. SimpleSocket socket = new SimpleSocket(host,port); // assume host & port have been defined
    Now, lets say I have a Socket object that I didn't created - for
    example, a Socket returned from the ServerSocket class - like this:
    bq. ServerSocket serverSocket = new ServerSocket(port); \\ Socket clientSocket = serverSocket.accept(); // returns the socket for communicating with a client
    Now that I have a regular Socket object, is there some what to
    "upgrade" it to a SimpleSocket? Something like this: (pseudocode):
    bq. clientSocket.setClass(SimpleSocket); // this is pseudocode
    Or, could I make a SimpleSocket constructor that accepted a Socket
    object as a parameter and then used it instead of creating a new
    object? Like this: (psuedocode):
    bq. public SimpleSocket(Socket S) \\ { \\ super = S; // this is pseudocode \\ }
    Any ideas would be greatly appreciated.
    Lindsay
    Edited by: lindsayvine on Sep 15, 2007 10:50 PM

    lindsayvine wrote:
    Ok, this makes sense and this is what I will probably do. However, there are three limitations to this method that I don't like:
    1. I would like to be able to pass the SimpleSocket object around as a normal Socket. I would like SimpleSocket to be castable to a Socket.Would you? What for? Are you sure? Would input and output streams not be better objects to pass around? You might well have the requirement you say you have, but I say it's an assumption to be challenged, at the very least
    2. I would like every method of the Socket object to be available - this would means that I have to rewrite out every method in SimpleSocket - instead of just saying "hey SimpleSocket, you should have every method Socket has"Yep. But using inheritance simply to avoid some typing is no reason to use inheritance. This is all providing that you need to have every method available. Remember, if any dependent code needs the underlying socket object, your interface can always expose it
    3. If I do write out every method, but then the Socket object gets new methods in future versions of Java, I will have to add the new ones.Likewise, in the case of such a change to java.net.Socket, your subclass has a very real chance of breaking. Again, consider if your code needs to exactly replicate everything a Socket does
    Can you think of any way around these problems?
    Sure. Re-think your design

  • Weird acting of Socket class while build for iOS device

    Hello,
    It's kind of weird and frustrating using Socket class to build package for iOS device (iPad in my case) - I do have the certificates files (P12, Provisioning) and I can build a package from FB4.5.1 too, but if I build the package as 'Fast' mode through 'Run Configuration' wizard the Socket works okay, but if I package with 'Standard' mode it never works - even I tested both the modes in same device! Any suggestions/idea - I couldn't able figure out why it's acting strange in different modes!
    Thank you.

    This is still become ridiculous - I've read in a document online that non-working socket has bug-fix with AIR 2.7, I was using 2.6 previously - so I downloaded the latest AIR 3.0 SDK and rebuild the project - yet its not working! This is ridiculous!

  • XML Socket class

    Hi....thanks for your help in advance......anyway.....does
    flash media server 2 support the XML socket class? if not where do
    i get a server that will support the xml socket class?

    http://moock.org/unity/docs/client/simplechat/as2version/index.html

  • Crash connection over Internet using TCP/IP SSL sockets

    I'm doing a file Transfer WEB Client/server Application using TCP/IP SSL Sockets?
    In an internal LAN the file Transfer work pretty well but in Internet this Crash (downturn the file transfer).
    the code in Client to connect to server is:
    SSLSocketFactory sslFact = (SSLSocketFactory)SSLSocketFactory.getDefault();
    socket = (SSLSocket)sslFact.createSocket(c.site, c.PORT);
    String [] enabledCipher = socket.getSupportedCipherSuites ();
    socket.setEnabledCipherSuites (enabledCipher);
    out = new ObjectOutputStream(socket.getOutputStream());
    in = new ObjectInputStream(socket.getInputStream());
    The code in Server to wait client connections is:
    Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
    try {
    SSLServerSocketFactory factory = (ServerSocketFactory) SSLServerSocketFactory.getDefault();
    SSLServerSocket sslIncoming =
    (SSLServerSocket) factory.createServerSocket (PORT);
    String [] enabledCipher = sslIncoming.getSupportedCipherSuites ();
    sslIncoming.setEnabledCipherSuites (enabledCipher);
    while(running) {
    SSLSocket s = (SSLSocket)sslIncoming.accept();
    newUser(s, pauseSyn);
    } catch (IOException e) { System.out.println("Error: " + e); }
    Some help with this topic, show me the ligth? what is bad?

    Hi,
    Can you show us the stacktrace?
    /Kaj

  • TCP/IP instrumented debugging with Blackfin EZ-kit

    I have been evaluating the LabVIEW for Blackfin with a BF537 EZ-Kit the last few days...so far, I have been able to get all the example programs to run using the non-instrumented USB debugger interface.
    I have run the Web Server Buttons example, and I can cause the LEDs to blink by pressing the buttons on the browser interface, so I know that my crossover cable and DHCP server are running correctly on my laptop, and that I can communicate with the EZ-Kit over TCP/IP.
    When I get to the example where they want you to debug using the instrumented TCP/IP debugger interface, the program loads using USB, then I get a dialog box that looks like it's trying to make a connection to the EZ-Kit via TCP, but the dialog disappears after a 20-30 seconds, and the program does not run.  During the time the dialog is waiting to connect, I can ping the EZ-Kit from a DOS box and the EZ-Kit has acquired an IP address from my DHCP server.
    What I am wondering is this:  how does the debugger interface know what the IP address is to perform the instrumented debugging?  Is there a config file somewhere that I need to enter an IP address into?  Does the debugger use UDP to find the EZ-Kit?  The debugger does not seem to be able to find the Ez-Kit, and it occurs to me that I haven't told any of the LabVIEW components what IP address that EZ-Kit will have....

    The implementation of the Blackfin target is partially located in "plug-in" VIs that you can access. Open "C:\Program Files\National Instruments\LabVIEW 7.1 Embedded\resource\LabVIEW Targets\Embedded\vdk\vdk_LEP_TargetPlugin\LEP_vdk_ScriptCompiler.vi". You can see in the attached screenshot where this plugin VI determines the IP of the host PC and concatenates it in as a compiler flag. You can modify this LabVIEW code to hard-code that IP if you have multiple IP addresses, or even add functionality to programmatically get the correct IP address!
    Message Edited by Michael P on 09-14-2006 02:22 PM
    Michael P
    National Instruments
    Attachments:
    BFIP.JPG ‏49 KB

  • Flexiable Communication through TCP/IP or RS-485 using VISA

    I am trying to create a flexiable distributed application that can communicate over RS-485 or TCP/IP visa.  The application has a basic Host / Client(Listener) type of Architecture.  What I would like to be able to do is simply to change my Visa resource name from [Com4] to [TCP::192.168.1.10::3000::socket] and seemlessly change communication protocals.  The problem I am running into is creating a flexiable visa listener.  I tried using the visa events vi's, but I don't know what the syntax of the visa string should be.  Any thoughts or clarifing questions would be apprecaited.

    Hi,
    I am using Compact FieldPoint 2120 with analog I/O to control a robot arm and i am trying to interface a third party device such as a mobile phone (using Java) to program and control the rotation of each joint of the robot arm. I understand this process can be done through TCP/IP or usign DSC software.
    For example:
    Hosting on TCP port (?) and use the syntax
    [newline]::[joint number]::[degree of freedom]::[set to angle in degrees]::
    [arm number] = an ascii value 1 or 2 to determine which arm.
    [joint number] = an ascii number value.
    [degree of freedom] = ascii value x,y or z.
    [set to angle in degrees] = ascii value between 0 and 360.
    The true is that i have no clue how to set up the interface steps and i will appreciate if someone can suggest an easy way of doing the above steps and which software to use. I am currently using LabVIEW 8.20 for building the control model for the robot arm.
    Many thanks
    Bakari

  • This problem has troubled me two days!class cant visit class between jars;

    I set classpath: CLASSPATH:C:\Documents and Settings\xxxx
    in this directory,I have a jdbc.jar and a sub directory named t,Test class in t ;
    Test class code here:
    package t;
    import jdbc.DateParser;
    public class Test{
        public static void main(String[] args){
            DateParser parser=new DateParser();
            String s=parser.formatDate("1987/9/9");
           System.out.println(s);
    }I do this:
    C:\Documents and Settings\xxxx>java t.Test
    1987/09/09 00:00:00
    this Test class run successfully
    and I do this(note: in MANIFEST.MF,just only this words at first line : Main-Class: t.Test) :
    C:\Documents and Settings\xxxx>jar cvfm t.jar MANIFEST.MF t
    list (manifest)
    add:t/(read= 0) (write= 0)(stored 0%)
    add:t/Test.java(read= 237) (write= 159)(compressed 32%)
    add:t/Test.class(read= 524) (write= 347)(compressed 33%)
    C:\Documents and Settings\xxxx>java -jar t.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: jdbc/DateParser
    at t.Test.main(Test.java:5)
    this execution is failed?
    why??
    this problem has troubled me two days!I really need help!

    C:\Documents and Settings\xxxx>jar tvf jdbc.jar
    0 Thu Nov 04 21:16:20 CST 2004 META-INF/
    91 Thu Nov 04 21:16:20 CST 2004 META-INF/MANIFEST.MF
    0 Tue Nov 02 23:32:50 CST 2004 jdbc/
    547 Sun Oct 31 18:54:08 CST 2004 jdbc/Blob.class
    4280 Fri Oct 29 23:28:40 CST 2004 jdbc/ResultSet.class
    2100 Sun Oct 31 23:45:56 CST 2004 jdbc/Statement.class
    2438 Thu Oct 28 22:22:32 CST 2004 jdbc/Connection.class
    1384 Thu Oct 28 22:11:42 CST 2004 jdbc/HStream.class
    2172 Thu Oct 28 22:20:08 CST 2004 jdbc/Test.class
    3347 Sun Oct 17 21:23:38 CST 2004 jdbc/DateParser.class
    4495 Wed Oct 20 17:19:26 CST 2004 jdbc/Sorter.class
    Actually, ignore that. I think the problem is you are using "java -jar xxx". This runs the JAR in encapsulated mode, which ignores any classpath setting.you mean using "java -jar xxx" cant let xxx visit a class that in another jar?
    if that,what command shoud I use?

  • TCP/IP Server Socket using Java Proxy (Sender) ?

    Hi,
    I have requirement to listen certain port for third party POS system using TCP/IP Socket. Since there is no standard SAP TCP/IP Socket Adapter. I am planning to develop using Sender Java Proxy.
    Please advise whether this approach is workable ? or is there any related blog / forum discuss about Socket Server.
    This blog is only for socket client /people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
    Thank You and Best Regards
    Fernand

    When you want to have minimal effort, you can create a standalone Java program which listens on a port and transforms the incoming tcp/ip stream to an HTTP message, which you can send to SAP PI.
    With more effort you can create an TCP/IP adapter by your own, according to JCA architecture.
    A sender Java proxy does not have any runnable code itself, so the problem to create a listened is not solved.

  • Jsp Page session vaiable to java class and vise versa

    Hi to all,
    I am new to jsp, i have to programs, one jsp page and another java class. in jsp page i get the user data from html form and put the id in session. here i have to call the session vaiable to my java class where it (variable)initialize a file name.
    and same i have to call the java class to jsp page which insert statements to sql server,
    Please Help Me.

    //My Java Class file
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.servlet.http.HttpSession;
    import java.sql.Statement;
    public class StuInfo extends Object {
    //main method begins execution of Java application
    public static void main (String args[]){
    String StuFile = "C://"+iD+".txt"; // Here i have to get the session varaible.(ID)
    try {
    In my jsp Page i initilized session as
    session.setAttribute("ID",StuId);
    I am not able to understand where i have to declear the HTTPSession#getAttribute("ID");

Maybe you are looking for

  • Can we create RegionModel from TaskFlowBindingAttributes programmatically

    Hi dears, I'm using Jdev 11.1.2.3 I wanna programmtically create RichRegion, and set a RegionModel to value of RichRegion. But my issue is: i don't know how to create RegionModel from TaskFlowBindingAttributes or something else. For example: this is

  • How to translate an excel macro to ABAP code

    Hi Guys, My requirement is need to put the subtotaling option w.r.t divison when i download the file to an excel sheet via OLE. Iam able to get the records in the excel sheet but unable to write the macro in ABAP code. the macro which i recorded in E

  • Custom fields in ME21n ,step by step procedure/weblog ?

    I need to add a custom field zz1 to ME21N transaction at header level and make it available for input in the screen. Is there any step by step proceurec/approach which is generic for adding this functionality to any standard transaction? Rgds, Ajay

  • 6120 Classic celendar bug

    Hello! I'm experiencing a very unpleasant problem with my new 6120 classic. Every week at the night between Saturday and Sunday, my phone goes one day behind. The clock is still correct, but when I wake up and see my phone, he shows that today is Sat

  • PLZ HELP ME PROBLEM :- JSP Pages is slow

    HI, i am using oracle 10g application server to deploy my jsp pages. When i am running the jsp page ie. default.jsp which consist of three combo box which are dependent on each other. Database :- oracle 10g. Logic : I am retrieving all the data from